Skip to content

Commit

Permalink
Noto Cursed
Browse files Browse the repository at this point in the history
  • Loading branch information
PoomSmart committed Feb 29, 2024
1 parent 9ba3eb9 commit 6262a9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions noto-emoji-cursed/noto-emoji-cursed.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
lig = Lig(f, bttf, bgsubttx)
lig.build()

def noto_name(name: str):
tokens = name.split('_')
n = []
for t in tokens:
if t[0] == 'u':
t = t[1:] # strip u prefix
n.append(t)
result = '_'.join(n)
return 'u' + result

prepare_strikes(f)
for ppem, strike in f['sbix'].strikes.items():
print(f'Reading strike of size {ppem}x{ppem}')
Expand All @@ -31,13 +41,15 @@
continue
name = base_norm_variants(name)
name = base_norm_special(name)
fallback_name = noto_name(name)
name = lig.norm_name(name)
name = lig.get_glyph_name(name)
path = f'images/{ppem}/{name}.png'
if not os.path.exists(path):
print(name)
name = native_norm_name(name)
path = f'../noto-emoji/extra/images/{ppem}/{name}.png'
path = f'../noto-emoji/images/{ppem}/emoji_{fallback_name}.png'
if not os.path.exists(path):
name = native_norm_name(name)
path = f'../noto-emoji/extra/images/{ppem}/{name}.png'
glyph.imageData = get_image_data(path)

if not os.path.exists('../.test'):
Expand Down
2 changes: 1 addition & 1 deletion noto-emoji-cursed/noto-emoji-cursed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

APPLE_FONT_NAME=AppleColorEmoji
NAME=noto-emoji-cursed
FONT_NAME=SamsungColorEmoji
FONT_NAME=NotoColorEmoji
FONT_PATH=$FONT_NAME.ttf

../image-sizes.sh false
Expand Down

0 comments on commit 6262a9b

Please sign in to comment.