From ee9dbb2a1b778100ac36ecdc7496b2af9d44c0a1 Mon Sep 17 00:00:00 2001 From: Jacques Supcik Date: Thu, 26 Oct 2023 12:47:27 +0200 Subject: [PATCH] add info to create charset file --- FONT_TO_PY.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FONT_TO_PY.md b/FONT_TO_PY.md index a419a49..c6740e1 100644 --- a/FONT_TO_PY.md +++ b/FONT_TO_PY.md @@ -109,6 +109,13 @@ $ font_to_py.py -k extended FreeSans.ttf 23 my_extended_font.py original ASCII set of printable characters. At risk of stating the obvious this will only produce useful results if the source font file includes all specified glyphs. + + A charset file can easilly be created by a one-line Python + script. For example, the `latin15` character set file is created by: + + ``` + python3 -c 'print(bytearray([*range(0x20, 0x7F), *range(0xA0, 0xFF)]).decode("iso-8859-15"))' > latin15 + ``` The -c option may be used to reduce the size of the font file by limiting the character set. If the font file is frozen as bytecode this will not reduce RAM