| == Introduction == | |
| Graphite2 is a reimplementation of the SIL Graphite text processing engine. The | |
| reason for such a project has grown out of the experience gained in integration | |
| the Graphite engine into various applications and frameworks. The original | |
| engine was designed with different use cases in mind and optimised towards | |
| those. These optimisations get in the way of optimising for the actual use case | |
| requirements that the integration projects required. The Graphite2 engine, | |
| therefore, is designed for use where a simple shaping engine is required, much | |
| akin to the simpler OpenType engine interfaces that exist. Graphite2 has the | |
| following features over the original engine: | |
| - Faster | |
| - Smaller memory footprint | |
| - More resilient to font corruption | |
| - Smaller code base | |
| What is lost is: | |
| - Selection support | |
| - Line end contextuals | |
| - Integrated line breaking to paragraph rendering | |
| .What is Graphite? | |
| Graphite is a 'smart font' technology designed to facilitate the process known | |
| as shaping. This process takes an input Unicode text string and returns a | |
| sequence of positioned glyphids from the font. There are other similar 'smart | |
| font' technologies including AAT and OpenType. While OpenType implementations | |
| are more prevalently integrated into applications than Graphite, Graphite still | |
| has a place. Graphite was developed primarily to address the generic shaping | |
| problem where current OpenType shaping engines do not address the specific needs | |
| of a font developer and the lead time on any changes to address those needs | |
| become prohibitive. This is a particular issue when creating solutions for some | |
| minority languages. In effect OpenType addresses the 80% problem and Graphite | |
| the 20% problem (or is that the 98% problem and the 2% problem?) | |
| There are a number of reasons why someone might want to add Graphite smarts to | |
| their font: | |
| - There is no consistent shaping across OpenType engines for the script and | |
| writing system that a font designer wants their font to support. Not all | |
| OpenType engines support all scripts in the same way. In addition, some | |
| writing system requirements do not fit with the shaping of the script that | |
| OpenType engines support. | |
| - The font designer would like to implement more complex shaping and positioning | |
| than OpenType supports. For example, in Graphite one can position glyphs based | |
| on the positions and sizes of other glyphs. | |
| - Graphite supports user defined features. The font designer may create and | |
| support any features they want and these can be presented to the user in a | |
| standardised way. | |
| Graphite allows font implementors to implement their font their way. It does not | |
| require them to fit within an, often poorly specified, interface between the | |
| shaper and the font. This allows for quicker debugging and results. Graphite | |
| supports font debugging to identify what the shaper is doing all the way from | |
| input Unicode to output glyphs and positions, giving font designers better | |
| control over their font processing. |