somes fixes on mergehex.sh and firsts opentype features

This commit is contained in:
emile 2024-11-17 12:29:59 +01:00
parent 01bcd11751
commit 4410c1003c
3 changed files with 43 additions and 14 deletions

View File

@ -40,23 +40,20 @@ Draw glyphs in a pad following this format (hexadecimal identifier):
Run `padascii2uniascii.sh` to download the pad's content and format it for the Unifont utilities (uniascii) Run `padascii2uniascii.sh` to download the pad's content and format it for the Unifont utilities (uniascii)
./padascii2uniascii.sh http://88.127.187.90:9001/p/qunifont > qunifont.txt ./padascii2uniascii.sh http://92.131.57.17:9001/p/qunifont > qunifont.txt
Run `mergehex.sh` to convert `qunifont.txt` (uniascii) to unihex and merge it with the `unfont-base.hex` file Run `mergehex.sh` to convert `qunifont.txt` (uniascii) to unihex and merge it with the `unfont-base.hex` file
./mergehex.sh ./mergehex.sh
Convert unihex to bdf
./unifont/src/hex2bdf qunifont.hex > qunifont.bdf
Convert unihex to otf, --help for format list Convert unihex to otf, --help for format list
./unifont/src/hex2otf hex=qunifont.hex out=qunifont.otf format=truetype ./unifont/src/hex2otf hex=merge.hex out=qunifont.otf format=truetype
TODO: add OpenType features Add OpenType features (in fontforge for the moment)
open qunifont.otf > file > merge feature info > select file > features_qunifont.fea
see https://gitlab.com/bye-bye-binary/typotheque/-/raw/master/features-samples/features_exemple_long.fea
## Other useful commands etc. ## Other useful commands etc.
@ -68,6 +65,10 @@ Convert unihex to png preview table (-p for plage)
./unifont/src/unihex2png -i qunifont.hex -o qunifont.png -p 0 ./unifont/src/unihex2png -i qunifont.hex -o qunifont.png -p 0
Convert unihex to bdf
./unifont/src/hex2bdf qunifont.hex > qunifont.bdf
Convert unihex to sfd Convert unihex to sfd
./unifont/src/hex2sfd < qunifont.hex > qunifont.sfd ./unifont/src/hex2sfd < qunifont.hex > qunifont.sfd
@ -85,7 +86,7 @@ Print specific glyph in terminal from hexcode
Download .fea from BBB Download .fea from BBB
wget https://gitlab.com/bye-bye-binary/typotheque/-/raw/master/features-samples/features_exemple_long.fea curl -O https://gitlab.com/bye-bye-binary/typotheque/-/raw/master/features-samples/features_exemple_long.fea
Edit Fontforge Lookup table Edit Fontforge Lookup table

29
features_qunifont.fea Normal file
View File

@ -0,0 +1,29 @@
languagesystem DFLT dflt;
languagesystem latn dflt;
# GSUB
lookup points {
sub \period \period by \periodcentered;
} points;
lookup ligaturesinclusives {
sub \t \periodcentered \e by \uF4910;
} ligaturesinclusives;
# récap gsub
feature liga {
script DFLT;
language dflt ;
lookup points;
lookup ligaturesinclusives;
script latn;
language dflt ;
lookup points;
lookup ligaturesinclusives;
} liga;

View File

@ -9,16 +9,15 @@ for i in `cat qunifont.hex`; do
ids+=($(echo "$i" | cut -d : -f 1):) ids+=($(echo "$i" | cut -d : -f 1):)
done; done;
# copy unifont.hex (only the beginning so it's lighter and easier to work with for the moment)
head -n 254 unifont/font/plane00/unifont-base.hex > unifont.hex
# remove duplicate ids from unifont.hex # remove duplicate ids from unifont.hex
#cp unifont/font/plane00/unifont-base.hex unifont.hex
for i in "${ids[@]}"; do for i in "${ids[@]}"; do
echo $i; echo $i;
sed -i "/^$i/d" unifont.hex sed -i "/^$i/d" unifont.hex
done; done;
# TODO: # concat cleaned unifont.hex and qunifont.hex
# cut first n glyphs of unifont-hex to make it lighter
# concat qunifont.hex to cleaned unifont.hex
cat unifont.hex > merge.hex cat unifont.hex > merge.hex
cat qunifont.hex >> merge.hex cat qunifont.hex >> merge.hex