proc init(self: wFont; lf: var LOGFONT) {...}{.raises: [wFontError], tags: [RootEffect].}
-
Initializes a font from LOGFONT struct. Used internally.
proc Font(lf: var LOGFONT): wFont {...}{.inline, discardable, raises: [wFontError],
tags: [RootEffect].}
-
Constructor.
proc init(self: wFont; pointSize: float = NaN; family = wFontFamilyDefault;
weight = wFontWeightNormal; italic = false; underline = false;
strikeout = false; faceName = ""; encoding = wFontEncodingDefault) {...}{.
raises: [IndexDefect, wFontError], tags: [RootEffect].}
-
Initializes a font object with the specified attributes.
Parameters | Description |
pointSize | Size in points. |
family | The font family: a generic portable way of referring to fonts without specifying a facename. |
weight | Font weight, sometimes also referred to as font boldness. |
italic | The value can be true or false. |
underline | The value can be true or false. |
strikeout | The value can be true or false. |
faceName | An optional string specifying the face name to be used. |
encoding | The font encoding. |
proc Font(pointSize: float = NaN; family = wFontFamilyDefault;
weight = wFontWeightNormal; italic = false; underline = false;
strikeout = false; faceName = ""; encoding = wFontEncodingDefault): wFont {...}{.
inline, discardable, raises: [IndexDefect, wFontError], tags: [RootEffect].}
-
Constructor.
proc init(self: wFont; hFont: HANDLE; copy = true; shared = false) {...}{.
raises: [IndexDefect, wFontError], tags: [RootEffect].}
-
Initializes a font from system font handle. If copy is false, the function only wrap the handle to wFont object. If shared is false, the handle will be destroyed together with wFont object by the GC. Otherwise, the caller is responsible for destroying it. If hFont is not a system font handle, this function regard it a the point size in int type.
proc Font(hFont: HANDLE; copy = true; shared = false): wFont {...}{.inline, discardable,
raises: [IndexDefect, wFontError], tags: [RootEffect].}
-
Constructor.
proc init(self: wFont; font: wFont) {...}{.raises: [wNilAccess, IndexDefect, wFontError],
tags: [RootEffect].}
-
Initializes a font from wFont object, aka. copy.
proc Font(font: wFont): wFont {...}{.inline, discardable,
raises: [wNilAccess, IndexDefect, wFontError],
tags: [RootEffect].}
-
Constructor.
proc getPointSize(self: wFont): float {...}{.inline, raises: [], tags: [].}
-
Gets the point size.
proc getFamily(self: wFont): int {...}{.inline, raises: [], tags: [].}
-
Gets the font family if possible.
proc getWeight(self: wFont): int {...}{.inline, raises: [], tags: [].}
-
Gets the font weight.
proc getItalic(self: wFont): bool {...}{.inline, raises: [], tags: [].}
-
Gets true if font is italic.
proc getUnderlined(self: wFont): bool {...}{.inline, raises: [], tags: [].}
-
Gets true if the font is underlined.
proc getStrikeout(self: wFont): bool {...}{.inline, raises: [], tags: [].}
-
Gets true if the font is strikeout.
proc getFaceName(self: wFont): string {...}{.inline, raises: [], tags: [].}
-
Gets the font family if possible.
proc getEncoding(self: wFont): int {...}{.inline, raises: [], tags: [].}
-
Gets the encoding of this font.
proc setPointSize(self: wFont; pointSize: float) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the point size.
proc setFamily(self: wFont; family: int) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the font family.
proc setWeight(self: wFont; weight: int) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the font weight.
proc setItalic(self: wFont; italic: bool) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the font italic style.
proc setUnderlined(self: wFont; underline: bool) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets underlining.
proc setStrikeout(self: wFont; strikeout: bool) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets strikeout attribute of the font.
proc setFaceName(self: wFont; faceName: string) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the facename for the font.
proc setEncoding(self: wFont; encoding: int) {...}{.raises: [IndexDefect, wFontError],
tags: [RootEffect].}
-
Sets the encoding for this font.