Propert utf8 encoding

This commit is contained in:
jpirnay
2026-04-26 22:59:02 +02:00
parent 088710378b
commit 7bca342d0c
54 changed files with 100730 additions and 100538 deletions
+5 -2
View File
@@ -45,9 +45,12 @@ UI_FONT_STYLES=("Regular" "Bold")
for size in ${UI_FONT_SIZES[@]}; do
for style in ${UI_FONT_STYLES[@]}; do
font_name="ubuntu_${size}_$(echo $style | tr '[:upper:]' '[:lower:]')"
font_path="../builtinFonts/source/Ubuntu/Ubuntu-${style}.ttf"
ubuntu_path="../builtinFonts/source/Ubuntu/Ubuntu-${style}.ttf"
# NotoSans used as fallback to fill missing glyphs (e.g. Vietnamese U+1EA0-1EF9)
# that are absent from the Ubuntu TTF source.
noto_path="../builtinFonts/source/NotoSans/NotoSans-${style}.ttf"
output_path="../builtinFonts/${font_name}.h"
python fontconvert.py $font_name $size $font_path > $output_path
python fontconvert.py $font_name $size $ubuntu_path $noto_path > $output_path
echo "Generated $output_path"
done
done
+4
View File
@@ -8,6 +8,10 @@ import argparse
from collections import namedtuple
from fontTools.ttLib import TTFont
# Force UTF-8 stdout so that `> file.h` on Windows doesn't produce UTF-16 LE
if hasattr(sys.stdout, 'reconfigure'):
sys.stdout.reconfigure(encoding='utf-8')
# Originally from https://github.com/vroland/epdiy
parser = argparse.ArgumentParser(description="Generate a header file from a font to be used with epdiy.")