Debian Codegraph @

tests/helper118B.pe

raw
1
2 # tests whether the bounding boxes of all glyphs match.
3 # This is designed to make sure that we get postscript references right
4 # bugs often give them the wrong offsets.
5
6 Open($2)
7 i=0;
8 tot = CharCnt()
9 while ( i<tot )
10 Open($1) # Switch to base font
11 if ( SelectIf(i)>0 && WorthOutputting(i))
12 name = CharInfo("Name")
13 bbox = CharInfo("BBox")
14 Open($2)
15 if ( SelectIf(name)<=0 )
16 Error( "Could not find a glyph named " + name + " in " + $2 )
17 else
18 bbox2 = CharInfo("BBox")
19 if ( Round(bbox[0])!=Round(bbox2[0]) || Round(bbox[1])!=Round(bbox2[1]) || Round(bbox[2])!=Round(bbox2[2]) || Round(bbox[3])!=Round(bbox2[3]) )
20 Error( "Bounding boxes of glyph " +name+ " do not match. Should be " + ToString(bbox) + " but was " + ToString(bbox2) + " in " + $2 )
21 endif
22 endif
23 endif
24 i = i+1
25 endloop
26
27 Open($2 )
28 Close()