From e2b597d09f856db6b4a7a7dd050106570770b02f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Tue, 11 Dec 2018 14:58:11 +0100 Subject: [PATCH] Update API documentation --- API.md | 14 +++++++++++--- 1 file 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 :