factor/core/io/styles.facts

106 lines
4.4 KiB
Plaintext

USING: help styles io ;
HELP: plain
{ $description "A value for the " { $link font-style } " character style denoting plain text." } ;
HELP: bold
{ $description "A value for the " { $link font-style } " character style denoting boldface text." } ;
HELP: italic
{ $description "A value for the " { $link font-style } " character style denoting italicized text." } ;
HELP: bold-italic
{ $description "A value for the " { $link font-style } " character style denoting boldface italicized text." } ;
HELP: foreground
{ $description "Character style. Text color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
{ $examples
{ $code
"\"Hello world\" 10 ["
" { 0.1 0.1 0.2 1 } n*v { 1 1 1 1 } vmin"
" foreground associate format terpri"
"] each-with"
}
} ;
HELP: background
{ $description "Character style. Background color, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
{ $examples
{ $code
"\"Hello world\" 10 ["
" { 0.1 0.4 0.1 } n*v { 1 1 1 } vmin { 1 } append"
" background associate format terpri"
"] each-with"
}
} ;
HELP: font
{ $description "Character style. Font family named by a string." }
{ $examples
"This example outputs some different font sizes:"
{ $code "{ \"monospace\" \"serif\" \"sans-serif\" }\n[ dup font associate format terpri ] each" }
} ;
HELP: font-size
{ $description "Character style. Font size, an integer." }
{ $examples
"This example outputs some different font sizes:"
{ $code "\"Bigger\" { 12 18 24 72 }\n[ font-size associate format terpri ] each-with" }
} ;
HELP: font-style
{ $description "Character style. Font style, one of " { $link plain } ", " { $link bold } ", " { $link italic } ", or " { $link bold-italic } "." }
{ $examples
"This example outputs text in all three styles:"
{ $code "{ plain bold italic bold-italic }\n[ [ word-name ] keep font-style associate format terpri ] each" }
} ;
HELP: presented
{ $description "Character and paragraph style. An object associated with the text. In the Factor UI, this is shown as a clickable presentation of the object; left-clicking invokes a default command, and right-clicking shows a menu of commands." }
{ $see-also write-object } ;
HELP: highlight
{ $description "Character style. Used to mark up text on streams that otherwise do not support different colors or font styles." }
{ $examples "Instances of " { $link plain-writer } " uppercases highlighted text." } ;
HELP: page-color
{ $description "Paragraph style. Background color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
{ $examples
{ $code "H{ { page-color { 1 0.8 0.5 1 } } }\n[ \"A background\" write ] with-nesting terpri" }
} ;
HELP: border-color
{ $description "Paragraph style. Border color of the paragraph block, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
{ $examples
{ $code "H{ { border-color { 1 0 0 1 } } }\n[ \"A border\" write ] with-nesting terpri" }
} ;
HELP: border-width
{ $description "Paragraph style. Pixels between edge of text and border color, an integer." }
{ $examples
{ $code "H{ { border-width 10 } }\n[ \"Some inset text\" write ] with-nesting terpri" }
} ;
HELP: wrap-margin
{ $description "Paragraph style. Pixels between left margin and right margin where text is wrapped, an integer." }
{ $see-also bl } ;
HELP: outline
{ $description "Paragraph style. In the Factor UI, a quotation executed to produce outliner content when the outliner widget next to the paragraph block is expanded." }
{ $see-also write-outliner } ;
HELP: table-gap
{ $description "Table style. Horizontal and vertical gap between table cells, denoted by a pair of integers." }
{ $see-also with-stream-table tabular-output } ;
HELP: table-border
{ $description "Table style. Color of the border drawn between cells, denoted by a sequence of four numbers between 0 and 1 (red, green, blue and alpha)." }
{ $see-also with-stream-table tabular-output } ;
HELP: input
{ $class-description "Class of input text presentations.A wrapper class. Instances can be used passed to " { $link write-object } " to output a clickable piece of input." }
{ $examples
"This presentation class is used for the code examples you see in the online help:"
{ $code "\"2 3 + .\" dup <input> write-object terpri" }
} ;