From 1368f2c2f53c3070c1caebb625abdbf46037c59a Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 19 Dec 2016 11:13:05 -0200 Subject: [PATCH] Updated Font (markdown) --- Font.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Font.md b/Font.md index 912eb48..eef3061 100644 --- a/Font.md +++ b/Font.md @@ -2,7 +2,29 @@ The Font property holds then handle of the loaded font associated with a control Control(ControlID).Font = SetFont(FontName$, FontSize%, Attributes$) -## Controls that use the Font property: +* FontName$ must reference a font file. Only TTF fonts are accepted. + * If you don't specify a path, the current path is used. + * In Windows, if a path isn't specified the default font location **C:\Windows\Font** is searched. +* FontSize% is in pixels, not points. +* Attributes$ follow QB64's _LOADFONT parameters, but notice that BOLD and ITALIC parameters mostly have no effect, as there is usually a separate font file rendered with such attributes for different fonts. + * MONOSPACE will work to load a font with all characters having the same _FONTWIDTH. + +You can also use QB64's builtin fonts (_FONT 16 or _FONT 8). To do so, specify only the FontSize% parameter: + + Control(ControlID).Font = SetFont("", 8, "") + Control(ControlID).Font = SetFont("", 16, "") + +To specify a font at design time, use the following syntax in the editor: + + fontfile*attributes*size + +The default font for controls is: + + segoeui.ttf**12 + +If you don't set a control's font property, it will inherit its container's font (either the main form or a frame, if any). + +## Controls that can use the Font property: * [[Button]] * [[Label]] * [[Textbox]]