diff --git a/README.md b/README.md index fea2803..92f4094 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ npx lv_font_conv -h npx github:lvgl/lv_font_conv -h ``` -Note, runing via `npx` may take some time until modules installed, be patient. +Note, running via `npx` may take some time until modules installed, be patient. ## CLI params @@ -49,7 +49,7 @@ Common: - `--format` - output format. - `--format dump` - dump glyph images and font info, useful for debug. - `--format bin` - dump font in binary form (as described in [spec](https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md)). - - `--format lvgl` - dump font in [LittlevGL](https://github.com/lvgl/lvgl) format. + - `--format lvgl` - dump font in [LVGL](https://github.com/lvgl/lvgl) format. - `--force-fast-kern-format` - always use more fast kering storage format, at cost of some size. If size difference appears, it will be displayed. - `--lcd` - generate bitmaps with 3x horizontal resolution, for subpixel @@ -111,7 +111,7 @@ adds compression support. ### Supported output formats 1. **bin** - universal binary format, as described in https://github.com/lvgl/lv_font_conv/tree/master/doc. -2. **lvgl** - format for LittlevGL, C file. Has minor limitations and a bit +2. **lvgl** - format for LVGL, C file. Has minor limitations and a bit bigger size, because C does not allow to effectively define relative offsets in data blocks. 3. **dump** - create folder with each glyph in separate image, and other font diff --git a/doc/font_spec.md b/doc/font_spec.md index a8357b9..91a7863 100644 --- a/doc/font_spec.md +++ b/doc/font_spec.md @@ -302,7 +302,7 @@ spec. Glyph data uses modified RLE compression - [I3BN](https://thesai.org/Downloads/Volume7No7/Paper_34-New_modified_RLE_algorithms.pdf), with prefilter and tuned options. Everything works with "pixels" (groups of 2, 3, 4 or 8 bits). That will not work -for bitonal fonts, but those are small enougth. +for bitonal fonts, but those are small enough. Notable compression gain starts with ~30px sizes. That's explained by 2 moments: @@ -326,7 +326,7 @@ enough and more effective than diff: That helps to pass anti-aliasing pixels without size increase. 2. First 10 repeats are replaced with `1` bit (`0` - end). 3. Next (11-th) is followed by 6-bit counter. If counter overflows, max possible - value used, and process starts from begining (1). + value used, and process starts from beginning (1). See [I3BN](https://thesai.org/Downloads/Volume7No7/Paper_34-New_modified_RLE_algorithms.pdf) for initial idea and images. diff --git a/lib/font/compress.js b/lib/font/compress.js index aa30a3a..2bf2bd8 100644 --- a/lib/font/compress.js +++ b/lib/font/compress.js @@ -15,7 +15,7 @@ function count_same(arr, offset) { } // -// Compress pixels with RLE-like algorythm (modified I3BN) +// Compress pixels with RLE-like algorithm (modified I3BN) // // 1. Require minimal repeat count (1) to enter I3BN mode // 2. Increased 1-bit-replaced repeat limit (2 => 10) @@ -35,7 +35,7 @@ module.exports = function compress(bitStream, pixels, options) { const RLE_COUNTER_BITS = 6; // (2^bits - 1) - max value const RLE_COUNTER_MAX = (1 << RLE_COUNTER_BITS) - 1; - // Force flush if counter dencity exceeded. + // Force flush if counter density exceeded. const RLE_MAX_REPEATS = RLE_COUNTER_MAX + RLE_BIT_COLLAPSED_COUNT + 1; //let bits_start_offset = bitStream.index; diff --git a/lib/writers/lvgl/lv_font.js b/lib/writers/lvgl/lv_font.js index cf9f776..ca387bd 100644 --- a/lib/writers/lvgl/lv_font.js +++ b/lib/writers/lvgl/lv_font.js @@ -30,7 +30,7 @@ class LvFont extends Font { } if (options.bpp === 3 & options.no_compress) { - throw new AppError('LittlevGL supports "--bpp 3" with compression only'); + throw new AppError('LVGL supports "--bpp 3" with compression only'); } } diff --git a/web/content.html b/web/content.html index 66e76f1..d6754ed 100644 --- a/web/content.html +++ b/web/content.html @@ -1,6 +1,6 @@
With this free online font converter tool you can create C array from any TTF or WOFF font. You can select ranges of Unicode characters and speficy the bpp (bit-per-pixel).
+With this free online font converter tool you can create C array from any TTF or WOFF font. You can select ranges of Unicode characters and specify the bpp (bit-per-pixel).
The font converter is designed to be compatible with LVGL but with minor modification you can make it compatible with other graphics libraries.
@@ -13,14 +13,14 @@extern lv_font_t my_font_name;
+ extern const lv_font_t my_font_name;
or simply LV_FONT_DECLARE(my_font_name);
style.text.font = &my_font_name;