From 4410c1003cd345ef0f56edf7bdb04bc08b34bbc4 Mon Sep 17 00:00:00 2001 From: emile Date: Sun, 17 Nov 2024 12:29:59 +0100 Subject: [PATCH] somes fixes on mergehex.sh and firsts opentype features --- README.md | 19 ++++++++++--------- features_qunifont.fea | 29 +++++++++++++++++++++++++++++ mergehex.sh | 9 ++++----- 3 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 features_qunifont.fea diff --git a/README.md b/README.md index f312676..ad5fb98 100644 --- a/README.md +++ b/README.md @@ -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) - ./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 ./mergehex.sh -Convert unihex to bdf - - ./unifont/src/hex2bdf qunifont.hex > qunifont.bdf - 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 + +Add OpenType features (in fontforge for the moment) -TODO: add OpenType features + 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. @@ -68,6 +65,10 @@ Convert unihex to png preview table (-p for plage) ./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 ./unifont/src/hex2sfd < qunifont.hex > qunifont.sfd @@ -85,7 +86,7 @@ Print specific glyph in terminal from hexcode 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 diff --git a/features_qunifont.fea b/features_qunifont.fea new file mode 100644 index 0000000..e2a5c75 --- /dev/null +++ b/features_qunifont.fea @@ -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; diff --git a/mergehex.sh b/mergehex.sh index 029fae2..27c1f8c 100755 --- a/mergehex.sh +++ b/mergehex.sh @@ -9,16 +9,15 @@ for i in `cat qunifont.hex`; do ids+=($(echo "$i" | cut -d : -f 1):) 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 -#cp unifont/font/plane00/unifont-base.hex unifont.hex for i in "${ids[@]}"; do echo $i; sed -i "/^$i/d" unifont.hex done; -# TODO: -# cut first n glyphs of unifont-hex to make it lighter - -# concat qunifont.hex to cleaned unifont.hex +# concat cleaned unifont.hex and qunifont.hex cat unifont.hex > merge.hex cat qunifont.hex >> merge.hex