Skip to content

Commit

Permalink
Update fonts.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Aug 13, 2024
1 parent 0921b7f commit 0006461
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions 9.0/fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,56 @@ Scales every glyph in a font (including the space character) by the given factor

 

## `scribble_font_set_halign_offset(fontName, hAlign, offset)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------|--------|-----------------------------------------|
|`fontName`|string |Name of the font to modify, as a string |
|`hAlign` |constant|Horizontal alignment to target, see below|
|`offset` |number |x-axis offset to apply |

This function sets up a fixed offset for a font when used with a particular alignment. Valid constants for the `hAlign` argument are:

- `fa_left`
- `fa_center`
- `fa_right`
- `fa_justify`
- `"pin_left"`
- `"pin_centre"`
- `"pin_center"`
- `"pin_right"`
- `"fa_justify"`

?> The macro `SCRIBBLE_USE_FONT_ALIGNMENT_OFFSETS` must be set to `true` to use this function. This will incur a slight performance penalty when building text elements.

?> Existing text elements that use the targetted font will not be immediately updated - you will need to refresh those text elements.

 

## `scribble_font_set_valign_offset(fontName, vAlign, offset)`

**Returns:** N/A (`undefined`)

|Name |Datatype|Purpose |
|----------|--------|---------------------------------------|
|`fontName`|string |Name of the font to modify, as a string|
|`vAlign` |constant|Vertical alignment to target, see below|
|`offset` |number |x-axis offset to apply |

This function sets up a fixed offset for a font when used with a particular alignment. Valid constants for the `vAlign` argument are:

- `fa_top`
- `fa_middle`
- `fa_bottom`

?> The macro `SCRIBBLE_USE_FONT_ALIGNMENT_OFFSETS` must be set to `true` to use this function. This will incur a slight performance penalty when building text elements.

?> Existing text elements that use the targetted font will not be immediately updated - you will need to refresh those text elements.

 

## `scribble_glyph_set(fontName, character, property, value, [relative])`

**Returns:** N/A (`undefined`)
Expand Down

0 comments on commit 0006461

Please sign in to comment.