Skip to content

Commit

Permalink
Bug 631479. Simple reftests of graphite font handling (if enabled). r…
Browse files Browse the repository at this point in the history
…=jfkthame
  • Loading branch information
John Daggett committed Dec 9, 2011
1 parent f5e2656 commit 9848a8f
Show file tree
Hide file tree
Showing 22 changed files with 96,456 additions and 0 deletions.
37 changes: 37 additions & 0 deletions layout/reftests/fonts/graphite/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Test fonts with Graphite tables for testing

Original font: League Gothic by League of Moveable Type, converted to TT via FontSquirrel

Kerning, GDEF/GSUB/GPOS info stripped out and the name table edited to
produce grtest-template.ttx.

Making a test font:

1. Build ttx from template
sed -e 's/xxxfontnamexxx/grtestxxx/' grtest-template.ttx >grtestxxx-src.ttx

2. Make the font
ttx grtestxxx-src.ttx

3. Edit GDL file

4. Compile the GDL into the ttf

../graphite-compiler.sh -d -v3 -w3521 -w510 font.gdl grtestxxx-src.ttf grtestxxx.ttf

Where graphite-compiler.sh is a script to run the graphite compiler in wine on OSX
(the compiler is available both as a Windows exe and as source).

Graphite compiler download:
http://scripts.sil.org/cms/scripts/page.php?item_id=GraphiteCompilerDownload

grtest-simple.ttf
Simple FAIL ==> PaSs substitution via graphite or via OT with TST1=1

grtest-multipass.ttf
Several passes where the end result is FAIL ==> PaSs or via OT with TST1=1

grtest-langfeat.ttf
FAIL ==> PaSs substitution enabled via language or feature settings or via OT with TST1=1

62 changes: 62 additions & 0 deletions layout/reftests/fonts/graphite/grtest-langfeat.gdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#include "stddef.gdh"
#define LG_USENG 1033

table(glyph)
clsFail = codepoint("FAIL");
clsPass = codepoint("PaSs");
endtable

table (feature)

failtopass
{
id = "FTPS";
name.LG_USENG = string("Pass substitution");
default = 0;
}

failtopass2
{
id = "FTP2";
name.LG_USENG = string("Pass substitution 2");
default = 0;
}

passtofail
{
id = "PTFL";
name.LG_USENG = string("Pass to fail substitution");
default = 0;
}

endtable

table (language)

french {
languages = ( "fr" );
failtopass = 1;
}

french2 {
languages = ( "fra" );
passtofail = 1;
}

endtable;

table(substitution)

pass(1)

if (failtopass || failtopass2)
clsFail > clsPass;
endif;

if (passtofail)
clsPass > clsFail;
endif;

endpass;

endtable
Binary file not shown.
49 changes: 49 additions & 0 deletions layout/reftests/fonts/graphite/grtest-multipass.gdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "stddef.gdh"

table(glyph)
gSpace = codepoint(" ");

gA = codepoint("A");
gB = codepoint("B");
gC = codepoint("C");
gF = codepoint("F");
gI = codepoint("I");
gL = codepoint("L");
gP = codepoint("P");
gS = codepoint("S");
ga = codepoint("a");
gs = codepoint("s");
g1 = codepoint("1");
g2 = codepoint("2");
g3 = codepoint("3");
g4 = codepoint("4");

clsFail = codepoint("FAIL");
clsPass = codepoint("PaSs");
cls1234 = codepoint("1234");
cls5678 = codepoint("5678");
endtable

table(substitution)

pass(1)
clsFail > cls1234;
endpass;

pass(2)
cls1234 > @1 @1;
endpass;

pass(3)
cls1234 cls1234 > @1 cls5678;
endpass;

pass(4)
cls1234 cls5678 > _ clsFail;
endpass;

pass(5)
gF gA gI gL > gP ga gS gs;
endpass;

endtable
Binary file not shown.
Binary file added layout/reftests/fonts/graphite/grtest-ot-only.ttf
Binary file not shown.
Loading

0 comments on commit 9848a8f

Please sign in to comment.