Followed instructions here,
initializing ko-KR.json
with translations via google-translate.
I doubt that existing fonts will cover any of these; but let's see.
import os
import json
l10nfile = './i18n/translations/ko-KR.json'
l10ndict = json.loads(open(l10nfile).read())
chars = []
for translation in l10ndict.values():
for char in [x for x in translation if x >= ' ']:
if char not in chars:
chars.append(char)
chars.sort()
print('\nTranslation file %s has %d unique symbols in its translations' % (l10nfile, len(chars)))
print('lowest unicode point: %s (or %d), highest unicode point: %s (or %d)' % (
hex(ord(min(chars))), ord(min(chars)),
hex(ord(max(chars))), ord(max(chars))
))
fontdir = './firmware/font'
for basename in [x for x in os.listdir(fontdir) if x.endswith('.bdf')]:
bdf = '/'.join([fontdir, basename])
print('\nChecking font file %s for existing/missing glyphs...' % bdf)
bdf_contents = open(bdf, 'r').read()
existing, missing = [], []
for char in chars:
if '\nENCODING %d\n' % ord(char) in bdf_contents:
existing.append(char)
else:
missing.append(char)
print(' existing: %s\n missing: %s' % (''.join(existing), ''.join(missing)))
if len(missing):
print(' missing %d unicode points between: %s (or %d) and %s (or %d)' % (
len(missing),
hex(ord(min(missing))), ord(min(missing)),
hex(ord(max(missing))), ord(max(missing))
))
Translation file ./i18n/translations/ko-KR.json has 327 unique symbols in its translations
lowest unicode point: 0x20 (or 32), highest unicode point: 0xd734 (or 55092)
Checking font file ./firmware/font/ter-u16n.bdf for existing/missing glyphs...
existing: !%(),-./012345689:?ABCDEFHIKMNOPQRSTUX[]abcdefghiklmnopqrstuvwx~
missing: 가각간감갑값개거검게겠격경계고공과관구국규그글금급기길깊까께꾸나난내너년누는니닉다단당대더데도독동되된될됩뒤드들듭디딩때또라락래렇레려력렬로롤료루류르를름릅리린립마만망멀메면명모못무문미바반받방배백버번벌범법벗벨벳변보부분비쁜사삭새색생서선설성소속송쇄쇠수숫스습시신실십씨아않알암앗았애어언업없었에엔여역연열예오올와완요용우운월웨위유으은을음의이인일임입있자작잘장재저적전점정제존종주즈지직진짐집징째쪽찾채처첫체초최추출충치카캔캡컷코크키탐택터테텍토통트티팅파패펀펌페편표품프플피핀필하한할함합항해했행현형호화확환활회효후휴
missing 262 unicode points between: 0xac00 (or 44032) and 0xd734 (or 55092)
...
Found NeoDungGeunMo neodgm as a ttf. Using otf2bdf
to convert:
otf2bdf -p 14 -r 72 neodgm.ttf >neodgm-u14n.bdf
otf2bdf -p 16 -r 72 neodgm.ttf >neodgm-u16n.bdf
otf2bdf -p 24 -r 72 neodgm.ttf >neodgm-u24n.bdf
...looks like:
STARTFONT 2.1
COMMENT
COMMENT Converted from OpenType font "neodgm.ttf" by "otf2bdf 3.0".
COMMENT
FONT -FreeType-NeoDunggeunmo-Medium-R-Normal--24-240-72-72-P-209-ISO10646-1
SIZE 24 72 72
FONTBOUNDINGBOX 26 26 -1 -7
STARTPROPERTIES 19
FOUNDRY "FreeType"
FAMILY_NAME "NeoDunggeunmo"
WEIGHT_NAME "Medium"
SLANT "R"
SETWIDTH_NAME "Normal"
ADD_STYLE_NAME ""
PIXEL_SIZE 24
POINT_SIZE 240
RESOLUTION_X 72
RESOLUTION_Y 72
SPACING "P"
AVERAGE_WIDTH 209
CHARSET_REGISTRY "ISO10646"
CHARSET_ENCODING "1"
FONT_ASCENT 18
FONT_DESCENT 6
COPYRIGHT "Original font was released under the public domain by Jungtae Kim in 1990s. Conversion and additional character design by Dalgona. <me@dalgona.dev>"
_OTF_FONTFILE "neodgm.ttf"
_OTF_PSNAME "NeoDunggeunmo-Regular"
ENDPROPERTIES
CHARS 12506
...
Also found it's original DungGeunMo-Regular dgm and converted it.
otf2bdf -p 14 -r 72 DungGeunMo-Regular.woff.ttf >dgm-u14n.bdf
otf2bdf -p 16 -r 72 DungGeunMo-Regular.woff.ttf >dgm-u16n.bdf
otf2bdf -p 24 -r 72 DungGeunMo-Regular.woff.ttf >dgm-u24n.bdf
...which looks like:
STARTFONT 2.1
COMMENT
COMMENT Converted from OpenType font "DungGeunMo-Regular.woff.ttf" by "otf2bdf 3.0".
COMMENT
FONT -FreeType-DungGeunMo-Medium-R-Normal--24-240-72-72-P-184-ISO10646-1
SIZE 24 72 72
FONTBOUNDINGBOX 111 28 -21 -7
STARTPROPERTIES 19
FOUNDRY "FreeType"
FAMILY_NAME "DungGeunMo"
WEIGHT_NAME "Medium"
SLANT "R"
SETWIDTH_NAME "Normal"
ADD_STYLE_NAME ""
PIXEL_SIZE 24
POINT_SIZE 240
RESOLUTION_X 72
RESOLUTION_Y 72
SPACING "P"
AVERAGE_WIDTH 184
CHARSET_REGISTRY "ISO10646"
CHARSET_ENCODING "1"
FONT_ASCENT 24
FONT_DESCENT 4
COPYRIGHT "Public Domain"
_OTF_FONTFILE "DungGeunMo-Regular.woff.ttf"
_OTF_PSNAME "DungGeunMo-Regular"
ENDPROPERTIES
CHARS 17432
...
Both of these font sets fully satisfy the script up top for ko-Kr.json's translations.
They both also satisfy other existing translations for: de-DE, en-US, es-MX, fr-FR, nl-NL, pt-BR, but they don't both work for vi-VN.
Only the original DungGeunMo-Regular font (dgm) fully satisfies vietnamese and all others including korean.
Followed instructions here
./bdftokff.sh dgm-u14n 8 14 > dgm-m5stickv.kff
./bdftokff.sh dgm-u16n 8 16 > dgm-bit_dock.kff
./bdftokff.sh dgm-u24n 12 24 > dgm-amigo.kff
For an indication of how much bigger these are with Korean added, a du -b ./firmware/font/*.kff
:
110824 dgm-amigo.kff
40306 dgm-bit_dock.kff
35926 dgm-m5stickv.kff
44538 ter-amigo.kff
16202 ter-bit_dock.kff
14442 ter-m5stickv.kff
As of Sep 9th 2023... This didn't work last month, and my last steps of editing the font.c file are not documented above. After building krux and switching to Korean, I saw no symbols. Used 3rd menu in login to get to settings and 3rd menu in settings to get to language.