aboutsummaryrefslogtreecommitdiff
path: root/font_api
diff options
context:
space:
mode:
authorPierre-Yves Rollo <dev@pyrollo.com>2018-12-11 14:58:11 +0100
committerPierre-Yves Rollo <dev@pyrollo.com>2018-12-11 14:58:11 +0100
commitfc40e54ed2227f29b4b4ddd4b42aafea2e47a791 (patch)
tree9034193f00e9d6b3c5c724126935d16741503512 /font_api
parentc9329d378976ee0fea0bd3486befcd3a1af551c1 (diff)
downloaddisplay_modpack_no_craft-fc40e54ed2227f29b4b4ddd4b42aafea2e47a791.tar.gz
display_modpack_no_craft-fc40e54ed2227f29b4b4ddd4b42aafea2e47a791.zip
Update API documentation
Diffstat (limited to 'font_api')
-rw-r--r--font_api/API.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/font_api/API.md b/font_api/API.md
index f3f4437..80b1121 100644
--- a/font_api/API.md
+++ b/font_api/API.md
@@ -1,5 +1,5 @@
-# Font Lib API
-This document describes Font Lib API. Font Lib creates textures for font display on entities.
+# Font API
+This document describes Font API. Font API creates textures for font display on entities.
## Settings
### default_font
@@ -97,7 +97,7 @@ Standard on_display_update entity callback.
Node should have a corresponding display_entity with size, resolution and maxlines fields and optionally halign, valign and color fields.
-### Font definition table
+## Font definition table
Font definition table used by **font_api.register_font** and **font\_api.Font:new** may/can contain following elements:
* `height` (required): Font height in pixels (all font textures should have the same height) .
@@ -108,6 +108,14 @@ Font definition table used by **font_api.register_font** and **font\_api.Font:ne
`margintop`, `marginbottom` and `linespacing` can be negative numbers (default 0) and are to be used to adjust various font styles to each other.
+Font attributes around a single char:\
+![Font attributes on a char](doc/font.svg)
+
+Font attributes effects on several lines:\
+![Font attributes on lines](doc/lines.svg)
+
+#### Additional requirements
+
Font must have a char 0 which will be used to display any unknown char.
All textures corresponding to the indexes in widths array should be present in textures directory with a name matching the pattern :