aboutsummaryrefslogtreecommitdiff
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
commite2b597d09f856db6b4a7a7dd050106570770b02f (patch)
tree92eccf39f646f8be11d4e1d20a5578a4746f9fe8
parent8b896ab23f30b30df014727073304e4219260238 (diff)
downloaddisplay_modpack_no_craft-e2b597d09f856db6b4a7a7dd050106570770b02f.tar.gz
display_modpack_no_craft-e2b597d09f856db6b4a7a7dd050106570770b02f.zip
Update API documentation
-rw-r--r--API.md14
1 files changed, 11 insertions, 3 deletions
diff --git a/API.md b/API.md
index f3f4437..80b1121 100644
--- a/API.md
+++ b/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 :