Gulzar is a Nastaliq font for Urdu text with a typographic, rather than calligraphic feel.
We hope that Gulzar will serve as a reference and model for other Nastaliq font designs, in particular in terms of its engineering and shaping rules. If you are looking to design a Nastaliq font, you will find some documentation on the Gulzar system and how it works in engineering.md.
Only needs to be done once:
sudo pip3 install -r requirements.txt
Don't try exporting from Glyphs! It's not going to work!
- Run
make
- Output can be found in
fonts/ttf/Gulzar-Regular.ttf
make
produces a debug version of the font.make release
produces a version of the font suitable for release.make test-shaping
checks the shaping rules and produces a report inqa/shaping_tests/report.html
.make test
runs a full fontbakery check on the font.make proof
producesurdu-john.pdf
, a comparison between Noto Nastaliq and GS Nastaliq.make testproof
producestest-failures.pdf
, PDF containing words with collisions.
If you find a colliding sequence between two "words" (i.e. final glyph -> initial glyph + dots), you need to:
- Add the sequence to
qa/shaping_tests/collisions.json
so it can be tested. - Create a debug build of the font; the
Makefile
by default turns onFONTTOOLS_LOOKUP_DEBUGGING=1
which creates aDebg
table in the final font. This is stripped when building the release version. - Strip the sequence down to the smallest possible string which collides. Paste that string into Crowbar with the debug build of the font.
- Look down the list of trigged lookups to determine the sequence height. The list will include lookup names like
At_600_800_AtHeight600sub
andAt_600_800_AtHeight600pos
- this tells you the height-specific lookup routines you need to modify to mitigate the collision. - Find those lookups in
anchor-attachment.fez
. - Decide how you want to mitigate the collision. You can either:
- drop the dot one position (call
DropOne
in thesub
lookup) - drop it two positions (
DropTwo
insub
)
- drop the dot one position (call
- and/or:
- open a short space (
OpenSmallSpaceBeforeKern
inpos
) - open a large space (
OpenSpaceBeforeKern
inpos)
- bring the final glyph closer to the initial glyph (
Tighten
inpos
) - move the dots down a little further (
DropATinyBitMore
) or a lot further (DropALotMore
, both inpos
) - raise the dots a little (
Raise
inpos
) - or do something more fancy, and create a new routine to reposition the dots elsewhere.
- open a short space (
- Add a Chain rule call the appropriate routine(s). This is a bit of an art form. It should be as general as possible to avoid proliferating unnecessary rules, but as specific as possible to avoid interacting with other sequences in bad ways. Some hints:
- Try to use the shape-based classes (e.g.
@dal_like
) to address the final glyph and all other glyphs like it. - Check out other similar sequences to see how best to address the initial glyph.
- Consider using
DoNothing
andDoNothingPos
(ignore rules) to create exceptions for existing situations.
- Try to use the shape-based classes (e.g.
- Rebuild the font and run
make test-shaping
to make sure there are no unwanted interactions with other sequences.
This repository also contains FEZ plugins for Nastaliq as well as scripts to build the font file:
dump-glyphs-rules.py
turns the Nastaliq Connection information within the.glyphs
file into a CSV file so that it can be processed by thenastaliqTools.NastaliqConnections
plugin.find-notdefs.py
finds characters not currently mapped in the font.lint-arabic.py
finds missing entry/exit anchors (and will, in the future, also detect other anchor issues.)