1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Windows Interface Reference: Font structure</title>
</head>
<body>
<h1>Fonts and Text </h1>
<p>The Font structure contains functions and structures to manipulate fonts and draw text.</p>
<pre>structure Font :
sig
type HDC and HFONT
type COLORREF = Color.COLORREF
type POINT = {x: int, y: int}
and SIZE = {cx: int, cy: int }
and RECT = { top: int, left: int, bottom: int, right: int }
datatype FontFamily =
FF_DECORATIVE
| FF_DONTCARE
| FF_MODERN
| FF_ROMAN
| FF_SCRIPT
| FF_SWISS
and FontPitch = DEFAULT_PITCH | FIXED_PITCH | VARIABLE_PITCH
and OutputPrecision =
OUT_CHARACTER_PRECIS
| OUT_DEFAULT_PRECIS
| OUT_DEVICE_PRECIS
| OUT_OUTLINE_PRECIS
| OUT_RASTER_PRECIS
| OUT_SCREEN_OUTLINE_PRECIS
| OUT_STRING_PRECIS
| OUT_STROKE_PRECIS
| OUT_TT_ONLY_PRECIS
| OUT_TT_PRECIS
and OutputQuality =
DEFAULT_QUALITY
| DRAFT_QUALITY
| OTHER_QUALITY of int
| PROOF_QUALITY
and CharacterSet =
ANSI_CHARSET
| CHINESEBIG5_CHARSET
| DEFAULT_CHARSET
| HANGEUL_CHARSET
| OEM_CHARSET
| OTHER_CHARSET of int
| SHIFTJIS_CHARSET
| SYMBOL_CHARSET
type FontWeight = int
val FW_BLACK : FontWeight
val FW_BOLD : FontWeight
val FW_DEMIBOLD : FontWeight
val FW_DONTCARE : FontWeight
val FW_EXTRABOLD : FontWeight
val FW_EXTRALIGHT : FontWeight
val FW_HEAVY : FontWeight
val FW_LIGHT : FontWeight
val FW_MEDIUM : FontWeight
val FW_NORMAL : FontWeight
val FW_REGULAR : FontWeight
val FW_SEMIBOLD : FontWeight
val FW_THIN : FontWeight
val FW_ULTRABOLD : FontWeight
val FW_ULTRALIGHT : FontWeight
type ClippingPrecision
val CLIP_CHARACTER_PRECIS : ClippingPrecision
val CLIP_DEFAULT_PRECIS : ClippingPrecision
val CLIP_EMBEDDED : ClippingPrecision
val CLIP_LH_ANGLES : ClippingPrecision
val CLIP_MASK : ClippingPrecision
val CLIP_STROKE_PRECIS : ClippingPrecision
val CLIP_TT_ALWAYS : ClippingPrecision
type LOGFONT =
{
height : int,
width : int,
escapement : int,
orientation : int,
weight : FontWeight,
italic : bool,
underline : bool,
strikeOut : bool,
charSet : CharacterSet,
outputPrecision: OutputPrecision,
clipPrecision : ClippingPrecision,
quality : OutputQuality,
pitch: FontPitch,
family: FontFamily,
faceName : string
}
datatype DrawTextMode =
DT_BOTTOM
| DT_CALCRECT
| DT_CENTER
| DT_EXPANDTABS
| DT_EXTERNALLEADING
| DT_INTERNAL
| DT_LEFT
| DT_NOCLIP
| DT_NOPREFIX
| DT_RIGHT
| DT_SINGLELINE
| DT_TABSTOP of int
| DT_TOP
| DT_VCENTER
| DT_WORDBREAK
and TextAlign =
TA_BASELINE
| TA_BOTTOM
| TA_CENTER
| TA_LEFT
| TA_NOUPDATECP
| TA_RIGHT
| TA_TOP
| TA_UPDATECP
and TextMetricPitch =
TMPF_DEVICE
| TMPF_FIXED_PITCH
| TMPF_TRUETYPE
| TMPF_VECTOR
and ExtendedTextMode =
ETO_CLIPPED
| ETO_GLYPH_INDEX
| ETO_IGNORELANGUAGE
| ETO_OPAQUE
| ETO_RTLREADING
type TEXTMETRIC =
{ height: int, ascent: int, descent: int, internalLeading: int, externalLeading: int,
aveCharWidth: int, maxCharWidth: int, weight: int, overhang: int,
digitizedAspectX: int, digitizedAspectY: int, firstChar: char, lastChar: char,
defaultChar: char, breakChar: char, italic: bool, underlined: bool, struckOut: bool,
pitch: TextMetricPitch list, family: FontFamily, charSet : CharacterSet }
val AddFontResource : string -> int
val <a
name="CreateFont">CreateFont</a> : LOGFONT -> HFONT
val CreateFontIndirect : LOGFONT -> HFONT
val CreateScalableFontResource : int * string * string * string -> unit
val DrawText : HDC * string * RECT * DrawTextMode list -> int
val <a
name="ExtTextOut">ExtTextOut</a> : HDC * POINT * ExtendedTextMode list *
RECT option * string * int list -> unit
val GetAspectRatioFilterEx : HDC -> SIZE
val GetCharABCWidths : HDC * char * char -> (int * int * int) list
val GetCharABCWidthsFloat : HDC * char * char -> (real * real * real) list
val GetCharWidth32 : HDC * char * char -> int list
val GetTabbedTextExtent : HDC * string * int list -> SIZE
val GetCharWidthFloat : HDC * int * int -> real list
val GetTextAlign : HDC -> TextAlign list
val GetTextCharacterExtra : HDC -> int
val GetTextColor : HDC -> COLORREF
val GetTextExtentExPoint : HDC * string * int option ->
{fit: int option, size: SIZE, extents: int list}
val GetTextExtentPoint32 : HDC * string -> SIZE
val GetTextFace : HDC -> string
val <a
name="GetTextMetrics">GetTextMetrics</a> : HDC -> TEXTMETRIC
val RemoveFontResource : string -> unit
val SetMapperFlags : HDC * bool -> bool
val SetTextAlign : HDC * TextAlign list -> TextAlign list
val SetTextCharacterExtra : HDC * int -> int
val <a
name="SetTextColor">SetTextColor</a> : HDC * COLORREF -> COLORREF
val SetTextJustification : HDC * int * int -> unit
val <a
name="TabbedTextOut">TabbedTextOut</a>: HDC * POINT * string * int list * int -> SIZE
val TextOut : HDC * POINT * String.string -> unit
end</pre>
</body>
</html>
|