mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
vendor
This commit is contained in:
parent
12163d1338
commit
550b1644cb
363 changed files with 84081 additions and 16 deletions
32
egui/crates/epaint/fonts/list_fonts.py
Normal file
32
egui/crates/epaint/fonts/list_fonts.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.unicode import Unicode
|
||||
from itertools import chain
|
||||
import sys
|
||||
|
||||
ttf = TTFont(sys.argv[1], 0, verbose=0, allowVID=0,
|
||||
ignoreDecompileErrors=True,
|
||||
fontNumber=-1)
|
||||
|
||||
chars = chain.from_iterable([y + (Unicode[y[0]],)
|
||||
for y in x.cmap.items()] for x in ttf["cmap"].tables)
|
||||
|
||||
|
||||
all_codepoints = {}
|
||||
|
||||
for entry in chars:
|
||||
codepoint = entry[0]
|
||||
short_name = entry[1]
|
||||
long_name = entry[2].lower()
|
||||
if False:
|
||||
print(f'(0x{codepoint:02X}, "{short_name}", "{long_name}"),')
|
||||
else:
|
||||
name = short_name if long_name == "????" else long_name
|
||||
# print(f'(0x{codepoint:02X}, "{name}"),')
|
||||
all_codepoints[codepoint] = name
|
||||
|
||||
for codepoint in sorted(all_codepoints.keys()):
|
||||
name = all_codepoints[codepoint]
|
||||
print(f'(0x{codepoint:02X}, \'{chr(codepoint)}\', "{name}"),')
|
||||
|
||||
ttf.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue