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.