1 USING: help.syntax help.markup strings kernel alien opengl
2 quotations ui.render io.styles freetype ;
6 { $values { "alien" alien } }
7 { $description "Outputs a native handle used by the FreeType library, initializing FreeType first if necessary." } ;
10 { $var-description "Global variable. Hashtable mapping font descriptors to " { $link font } " instances." } ;
12 { font open-fonts open-font char-width string-width text-dim draw-string draw-text } related-words
15 { $description "Initializes the FreeType library." }
16 { $notes "Do not call this word if you are using the UI." } ;
22 "A font which has been loaded by FreeType. Font instances have the following slots:"
27 { $snippet "ascent" } ", "
28 { $snippet "descent" } ", "
29 { $snippet "height" } " - metrics."
34 " - alien pointer to an "
35 { $snippet "FT_Face" } "."
40 " - sequence of character widths. Use "
44 " to compute string widths instead of reading this sequence directly."
51 { $description "Closes the FreeType library." }
52 { $notes "Do not call this word if you are using the UI." } ;
55 { $values { "font" string } { "style" "one of " { $link plain } ", " { $link bold } ", " { $link italic } " or " { $link bold-italic } } { "face" "alien pointer to an " { $snippet "FT_Face" } } }
56 { $description "Loads a TrueType font with the requested logical font name and style." }
57 { $notes "This is a low-level word. Call " { $link open-font } " instead." } ;
60 { $values { "font" font } { "char" "a non-negative integer" } { "bitmap" alien } }
61 { $description "Renders a character and outputs a pointer to the bitmap." } ;
64 { $values { "open-font" font } { "char" "a non-negative integer" } { "sprite" sprite } }
65 { $description "Renders a character to an OpenGL texture and records a display list which draws a quad with this texture. This word allocates native resources which must be freed by " { $link free-sprites } "." } ;
68 { $values { "open-font" font } { "sprites" "a vector of " { $link sprite } " instances" } { "string" string } { "loc" "a pair of integers" } }
69 { $description "Draws a line of text." }
70 { $notes "This is a low-level word, UI code should use " { $link draw-string } " or " { $link draw-text } " instead." }
71 { $side-effects "sprites" } ;
74 { $values { "open-font" font } { "string" string } { "widths" "a sequence of integers" } }
75 { $description "Outputs a sequence of x co-ordinates of the midpoint of each character in the string." }
76 { $notes "This word is used to convert x offsets to document locations, for example when the user moves the caret by clicking the mouse." } ;