SIL Non-Roman Script Initiative

Graphite

A free and open rendering engine for complex scripts

Graphite Tutorial

Unit 9: Multiple passes per table

Exercise

Discussion

So far we have been introduced to the substitution table, and have briefly mentioned the existence of other tables containing rules. However it is also possible to have multiple passes per table. These are created by the using the pass and endpass statements. The first pass should be numbered 1, and the output of each pass becomes input to the following pass.

table(sub)

pass(1)
  <rules for pass 1>
endpass;

pass(2)
  <rules for pass 2>
endpass;

endtable;

Exercise

Rewrite your program from Exercises 6a and 7 using slot attributes and two passes. The first pass sets a user-defined slot attribute called “hardC”, based on the context in which the c is encountered. Note: there is no need to include the > syntax when all you are doing is setting a slot attribute. Use the following syntax:

<glyph-class> { <set slot attribute> }  /  <context>;

In the second pass, test the value of hardC and perform the appropriate substitution.

Have you observed any subtle differences among the results of Exercises 6a, 7, and 9?

Solution

Copyright © 2012 SIL International® and released under the  Creative Commons Attribution-ShareAlike 3.0 license (CC-BY-SA) unless noted otherwise.