Commit 0664de5d authored by twanvl's avatar twanvl

documentation of symbol font changes

parent c209c534
...@@ -48,16 +48,7 @@ Such a package contains a [[file:format|data file]] called <tt>symbol-font</tt> ...@@ -48,16 +48,7 @@ Such a package contains a [[file:format|data file]] called <tt>symbol-font</tt>
| @horizontal space@ [[type:double]] @0@ Horizontal spacing between symbols, in pixels. | @horizontal space@ [[type:double]] @0@ Horizontal spacing between symbols, in pixels.
| @vertical space@ [[type:double]] @0@ Vertical spacing between symbols, in pixels. | @vertical space@ [[type:double]] @0@ Vertical spacing between symbols, in pixels.
| @symbols@ [[type:list]] of [[type:symbol font symbol]]s Symbols that make up this font. | @symbols@ [[type:list]] of [[type:symbol font symbol]]s Symbols that make up this font.
| @text font@ [[type:font]] Font to use for drawing text on symbols, only used if there is a default symbol. The font size is in points per point.
| @scale text@ [[type:boolean]] @false@ Should text be scaled down to fit in a symbol? | @scale text@ [[type:boolean]] @false@ Should text be scaled down to fit in a symbol?
| @merge numbers@ [[type:boolean]] @false@ Should a numeric value of multiple digits be rendered as a single symbol?<br/>
Note: @merge numbers@ is deprecated, use @as text: [0-9]+@ instead.
| @as text@ [[type:regex]] @"."@ What should be rendered as a single piece of text?
| @text margin left@ [[type:double]] @0@ Margin on the left of the text in pixels per point.
| @text margin right@ [[type:double]] @0@ Margin on the right of the text in pixels per point.
| @text margin top@ [[type:double]] @0@ Margin on the top of the text in pixels per point.
| @text margin bottom@ [[type:double]] @0@ Margin on the bottom of the text in pixels per point.
| @text alignment@ [[type:alignment]] @"middle center"@ How should text be aligned on symbols?
| @insert symbol menu@ [[type:insert symbol menu|"insert symbol" menu]] ''none'' A description of the menu to insert a symbol into the text. | @insert symbol menu@ [[type:insert symbol menu|"insert symbol" menu]] ''none'' A description of the menu to insert a symbol into the text.
--Examples-- --Examples--
......
...@@ -7,17 +7,28 @@ A single symbol in a [[type:symbol font]]. ...@@ -7,17 +7,28 @@ A single symbol in a [[type:symbol font]].
--Properties-- --Properties--
! Property Type Default Description ! Property Type Default Description
| @image font size@ [[type:double]] value from symbol font To what point size does the images correspond? | @image font size@ [[type:double]] value from symbol font To what point size does the images correspond?
| @code@ [[type:string]] ''required'' Text this symbol matches.<br/> | @code@ [[type:string]] or [[type:regex]] ''required'' Text this symbol matches.
A single symbol can omit the code, this then becomes the ''default symbol'', on which text is drawn. | @regex@ [[type:boolean]] @false@ Is the code a regular expression (as opposed to a string)?
| @image@ [[type:scriptable]] [[type:image]] ''required'' Image of this symbol. | @image@ [[type:scriptable]] [[type:image]] ''required'' Image of this symbol.
| @enabled@ [[type:scriptable]] [[type:boolean]] @true@ Is this symbol actually used?<br/> | @enabled@ [[type:scriptable]] [[type:boolean]] @true@ Is this symbol actually used?<br/>
This can be scripted to optionally disable certain symbols.<br/> This can be scripted to optionally disable certain symbols.<br/>
If multiple symbols with the same code are given disabling the first switches to the second one. If multiple symbols with the same code are given disabling the first switches to the second one.
| @draw text@ [[type:int]] @-1@ The index of the captured regex expression to draw as text, or -1 to not draw text.<br/> For example with the code @"x([a-z])"@ and @draw text: 1@ the text of the symbol @"xb"@ will be @"b"@.
| @text font@ [[type:font]] Font to use for drawing text on symbols. The font size is in font points per text box font point.
| @text alignment@ [[type:alignment]] @"middle center"@ How should text be aligned on the symbol?
| @text margin left@ [[type:double]] @0@ Margin on the left of the text in pixels per point.
| @text margin right@ [[type:double]] @0@ Margin on the right of the text in pixels per point.
| @text margin top@ [[type:double]] @0@ Margin on the top of the text in pixels per point.
| @text margin bottom@ [[type:double]] @0@ Margin on the bottom of the text in pixels per point.
--Examples-- --Examples--
A default symbol: A symbol with text:
>symbol: >symbol:
> image: blank.png > image: blank.png
> code: .
> regex: true
> text font: Arial
Two symbols for the same code, which one is used depends on a function from the [[type:stylesheet]]. Two symbols for the same code, which one is used depends on a function from the [[type:stylesheet]].
It is recommended to only use functions in @enabled@, so each stylesheet can determine how the font should be used. It is recommended to only use functions in @enabled@, so each stylesheet can determine how the font should be used.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment