Slevinski / signwriting_2010_tools

Tools for creating TrueType fonts for written sign language in the SignWriting script based on the ISWA 2010
MIT License
3 stars 0 forks source link

The SignWriting 2010 Tools


Version 2.2.0
January 29th, 2018
License: MIT

The SignWriting 2010 Tools are used to build the fonts of the Sutton SignWriting typeface. The SignWriting 2010 Fonts project contains the input and the output of the tools. The fonts are designed for the SignWriting 2010 JavaScript Library.

Developers

To build the fonts from the sources, you need FontForge with Python scripting support.

To control the different aspect of the automated font creation, customize the files in the source directory and the tools directory. Newly created fonts are written to the fonts directory.

To create the demo pages, you need pystache for templating. Demo pages are written to the demo directory.

To retrace the SVG from the command line, you will need several command line tools: Inkscape, pngtopnm, mkbitmap, and potrace.

To unpack the SVG Line and SVG Fill data files, the unpack.py tool can be used.

To create the SWAP symbol data file, the repack.py tool can be used.


Source Directory

The source directory is used to organize the main input of the build process.

SVG Files

The Scalar Vector Graphic files are converted to TrueType outlines with FontForge scripting.

The source SVG files required to build the fonts are available from the SignWriting 2010 Fonts project. These files were created with the SignWriting 2010 Tools by retracing the SVG Refinement using the retrace.py script. To use these files, save them to the source directory and unzip.

These files can be unpacked with the unpack.py script in the tools directory. For the best import results, unpack with magnify level 10.

> cd tools
> python unpack.py svg_line.dat -m 10
> python unpack.py svg_fill.dat -m 10

The SVGs of the compatibility glyphs for the character set "S1234567890abcdef" are based on [Source Sans Pro][25] written by Paul D. Hunt and licensed under SIL Open Font License. These files and more are available in the other-svg directory.

FEA Files

The [Feature files][41] define the standard ligature substitution for the various character sets. Three different character sets can be used to access the glyphs.

[1D800..1DAAF][42]; Sutton SignWriting
[Unicode 8][21] support without facial diacritic combining.

[FD800..FDFFF][43]; SignWriting Text
[Private Use Area characters][26] for 2-dimensional text.

[S10000..S38b07][44]; ISWA 2010 Symbol Keys
Symbol keys used as glyph names in the font files.

template directory

The templates directory is used to organize the template input for the creation of the demo pages. The templates are HTML with Mustache syntax.


Tools Directory

To build individual font files, use the Python script build.py. Use "-h" for help.

> cd tools
> python build.py -h

usage: build.py [-h] [-c filename] [-d directory] [-e extension] [-f]
                [-g filename] [-k filename] [-i version] [-l [filename]] [-m]
                [-p] [-q] [-s] [-t fontname] [-u] [-v]
                [{,Filling,Shadow}]

SignWriting 2010 build script for TTF files from SVG (version 1.4.0)

positional arguments:
  {,Filling,Shadow}     name of the subfont

optional arguments:
  -h, --help            show this help message and exit
  -c filename, --custom filename
                        name of font customization file, default of custom.txt
  -d directory, --dir directory
                        name of the sub-directory in sources for the subfont
                        files
  -e extension, --ext extension
                        name of the file extension for import, default of svg
  -f, --force           overwrite existing font files
  -g filename, --glyph filename
                        name of glyph customization file, default of glyph.txt
  -k filename, --keys filename
                        name of symbol key file, default of symkeys.txt
  -i version, --ident version
                        version of the SignWriting 2010 Fonts, default of
                        1.1.0
  -l [filename], --log [filename]
                        write to log file
  -m, --mono            helper flag for naming, import, and functions (partial
                        support)
  -p, --preview         perform all of the actions but generating the TTF
                        output
  -q, --quick           skip creation of glyphs, characters, and feature file
                        merge
  -s, --silent          eliminates the print output
  -t fontname, --title fontname
                        prefix for the various font names and files, default
                        of SignWriting 2010
  -u, --unicode         use Unicode code points for individual glyphs
  -v, --verbose         increase output verbosity

To build all of the release font files, use the shell script release.sh.

> cd tools
> more release.sh

python build.py "" -d svg_line -vf -l
python build.py Filling -d svg_fill -vf -l

> chmod a+x release.sh
> ./release.sh

To create the demo pages, use the Python script demo.py. Use "-h" for help.

> cd tools
> python demo.py -h

usage: demo.py [-h] [-d directory] [-u | -p | -k] [-a server] [-w] [-i server]
               [-s multiplier] [-t name]
              [{,Filling,Mono,Mono Filling} ...]

Automated creation of the SignWriting 2010 font demo pages

positional arguments:
  {,Filling,Mono,Mono Filling}
                        name of the subfont

optional arguments:
  -h, --help            show this help message and exit
  -d directory, --dir directory
                        name of subdirectory to write demo files, default of
                        test
  -u, --uni             use Unicode 8 for demo pages
  -p, --pua             use Unicode Private Use Area for demo pages
  -k, --key             use symbol keys for demo pages
  -a server, --asset server
                        url of SignWriting Asset Provider for SVG, default of
                        http://signbank.org/swap
  -w, --withpng         include PNG column in comparison table
  -i server, --image server
                        url of SignWriting Icon Server for PNG, default of
                        http://signbank.org/swis
  -s multiplier, --size multiplier
                        set the relative size of the glyph, default of 5
  -t name, --title name
                        title for the HTML demo pages, default of SignWriting
                        2010 Demo Pages

To build the current demo pages used for development, use the shell script demo.sh.

> cd tools
> more demo.sh

python demo.py "" Filling -w -u -d "unicode8"
python demo.py "" Filling -w -p -d "unicodepua"
python demo.py "" Filling -w -k -d "symbolkey"

> chmod a+x demo.sh
> ./demo.sh

There are 3 types of demo pages available online.

The text file symkeys.txt contains a list of the 37,811 symbol keys of the ISWA 2010.

S10000
S10001
S10002
...

The text file symsize.txt contains a list of the 37,811 symbol keys with their individual sizes.

S10000515x530
S10001521x530
S10002530x515
...

The text file custom.txt contains a list of custom settings for the entire font.

weight="Medium"
copyright="SignWriting 2010 is released under the SIL Open Font License
comment="The SignWriting 2010 font is a typeface for written sign languages
descent=30
ascent=0
em=300

The text file glyph.txt contains a list of glyph settings to apply to each char.

right_side_bearing=0

Reference

The character encodings used in SignWriting 2010 are defined in an Internet Draft submitted to the IETF: [draft-slevinski-signwriting-text][26]. The document is improved and resubmitted every 6 months. The character design has been stable since January 12, 2012. The current version of the Internet Draft is 05. The next version is planned for November 2015.


Epilogue

This is a work in progress. Feedback, bug reports, and patches are welcomed.

While I strived to keep the code clean and organized, it got away from me in the end. The fine tuning and the symbol adjustments were not as straightforward as anticipated. The script unpack.py required a series of complications, as found with the --adjust and --beta flags. These flags and custom data files were used to update the source SVG. Because of the new source SVG, these types of adjustments will not be needed again. Future adjustments may be required of a different sort to address the occasional flattening of various symbols on specific browser/platform combinations.


To Do

Version History