Browse Source

padascii2uniascii script and some notes in README

main
emile 4 weeks ago
parent
commit
d5ea4c1fc3
  1. 1
      .gitignore
  2. 74
      README.md
  3. 32
      padascii2uniascii.sh

1
.gitignore

@ -1,4 +1,5 @@
*~ *~
*.swp *.swp
*.swo *.swo
unifont

74
README.md

@ -0,0 +1,74 @@
# Qunifont
Qunifont is a [qunified](https://typotheque.genderfluid.space/fr/quni#quni) version of the [Unifont](https://unifoundry.com/unifont/index.html)
## Drawing new Qunifont glyphs (in pads)
Download, extract and rename the last Unifont tar.gz file (https://unifoundry.com/pub/unifont/?C=M;O=D) to get access to the Unifont utilities scripts
curl https://unifoundry.com/pub/unifont/unifont-16.0.01/unifont-16.0.01.tar.gz -o unifont.tar.gz
tar -xvf unifont.tar.gz
mv unifont-16.0.01 unifont
Draw glyphs in a pad following this format (hexadecimal identifier):
F4910:
----------------
----------------
----------------
----------------
---#----######--
---#---#------#-
---#---#------#-
-##############-
---#------------
---#------------
---#------------
---#------------
---#------------
----##----------
----------------
----------------
Run `padascii2uniascii` 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
Use the Unifont hex glyphs as a base file
cp unifont/font/planee00/unifont-base.hex qunifont.hex
Convert uniascii to unihex and add them to the base file
./unifont/src/hexdraw qunifont.txt >> qunifont.hex
Convert unihex to bdf
./unifont/src/hex2bdf qunifont.hex > qunifont.bdf
TODO: convert to OTF, add OpenType features, change metadata
## Other useful commands
Convert unihex to png (-p for plage)
./unifont/src/unihex2png -i qunifont.hex -o qunifont.png -p 0
Convert unihex to sfd
??? see https://www.venea.net/man/hex2sfd(1)
Convert unihex to otf
./unifontsrc/hex2otf ???
Print specific glyph in terminal from hexcode
printf %b\\n \\UF1010
󱀐
printf %b\\n \\UFFE1
printf %b\\n \\U1F480
💀

32
padascii2uniascii.sh

@ -0,0 +1,32 @@
#!/bin/bash
# remove php arguments from url
url="${1%%\?*}"
# download pad's /export/txt
curl $url/export/txt > export.txt
# remove the weird * from framapad txt export (framapad only)
# sed -i 's/^*//' export.txt
# remove comments starting with //
sed -i '/^\/\/*/d' export.txt
# remove empty lines
sed -i '/^[[:space:]]*$/d' export.txt
## homogénéiser les pixels vides (points, espaces, tirets)
## ???
# add tabs to each lines starting by - or #
sed -i 's/^[-|#]/\t&/' export.txt
# add newline before glyph id
sed -i '/:$/i\ ' export.txt
# remove \n after glyph id
sed -z 's/:\n/:/g' export.txt
# the output should now be ready to use with the unifont utility "hexdraw"
# hexdraw:convert a GNU Unifont .hex file to and from an ASCII text file
Loading…
Cancel
Save