font
Factor handbook » UI framework » Implementing new gadgets » Customizing gadget appearance » Implementing custom drawing logic » Rendering text » Fonts

Next:<font> ( name -- font )


Vocabulary
fonts

Class description
The class of fonts.

Definition

TUPLE: font name size bold? italic? foreground background ;


Methods

M: font pdf-value
[
"<<" , "/Type /Font" , "/Subtype /Type1" , {
[
name>> {
{ "sans-serif" ~quotation~ }
{ "serif" ~quotation~ }
{ "monospace" ~quotation~ }
[ " is unsupported" append throw ]
} case
]
[
[ bold?>> ] [ italic?>> ] bi or
[ "-" append ] when
]
[ bold?>> [ "Bold" append ] when ]
[ italic?>> [ "Italic" append ] when ]
[
name>> { "sans-serif" "monospace" } member?
[ "Italic" "Oblique" replace ] when
]
} cleave "/BaseFont " prepend , ">>" ,
] { } make join-lines ;