| 1 |
--- |
| 2 |
layout: default |
| 3 |
title: Font Development |
| 4 |
nav_order: 30 |
| 5 |
parent: Developers |
| 6 |
--- |
| 7 |
|
| 8 |
# Font Development |
| 9 |
|
| 10 |
## Overview |
| 11 |
|
| 12 |
Adding Graphite support to a font involves: |
| 13 |
|
| 14 |
1. writing a program using Graphite Description Language (GDL) describing the behavior of the font |
| 15 |
2. compiling the program along with the font to create the Graphite-enabled version of the font |
| 16 |
3. testing and debugging your smart font using a Graphite-enabled application |
| 17 |
|
| 18 |
{: .blue-note } |
| 19 |
> To add Graphite support to a font, the font's license must grant you permission to modify it. |
| 20 |
|
| 21 |
### 1. The GDL program |
| 22 |
|
| 23 |
GDL is a programming language that describes the "smart" behavior of the font. It is written to correspond to a specific font, and includes definitions of the glyphs in the font and rules describing their behavior. |
| 24 |
|
| 25 |
[Download GDL documentation](assets/resources/GDL.pdf){: .btn .btn-blue } |
| 26 |
|
| 27 |
The following tools can be used to assist in the development of a GDL program: |
| 28 |
|
| 29 |
* make_gdl.pl - a Perl utility that automatically generates some of the necessary GDL code from a font and an XML file of attachment point data. This is included in the SIL [↗ FontUtils](https://scripts.sil.org/FontUtils){:target="_blank"} package. |
| 30 |
* FLWriteXml.py - a Python utility that outputs a file of attachment points from FontLab, which can then be used by make_gdl to define attachment points for Graphite. This file can be downloaded from the [↗ SIL Font Utility GitHub repository](https://github.com/silnrsi/pysilfont){:target="_blank"}. |
| 31 |
|
| 32 |
### 2. Compiling the program |
| 33 |
|
| 34 |
The Graphite compiler takes as input the original font and the GDL program, and outputs a new version of the font with the GDL code converted into special-purpose TrueType tables. These tables are used by the Graphite engine to perform smart rendering. |
| 35 |
|
| 36 |
The Windows executable can be downloaded [↗ here](https://scripts.sil.org/GraphiteCompilerDownload){:target="_blank"}. |
| 37 |
|
| 38 |
For Linux systems, the source for the grcompiler program is available from [↗ here](http://sourceforge.net/projects/silgraphite/files/grcompiler){:target="_blank"}. You can install it using the package manager: `sudo apt install grcompiler`. |
| 39 |
|
| 40 |
### 3. Testing the font |
| 41 |
|
| 42 |
You can test your font using any [Graphite-enabled application](graphite_apps). In order to do so, the most recently compiled version of the font must be properly installed according to the requirements of the operating system. You must also have a way to provide the specific Unicode characters--a keyboard, existing datafile, etc. |
| 43 |
|
| 44 |
If you discover errors in the behavior of the Graphite font, modify the GDL program, recompile, reinstall the output font, and retest. |
| 45 |
|
| 46 |
## Graide |
| 47 |
|
| 48 |
[Graide](graide) is a tool for creating Graphite fonts. Version 1.0 is available. |
| 49 |
|
| 50 |
## Tutorial |
| 51 |
|
| 52 |
The following is a tutorial to help you learn to program using GDL. It includes instructions for using Graide (GRAphite Integrated Development Environment): |
| 53 |
|
| 54 |
[GDL Tutorial](graide_tutorial) |
| 55 |
|
| 56 |
## GDL code snippets |
| 57 |
|
| 58 |
The following small examples can be a useful reference as you develop your Graphite font. |
| 59 |
|
| 60 |
[Code snippets](graphite_codeSnippets) |