From 0006461adf1f29c9c9b62e955ac929c6c2c3541e Mon Sep 17 00:00:00 2001 From: Juju Adams Date: Tue, 13 Aug 2024 11:54:05 +0100 Subject: [PATCH] Update fonts.md --- 9.0/fonts.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/9.0/fonts.md b/9.0/fonts.md index 20d8014e..df7fbdd0 100644 --- a/9.0/fonts.md +++ b/9.0/fonts.md @@ -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`)