-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
APPLE_FONT_NAME=AppleColorEmoji@2x | ||
NAME=facebook | ||
FONT_NAME=NotoColorEmoji | ||
ASSETS=../../facebook-emojis/images/96 | ||
|
||
../image-sizes.sh false | ||
|
||
cp -r $ASSETS/ images/96 | ||
|
||
echo "Extracting font..." | ||
ttx -q -f -z extfile $FONT_NAME.ttf | ||
ttx -q -f -s -t GSUB $FONT_NAME.ttf | ||
|
||
echo "Resizing and optimizing PNGs..." | ||
mogrify -resize 96x96 -path images/96 bitmaps/strike0/*.png | ||
../resize.sh false false false | ||
rm -rf bitmaps | ||
|
||
mkdir -p extra/images/96 | ||
cp extra/original/*.png extra/images/96 | ||
../get-assets.sh facebook | ||
|
||
python3 $NAME.py ../apple/${APPLE_FONT_NAME}_00.ttf $FONT_NAME.ttf $FONT_NAME.G_S_U_B_.ttx | ||
python3 $NAME.py ../apple/${APPLE_FONT_NAME}_01.ttf $FONT_NAME.ttf $FONT_NAME.G_S_U_B_.ttx | ||
|
||
otf2otc ${APPLE_FONT_NAME}_00.ttf ${APPLE_FONT_NAME}_01.ttf -o $NAME.ttc | ||
rm -f *_00.ttf *_01.ttf | ||
|
||
echo "Output file at $NAME/$NAME.ttc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.append('..') | ||
from shared import * | ||
from shared_lig import * | ||
|
||
# input: apple font ttf, noto-emoji-cursed font ttf, noto-emoji-cursed GSUB ttx | ||
|
||
ttf = sys.argv[1] | ||
bttf = sys.argv[2] | ||
bgsubttx = sys.argv[3] | ||
|
||
f = ttLib.TTFont(ttf) | ||
|
||
lig = Lig(f, bttf, bgsubttx) | ||
lig.build() | ||
|
||
prepare_strikes(f) | ||
for ppem, strike in f['sbix'].strikes.items(): | ||
print(f'Reading strike of size {ppem}x{ppem}') | ||
for name, glyph in strike.glyphs.items(): | ||
if glyph.graphicType != 'png ': | ||
continue | ||
name = base_norm_name(name) | ||
if base_is_whitelist(name): | ||
continue | ||
name = norm_fam(name) | ||
name = norm_dual(name) | ||
if name is None: | ||
continue | ||
name = base_norm_variants(name) | ||
name = base_norm_special(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' | ||
glyph.imageData = get_image_data(path) | ||
|
||
if not os.path.exists('../.test'): | ||
print('Saving changes...') | ||
ttf = ttf.replace('../apple/', '') | ||
f.save(ttf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
APPLE_FONT_NAME=AppleColorEmoji@2x | ||
NAME=noto-emoji-cursed | ||
FONT_NAME=SamsungColorEmoji | ||
FONT_PATH=$FONT_NAME.ttf | ||
|
||
../image-sizes.sh false | ||
|
||
echo "Extracting font..." | ||
ttx -q -f -z extfile $FONT_NAME.ttf | ||
ttx -q -f -s -t GSUB $FONT_NAME.ttf | ||
|
||
echo "Resizing and optimizing PNGs..." | ||
mogrify -resize 96x96 -path images/96 bitmaps/strike0/*.png | ||
../resize.sh false false false | ||
rm -rf bitmaps | ||
|
||
python3 $NAME.py ../apple/${APPLE_FONT_NAME}_00.ttf $FONT_NAME.ttf $FONT_NAME.G_S_U_B_.ttx | ||
python3 $NAME.py ../apple/${APPLE_FONT_NAME}_01.ttf $FONT_NAME.ttf $FONT_NAME.G_S_U_B_.ttx | ||
|
||
otf2otc ${APPLE_FONT_NAME}_00.ttf ${APPLE_FONT_NAME}_01.ttf -o $NAME.ttc | ||
rm -f *_00.ttf *_01.ttf | ||
|
||
echo "Output file at $NAME/$NAME.ttc" |