2 USING: help.markup help.syntax kernel ui.text.private strings math fonts ;
5 { $values { "font" font } { "string" string } { "w" "a positive integer" } }
6 { $contract "Outputs the width of a string." }
7 { $notes "This is a low-level word; use " { $link text-width } " instead." } ;
10 { $values { "font" font } { "text" "a string or sequence of strings" } { "w" "a positive integer" } }
11 { $description "Outputs the width of a piece of text." } ;
14 { $values { "font" font } { "string" string } { "h" "a positive integer" } }
15 { $contract "Outputs the height of a string." }
16 { $notes "This is a low-level word; use " { $link text-height } " instead." } ;
19 { $values { "font" font } { "text" "a string or sequence of strings" } { "h" "a positive integer" } }
20 { $description "Outputs the height of a piece of text." } ;
23 { $values { "font" font } { "string" string } { "dim" "a pair of integers" } }
24 { $contract "Outputs the dimensions of a string." }
25 { $notes "This is a low-level word; use " { $link text-dim } " instead." } ;
28 { $values { "font" font } { "text" "a string or sequence of strings" } { "dim" "a pair of integers" } }
29 { $description "Outputs the dimensions of a piece of text, which is either a single-line string or an array of lines." } ;
32 { $values { "font" font } { "string" string } }
33 { $contract "Draws a line of text." } ;
36 { $values { "font" font } { "text" "a string or an array of strings" } }
37 { $description "Draws a piece of text." } ;
40 { $values { "x" real } { "font" font } { "string" string } { "n" integer } }
41 { $contract "Outputs the string index closest to the given x co-ordinate." } ;
44 { $values { "n" integer } { "font" font } { "string" string } { "x" real } }
45 { $contract "Outputs the x co-ordinate of the character at the given index." } ;
48 { $values { "font" font } { "string" string } { "metrics" line-metrics } }
49 { $contract "Outputs a " { $link metrics } " object with text measurements." } ;
51 ARTICLE: "text-rendering" "Rendering text"
52 "The " { $vocab-link "ui.text" } " vocabulary provides a cross-platform interface to the operating system's native font rendering engine. Currently, it uses Core Text on Mac OS X and FreeType on Windows and X11."
53 { $subsections "fonts" }
61 "Converting screen locations to string offsets, and vice versa:"
67 { $subsections draw-text }
68 "Low-level text protocol for UI backends:"
76 ABOUT: "text-rendering"