1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs colors.constants fonts fry io.styles kernel literals
4 math namespaces sequences ;
7 : wrap-margin-full ( -- n )
8 42 default-font-size * ;
10 : wrap-margin-table-content ( -- n )
11 29 default-font-size * ;
13 : font-size-subsection ( -- n )
14 7/6 default-font-size * >integer ;
16 : font-size-title ( -- n )
17 5/3 default-font-size * >integer ;
19 : font-size-heading ( -- n )
20 4/3 default-font-size * >integer ;
22 : font-size-span ( -- n )
23 13/12 default-font-size * >integer ;
25 SYMBOL: default-span-style
27 { font-name $ default-sans-serif-font-name }
28 { font-size $ font-size-span }
30 } default-span-style set-global
32 SYMBOL: default-block-style
34 { wrap-margin $ wrap-margin-full }
35 } default-block-style set-global
39 { foreground COLOR: DodgerBlue4 }
41 } link-style set-global
43 SYMBOL: emphasis-style
44 H{ { font-style italic } } emphasis-style set-global
47 H{ { font-style bold } } strong-style set-global
51 { font-name $ default-sans-serif-font-name }
52 { font-size $ font-size-title }
54 { wrap-margin $ wrap-margin-full }
55 { foreground COLOR: gray20 }
56 { page-color COLOR: FactorLightTan }
58 } title-style set-global
60 SYMBOL: help-path-style
62 { font-size $ default-font-size }
64 { table-border COLOR: FactorLightTan }
65 } help-path-style set-global
69 { font-name $ default-sans-serif-font-name }
70 { font-size $ font-size-heading }
72 { foreground COLOR: FactorDarkSlateBlue }
73 } heading-style set-global
75 SYMBOL: subsection-style
77 { font-name $ default-sans-serif-font-name }
78 { font-size $ font-size-subsection }
80 } subsection-style set-global
84 { font-name $ default-monospace-font-name }
85 { font-size $ default-font-size }
86 { foreground COLOR: DarkOrange4 }
87 } snippet-style set-global
89 SYMBOL: code-char-style
91 { font-name $ default-monospace-font-name }
92 { font-size $ default-font-size }
93 } code-char-style set-global
97 { page-color COLOR: FactorLightTan }
100 } code-style set-global
105 { foreground COLOR: DarkOrange4 }
106 } output-style set-global
110 { font-name $ default-monospace-font-name }
111 { foreground COLOR: DodgerBlue4 }
112 } url-style set-global
114 SYMBOL: warning-style
116 { page-color COLOR: gray90 }
117 { border-color COLOR: red }
119 { wrap-margin $ wrap-margin-full }
120 } warning-style set-global
122 SYMBOL: deprecated-style
124 { page-color COLOR: gray90 }
125 { border-color COLOR: red }
127 { wrap-margin $ wrap-margin-full }
128 } deprecated-style set-global
130 SYMBOL: table-content-style
132 { wrap-margin $ wrap-margin-table-content }
133 } table-content-style set-global
137 { table-gap { 5 5 } }
138 { table-border COLOR: FactorTan }
139 } table-style set-global
142 H{ { table-gap { 10 2 } } } list-style set-global
145 "• " bullet set-global
147 : adjust-help-font-size ( delta -- )
151 default-span-style title-style
152 help-path-style heading-style
153 subsection-style snippet-style
156 ] dip '[ get-global [ _ + ] change-at ] with each ;