You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/05/07 18:23:17 UTC
svn commit: r1479969 [15/16] - in /xmlgraphics/fop/trunk: ./
src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/
src/codegen/unicode/java/org/apache/fop/hyphenation/
src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/
src/java/org/...
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFile.java Tue May 7 16:23:13 2013
@@ -230,46 +230,46 @@ public class TTXFile {
v2 = null;
upem = -1;
}
- public void parse (String filename) {
- parse (new File (filename));
+ public void parse(String filename) {
+ parse(new File(filename));
}
- public void parse (File f) {
+ public void parse(File f) {
assert f != null;
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
- sp.parse (f, new Handler());
+ sp.parse(f, new Handler());
} catch (FactoryConfigurationError e) {
- throw new RuntimeException (e.getMessage());
+ throw new RuntimeException(e.getMessage());
} catch (ParserConfigurationException e) {
- throw new RuntimeException (e.getMessage());
+ throw new RuntimeException(e.getMessage());
} catch (SAXException e) {
- throw new RuntimeException (e.getMessage());
+ throw new RuntimeException(e.getMessage());
} catch (IOException e) {
- throw new RuntimeException (e.getMessage());
+ throw new RuntimeException(e.getMessage());
}
}
- public GlyphSequence mapCharsToGlyphs (String s) {
- Integer[] ca = UTF32.toUTF32 (s, 0, true);
+ public GlyphSequence mapCharsToGlyphs(String s) {
+ Integer[] ca = UTF32.toUTF32(s, 0, true);
int ng = ca.length;
- IntBuffer cb = IntBuffer.allocate (ng);
- IntBuffer gb = IntBuffer.allocate (ng);
+ IntBuffer cb = IntBuffer.allocate(ng);
+ IntBuffer gb = IntBuffer.allocate(ng);
for (Integer c : ca) {
- int g = mapCharToGlyph ((int) c);
+ int g = mapCharToGlyph((int) c);
if (g >= 0) {
- cb.put (c);
- gb.put (g);
+ cb.put(c);
+ gb.put(g);
} else {
- throw new IllegalArgumentException ("character " + CharUtilities.format (c) + " has no corresponding glyph");
+ throw new IllegalArgumentException("character " + CharUtilities.format(c) + " has no corresponding glyph");
}
}
cb.rewind();
gb.rewind();
- return new GlyphSequence (cb, gb, null);
+ return new GlyphSequence(cb, gb, null);
}
- public int mapCharToGlyph (int c) {
+ public int mapCharToGlyph(int c) {
if (cmap != null) {
- Integer g = cmap.get (Integer.valueOf (c));
+ Integer g = cmap.get(Integer.valueOf(c));
if (g != null) {
return (int) g;
} else {
@@ -279,38 +279,38 @@ public class TTXFile {
return -1;
}
}
- public int getGlyph (String gid) {
- return mapGlyphId0 (gid);
+ public int getGlyph(String gid) {
+ return mapGlyphId0(gid);
}
- public GlyphSequence getGlyphSequence (String[] gids) {
+ public GlyphSequence getGlyphSequence(String[] gids) {
assert gids != null;
int ng = gids.length;
- IntBuffer cb = IntBuffer.allocate (ng);
- IntBuffer gb = IntBuffer.allocate (ng);
+ IntBuffer cb = IntBuffer.allocate(ng);
+ IntBuffer gb = IntBuffer.allocate(ng);
for (String gid : gids) {
- int g = mapGlyphId0 (gid);
+ int g = mapGlyphId0(gid);
if (g >= 0) {
- int c = mapGlyphIdToChar (gid);
+ int c = mapGlyphIdToChar(gid);
if (c < 0) {
c = CharUtilities.NOT_A_CHARACTER;
}
- cb.put (c);
- gb.put (g);
+ cb.put(c);
+ gb.put(g);
} else {
- throw new IllegalArgumentException ("unmapped glyph id \"" + gid + "\"");
+ throw new IllegalArgumentException("unmapped glyph id \"" + gid + "\"");
}
}
cb.rewind();
gb.rewind();
- return new GlyphSequence (cb, gb, null);
+ return new GlyphSequence(cb, gb, null);
}
- public int[] getWidths (String[] gids) {
+ public int[] getWidths(String[] gids) {
assert gids != null;
int ng = gids.length;
int[] widths = new int [ ng ];
int i = 0;
for (String gid : gids) {
- int g = mapGlyphId0 (gid);
+ int g = mapGlyphId0(gid);
int w = 0;
if (g >= 0) {
if ((hmtx != null) && (g < hmtx.length)) {
@@ -330,14 +330,14 @@ public class TTXFile {
if ((hmtx != null) && (upem > 0)) {
int[] widths = new int [ hmtx.length ];
for (int i = 0, n = widths.length; i < n; i++) {
- widths [ i ] = getPDFWidth (hmtx [ i ] [ 0 ], upem);
+ widths [ i ] = getPDFWidth(hmtx [ i ] [ 0 ], upem);
}
this.widths = widths;
}
}
return this.widths;
}
- public static int getPDFWidth (int tw, int upem) {
+ public static int getPDFWidth(int tw, int upem) {
// N.B. The following is copied (with minor edits) from TTFFile to insure same results
int pw;
if (tw < 0) {
@@ -359,13 +359,13 @@ public class TTXFile {
public GlyphPositioningTable getGPOS() {
return gpos;
}
- public static synchronized TTXFile getFromCache (String filename) {
+ public static synchronized TTXFile getFromCache(String filename) {
assert cache != null;
TTXFile f;
- if ((f = (TTXFile) cache.get (filename)) == null) {
+ if ((f = (TTXFile) cache.get(filename)) == null) {
f = new TTXFile();
- f.parse (filename);
- cache.put (filename, f);
+ f.parse(filename);
+ cache.put(filename, f);
}
return f;
}
@@ -382,56 +382,56 @@ public class TTXFile {
public void endDocument() {
}
@Override
- public void setDocumentLocator (Locator locator) {
+ public void setDocumentLocator(Locator locator) {
TTXFile.this.locator = locator;
}
@Override
- public void startElement (String uri, String localName, String qName, Attributes attrs) throws SAXException {
- String[] en = makeExpandedName (uri, localName, qName);
+ public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
+ String[] en = makeExpandedName(uri, localName, qName);
if (en[0] != null) {
- unsupportedElement (en);
- } else if (en[1].equals ("Alternate")) {
+ unsupportedElement(en);
+ } else if (en[1].equals("Alternate")) {
String[] pn = new String[] { null, "AlternateSet" };
- if (isParent (pn)) {
- String glyph = attrs.getValue ("glyph");
+ if (isParent(pn)) {
+ String glyph = attrs.getValue("glyph");
if (glyph == null) {
- missingRequiredAttribute (en, "glyph");
+ missingRequiredAttribute(en, "glyph");
}
- int gid = mapGlyphId (glyph, en);
- alternates.add (Integer.valueOf (gid));
+ int gid = mapGlyphId(glyph, en);
+ alternates.add(Integer.valueOf(gid));
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("AlternateSet")) {
+ } else if (en[1].equals("AlternateSet")) {
String[] pn = new String[] { null, "AlternateSubst" };
- if (isParent (pn)) {
- String glyph = attrs.getValue ("glyph");
+ if (isParent(pn)) {
+ String glyph = attrs.getValue("glyph");
if (glyph == null) {
- missingRequiredAttribute (en, "glyph");
+ missingRequiredAttribute(en, "glyph");
}
- int gid = mapGlyphId (glyph, en);
- coverageEntries.add (Integer.valueOf (gid));
+ int gid = mapGlyphId(glyph, en);
+ coverageEntries.add(Integer.valueOf(gid));
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("AlternateSubst")) {
+ } else if (en[1].equals("AlternateSubst")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -442,32 +442,32 @@ public class TTXFile {
assert sf >= 0;
stFormat = sf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("BacktrackCoverage")) {
+ } else if (en[1].equals("BacktrackCoverage")) {
String[] pn1 = new String[] { null, "ChainContextSubst" };
String[] pn2 = new String[] { null, "ChainContextPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
int ci = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- ci = Integer.parseInt (index);
+ ci = Integer.parseInt(index);
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -475,44 +475,44 @@ public class TTXFile {
ctIndex = ci;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("BaseAnchor")) {
+ } else if (en[1].equals("BaseAnchor")) {
String[] pn = new String[] { null, "BaseRecord" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("BaseArray")) {
+ } else if (en[1].equals("BaseArray")) {
String[] pn = new String[] { null, "MarkBasePos" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("BaseCoverage")) {
+ } else if (en[1].equals("BaseCoverage")) {
String[] pn = new String[] { null, "MarkBasePos" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -520,38 +520,38 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("BaseRecord")) {
+ } else if (en[1].equals("BaseRecord")) {
String[] pn = new String[] { null, "BaseArray" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("ChainContextPos") || en[1].equals ("ChainContextSubst")) {
+ } else if (en[1].equals("ChainContextPos") || en[1].equals("ChainContextSubst")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
case 2:
case 3:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -559,85 +559,85 @@ public class TTXFile {
assert sf >= 0;
stFormat = sf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Class")) {
+ } else if (en[1].equals("Class")) {
String[] pn = new String[] { null, "MarkRecord" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
int v = -1;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- v = Integer.parseInt (value);
+ v = Integer.parseInt(value);
}
assert markClass == -1;
markClass = v;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("ClassDef")) {
+ } else if (en[1].equals("ClassDef")) {
String[] pn1 = new String[] { null, "GlyphClassDef" };
String[] pn2 = new String[] { null, "MarkAttachClassDef" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String glyph = attrs.getValue ("glyph");
+ if (isParent(pnx)) {
+ String glyph = attrs.getValue("glyph");
if (glyph == null) {
- missingRequiredAttribute (en, "glyph");
+ missingRequiredAttribute(en, "glyph");
}
- String glyphClass = attrs.getValue ("class");
+ String glyphClass = attrs.getValue("class");
if (glyphClass == null) {
- missingRequiredAttribute (en, "class");
+ missingRequiredAttribute(en, "class");
}
- if (! glyphIds.containsKey (glyph)) {
- unsupportedGlyph (en, glyph);
- } else if (isParent (pn1)) {
- if (glyphClasses.containsKey (glyph)) {
- duplicateGlyphClass (en, glyph, glyphClass);
+ if (! glyphIds.containsKey(glyph)) {
+ unsupportedGlyph(en, glyph);
+ } else if (isParent(pn1)) {
+ if (glyphClasses.containsKey(glyph)) {
+ duplicateGlyphClass(en, glyph, glyphClass);
} else {
- glyphClasses.put (glyph, Integer.parseInt(glyphClass));
+ glyphClasses.put(glyph, Integer.parseInt(glyphClass));
}
- } else if (isParent (pn2)) {
- if (glyphClasses.containsKey (glyph)) {
- duplicateGlyphClass (en, glyph, glyphClass);
+ } else if (isParent(pn2)) {
+ if (glyphClasses.containsKey(glyph)) {
+ duplicateGlyphClass(en, glyph, glyphClass);
} else {
- glyphClasses.put (glyph, Integer.parseInt(glyphClass));
+ glyphClasses.put(glyph, Integer.parseInt(glyphClass));
}
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("ComponentRecord")) {
+ } else if (en[1].equals("ComponentRecord")) {
String[] pn = new String[] { null, "LigatureAttach" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
assert anchors.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Coverage")) {
+ } else if (en[1].equals("Coverage")) {
String[] pn1 = new String[] { null, "CursivePos" };
String[] pn2 = new String[] { null, "LigCaretList" };
String[] pn3 = new String[] { null, "MultipleSubst" };
String[] pn4 = new String[] { null, "PairPos" };
String[] pn5 = new String[] { null, "SinglePos" };
String[][] pnx = new String[][] { pn1, pn2, pn3, pn4, pn5 };
- if (isParent (pnx)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pnx)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -645,26 +645,26 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("CursivePos")) {
+ } else if (en[1].equals("CursivePos")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -673,143 +673,143 @@ public class TTXFile {
stFormat = sf;
assert attachmentAnchors.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("DefaultLangSys")) {
+ } else if (en[1].equals("DefaultLangSys")) {
String[] pn = new String[] { null, "Script" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
} else {
assertLanguageFeaturesClear();
assert languageTag == null;
languageTag = defaultLanguageTag;
}
- } else if (en[1].equals ("EntryAnchor")) {
+ } else if (en[1].equals("EntryAnchor")) {
String[] pn = new String[] { null, "EntryExitRecord" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("EntryExitRecord")) {
+ } else if (en[1].equals("EntryExitRecord")) {
String[] pn = new String[] { null, "CursivePos" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("ExitAnchor")) {
+ } else if (en[1].equals("ExitAnchor")) {
String[] pn = new String[] { null, "EntryExitRecord" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Feature")) {
+ } else if (en[1].equals("Feature")) {
String[] pn = new String[] { null, "FeatureRecord" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
} else {
assertFeatureLookupsClear();
}
- } else if (en[1].equals ("FeatureIndex")) {
+ } else if (en[1].equals("FeatureIndex")) {
String[] pn1 = new String[] { null, "DefaultLangSys" };
String[] pn2 = new String[] { null, "LangSys" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String value = attrs.getValue ("value");
+ String value = attrs.getValue("value");
int v = -1;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- v = Integer.parseInt (value);
+ v = Integer.parseInt(value);
}
if (languageFeatures.size() == 0) {
- languageFeatures.add (null);
+ languageFeatures.add(null);
}
if ((v >= 0) && (v < 65535)) {
- languageFeatures.add (makeFeatureId (v));
+ languageFeatures.add(makeFeatureId(v));
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("FeatureList")) {
+ } else if (en[1].equals("FeatureList")) {
String[] pn1 = new String[] { null, "GSUB" };
String[] pn2 = new String[] { null, "GPOS" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (! isParent (pnx)) {
- notPermittedInElementContext (en, getParent(), pnx);
+ if (! isParent(pnx)) {
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("FeatureRecord")) {
+ } else if (en[1].equals("FeatureRecord")) {
String[] pn = new String[] { null, "FeatureList" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
int fi = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- fi = Integer.parseInt (index);
+ fi = Integer.parseInt(index);
}
assertFeatureClear();
assert flIndex == -1;
flIndex = fi;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("FeatureTag")) {
+ } else if (en[1].equals("FeatureTag")) {
String[] pn = new String[] { null, "FeatureRecord" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
assert featureTag == null;
featureTag = value;
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("GDEF")) {
+ } else if (en[1].equals("GDEF")) {
String[] pn = new String[] { null, "ttFont" };
- if (isParent (pn)) {
+ if (isParent(pn)) {
assertSubtablesClear();
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("GPOS")) {
+ } else if (en[1].equals("GPOS")) {
String[] pn = new String[] { null, "ttFont" };
- if (isParent (pn)) {
+ if (isParent(pn)) {
assertCoveragesClear();
assertSubtablesClear();
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("GSUB")) {
+ } else if (en[1].equals("GSUB")) {
String[] pn = new String[] { null, "ttFont" };
- if (isParent (pn)) {
+ if (isParent(pn)) {
assertCoveragesClear();
assertSubtablesClear();
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Glyph")) {
+ } else if (en[1].equals("Glyph")) {
String[] pn1 = new String[] { null, "Coverage" };
String[] pn2 = new String[] { null, "InputCoverage" };
String[] pn3 = new String[] { null, "LookAheadCoverage" };
@@ -820,32 +820,32 @@ public class TTXFile {
String[] pn8 = new String[] { null, "BaseCoverage" };
String[] pn9 = new String[] { null, "LigatureCoverage" };
String[][] pnx = new String[][] { pn1, pn2, pn3, pn4, pn5, pn6, pn7, pn8, pn9 };
- if (isParent (pnx)) {
- String value = attrs.getValue ("value");
+ if (isParent(pnx)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- int gid = mapGlyphId (value, en);
- coverageEntries.add (Integer.valueOf (gid));
+ int gid = mapGlyphId(value, en);
+ coverageEntries.add(Integer.valueOf(gid));
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("GlyphClassDef")) {
+ } else if (en[1].equals("GlyphClassDef")) {
String[] pn = new String[] { null, "GDEF" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -858,62 +858,62 @@ public class TTXFile {
stFormat = sf;
assert glyphClasses.isEmpty();
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("GlyphID")) {
+ } else if (en[1].equals("GlyphID")) {
String[] pn = new String[] { null, "GlyphOrder" };
- if (isParent (pn)) {
- String id = attrs.getValue ("id");
+ if (isParent(pn)) {
+ String id = attrs.getValue("id");
int gid = -1;
if (id == null) {
- missingRequiredAttribute (en, "id");
+ missingRequiredAttribute(en, "id");
} else {
- gid = Integer.parseInt (id);
+ gid = Integer.parseInt(id);
}
- String name = attrs.getValue ("name");
+ String name = attrs.getValue("name");
if (name == null) {
- missingRequiredAttribute (en, "name");
+ missingRequiredAttribute(en, "name");
}
- if (glyphIds.containsKey (name)) {
- duplicateGlyph (en, name, gid);
+ if (glyphIds.containsKey(name)) {
+ duplicateGlyph(en, name, gid);
} else {
if (gid > glyphIdMax) {
glyphIdMax = gid;
}
- glyphIds.put (name, gid);
+ glyphIds.put(name, gid);
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("GlyphOrder")) {
+ } else if (en[1].equals("GlyphOrder")) {
String[] pn = new String[] { null, "ttFont" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("InputCoverage")) {
+ } else if (en[1].equals("InputCoverage")) {
String[] pn1 = new String[] { null, "ChainContextSubst" };
String[] pn2 = new String[] { null, "ChainContextPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
int ci = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- ci = Integer.parseInt (index);
+ ci = Integer.parseInt(index);
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -921,107 +921,107 @@ public class TTXFile {
ctIndex = ci;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("LangSys")) {
+ } else if (en[1].equals("LangSys")) {
String[] pn = new String[] { null, "LangSysRecord" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
} else {
assertLanguageFeaturesClear();
}
- } else if (en[1].equals ("LangSysRecord")) {
+ } else if (en[1].equals("LangSysRecord")) {
String[] pn = new String[] { null, "Script" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LangSysTag")) {
+ } else if (en[1].equals("LangSysTag")) {
String[] pn = new String[] { null, "LangSysRecord" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
assert languageTag == null;
languageTag = value;
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigCaretList")) {
+ } else if (en[1].equals("LigCaretList")) {
String[] pn = new String[] { null, "GDEF" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Ligature")) {
+ } else if (en[1].equals("Ligature")) {
String[] pn = new String[] { null, "LigatureSet" };
- if (isParent (pn)) {
- String components = attrs.getValue ("components");
+ if (isParent(pn)) {
+ String components = attrs.getValue("components");
if (components == null) {
- missingRequiredAttribute (en, "components");
+ missingRequiredAttribute(en, "components");
}
- int[] cids = mapGlyphIds (components, en);
- String glyph = attrs.getValue ("glyph");
+ int[] cids = mapGlyphIds(components, en);
+ String glyph = attrs.getValue("glyph");
if (glyph == null) {
- missingRequiredAttribute (en, "glyph");
+ missingRequiredAttribute(en, "glyph");
}
- int gid = mapGlyphId (glyph, en);
- ligatures.add (new Ligature (gid, cids));
+ int gid = mapGlyphId(glyph, en);
+ ligatures.add(new Ligature(gid, cids));
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureAnchor")) {
+ } else if (en[1].equals("LigatureAnchor")) {
String[] pn = new String[] { null, "ComponentRecord" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureArray")) {
+ } else if (en[1].equals("LigatureArray")) {
String[] pn = new String[] { null, "MarkLigPos" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureAttach")) {
+ } else if (en[1].equals("LigatureAttach")) {
String[] pn = new String[] { null, "LigatureArray" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
assert components.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureCoverage")) {
+ } else if (en[1].equals("LigatureCoverage")) {
String[] pn = new String[] { null, "MarkLigPos" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -1029,38 +1029,38 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureSet")) {
+ } else if (en[1].equals("LigatureSet")) {
String[] pn = new String[] { null, "LigatureSubst" };
- if (isParent (pn)) {
- String glyph = attrs.getValue ("glyph");
+ if (isParent(pn)) {
+ String glyph = attrs.getValue("glyph");
if (glyph == null) {
- missingRequiredAttribute (en, "glyph");
+ missingRequiredAttribute(en, "glyph");
}
- int gid = mapGlyphId (glyph, en);
- coverageEntries.add (Integer.valueOf (gid));
+ int gid = mapGlyphId(glyph, en);
+ coverageEntries.add(Integer.valueOf(gid));
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LigatureSubst")) {
+ } else if (en[1].equals("LigatureSubst")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1071,32 +1071,32 @@ public class TTXFile {
assert sf >= 0;
stFormat = sf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LookAheadCoverage")) {
+ } else if (en[1].equals("LookAheadCoverage")) {
String[] pn1 = new String[] { null, "ChainContextSubst" };
String[] pn2 = new String[] { null, "ChainContextPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
int ci = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- ci = Integer.parseInt (index);
+ ci = Integer.parseInt(index);
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -1104,101 +1104,101 @@ public class TTXFile {
ctIndex = ci;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("Lookup")) {
+ } else if (en[1].equals("Lookup")) {
String[] pn = new String[] { null, "LookupList" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
int li = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- li = Integer.parseInt (index);
+ li = Integer.parseInt(index);
}
assertLookupClear();
assert ltIndex == -1;
ltIndex = li;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LookupFlag")) {
+ } else if (en[1].equals("LookupFlag")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
int lf = 0;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- lf = Integer.parseInt (value);
+ lf = Integer.parseInt(value);
}
assert ltFlags == 0;
ltFlags = lf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("LookupList")) {
+ } else if (en[1].equals("LookupList")) {
String[] pn1 = new String[] { null, "GSUB" };
String[] pn2 = new String[] { null, "GPOS" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (! isParent (pnx)) {
- notPermittedInElementContext (en, getParent(), pnx);
+ if (! isParent(pnx)) {
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("LookupListIndex")) {
+ } else if (en[1].equals("LookupListIndex")) {
String[] pn1 = new String[] { null, "Feature" };
String[] pn2 = new String[] { null, "SubstLookupRecord" };
String[] pn3 = new String[] { null, "PosLookupRecord" };
String[][] pnx = new String[][] { pn1, pn2, pn3 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
- String value = attrs.getValue ("value");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
+ String value = attrs.getValue("value");
int v = -1;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- v = Integer.parseInt (value);
+ v = Integer.parseInt(value);
}
String[][] pny = new String[][] { pn2, pn3 };
- if (isParent (pny)) {
+ if (isParent(pny)) {
assert rlLookup == -1;
assert v != -1;
rlLookup = v;
} else {
- featureLookups.add (makeLookupId (v));
+ featureLookups.add(makeLookupId(v));
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("LookupType")) {
+ } else if (en[1].equals("LookupType")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark1Array")) {
+ } else if (en[1].equals("Mark1Array")) {
String[] pn = new String[] { null, "MarkMarkPos" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark1Coverage")) {
+ } else if (en[1].equals("Mark1Coverage")) {
String[] pn = new String[] { null, "MarkMarkPos" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -1206,40 +1206,40 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark2Anchor")) {
+ } else if (en[1].equals("Mark2Anchor")) {
String[] pn = new String[] { null, "Mark2Record" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark2Array")) {
+ } else if (en[1].equals("Mark2Array")) {
String[] pn = new String[] { null, "MarkMarkPos" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark2Coverage")) {
+ } else if (en[1].equals("Mark2Coverage")) {
String[] pn = new String[] { null, "MarkMarkPos" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -1247,52 +1247,52 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Mark2Record")) {
+ } else if (en[1].equals("Mark2Record")) {
String[] pn = new String[] { null, "Mark2Array" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkAnchor")) {
+ } else if (en[1].equals("MarkAnchor")) {
String[] pn = new String[] { null, "MarkRecord" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
}
assert xCoord == Integer.MIN_VALUE;
assert yCoord == Integer.MIN_VALUE;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkArray")) {
+ } else if (en[1].equals("MarkArray")) {
String[] pn1 = new String[] { null, "MarkBasePos" };
String[] pn2 = new String[] { null, "MarkLigPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (! isParent (pnx)) {
- notPermittedInElementContext (en, getParent(), pnx);
+ if (! isParent(pnx)) {
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("MarkAttachClassDef")) {
+ } else if (en[1].equals("MarkAttachClassDef")) {
String[] pn = new String[] { null, "GDEF" };
- if (isParent (pn)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pn)) {
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1305,26 +1305,26 @@ public class TTXFile {
stFormat = sf;
assert glyphClasses.isEmpty();
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkBasePos")) {
+ } else if (en[1].equals("MarkBasePos")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1334,25 +1334,25 @@ public class TTXFile {
assert markAnchors.size() == 0;
assert baseOrMarkAnchors.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkCoverage")) {
+ } else if (en[1].equals("MarkCoverage")) {
String[] pn1 = new String[] { null, "MarkBasePos" };
String[] pn2 = new String[] { null, "MarkLigPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String format = attrs.getValue ("Format");
+ if (isParent(pnx)) {
+ String format = attrs.getValue("Format");
int cf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- cf = Integer.parseInt (format);
+ cf = Integer.parseInt(format);
switch (cf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, cf);
+ unsupportedFormat(en, cf);
break;
}
}
@@ -1360,26 +1360,26 @@ public class TTXFile {
ctIndex = 0;
ctFormat = cf;
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("MarkLigPos")) {
+ } else if (en[1].equals("MarkLigPos")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1389,26 +1389,26 @@ public class TTXFile {
assert markAnchors.size() == 0;
assert ligatureAnchors.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkMarkPos")) {
+ } else if (en[1].equals("MarkMarkPos")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1418,38 +1418,38 @@ public class TTXFile {
assert markAnchors.size() == 0;
assert baseOrMarkAnchors.size() == 0;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("MarkRecord")) {
+ } else if (en[1].equals("MarkRecord")) {
String[] pn1 = new String[] { null, "MarkArray" };
String[] pn2 = new String[] { null, "Mark1Array" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("MultipleSubst")) {
+ } else if (en[1].equals("MultipleSubst")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1457,27 +1457,27 @@ public class TTXFile {
assert sf >= 0;
stFormat = sf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("PairPos")) {
+ } else if (en[1].equals("PairPos")) {
String[] pn = new String[] { null, "Lookup" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
- String format = attrs.getValue ("Format");
+ String format = attrs.getValue("Format");
int sf = -1;
if (format == null) {
- missingRequiredAttribute (en, "Format");
+ missingRequiredAttribute(en, "Format");
} else {
- sf = Integer.parseInt (format);
+ sf = Integer.parseInt(format);
switch (sf) {
case 1:
case 2:
break;
default:
- unsupportedFormat (en, sf);
+ unsupportedFormat(en, sf);
break;
}
}
@@ -1485,171 +1485,171 @@ public class TTXFile {
assert sf >= 0;
stFormat = sf;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("PairSet")) {
+ } else if (en[1].equals("PairSet")) {
String[] pn = new String[] { null, "PairPos" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
int psi = -1;
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- psi = Integer.parseInt (index);
+ psi = Integer.parseInt(index);
}
assert psIndex == -1;
psIndex = psi;
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("PairValueRecord")) {
+ } else if (en[1].equals("PairValueRecord")) {
String[] pn = new String[] { null, "PairSet" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
assertPairClear();
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("PosLookupRecord")) {
+ } else if (en[1].equals("PosLookupRecord")) {
String[] pn1 = new String[] { null, "ChainContextSubst" };
String[] pn2 = new String[] { null, "ChainContextPos" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String index = attrs.getValue ("index");
+ if (isParent(pnx)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("ReqFeatureIndex")) {
+ } else if (en[1].equals("ReqFeatureIndex")) {
String[] pn1 = new String[] { null, "DefaultLangSys" };
String[] pn2 = new String[] { null, "LangSys" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String value = attrs.getValue ("value");
+ if (isParent(pnx)) {
+ String value = attrs.getValue("value");
int v = -1;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- v = Integer.parseInt (value);
+ v = Integer.parseInt(value);
}
String fid;
if ((v >= 0) && (v < 65535)) {
- fid = makeFeatureId (v);
+ fid = makeFeatureId(v);
} else {
fid = null;
}
assertLanguageFeaturesClear();
- languageFeatures.add (fid);
+ languageFeatures.add(fid);
} else {
- notPermittedInElementContext (en, getParent(), pnx);
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("Script")) {
+ } else if (en[1].equals("Script")) {
String[] pn = new String[] { null, "ScriptRecord" };
- if (! isParent (pn)) {
- notPermittedInElementContext (en, getParent(), pn);
+ if (! isParent(pn)) {
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("ScriptList")) {
+ } else if (en[1].equals("ScriptList")) {
String[] pn1 = new String[] { null, "GSUB" };
String[] pn2 = new String[] { null, "GPOS" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (! isParent (pnx)) {
- notPermittedInElementContext (en, getParent(), pnx);
+ if (! isParent(pnx)) {
+ notPermittedInElementContext(en, getParent(), pnx);
}
- } else if (en[1].equals ("ScriptRecord")) {
+ } else if (en[1].equals("ScriptRecord")) {
String[] pn = new String[] { null, "ScriptList" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("ScriptTag")) {
+ } else if (en[1].equals("ScriptTag")) {
String[] pn = new String[] { null, "ScriptRecord" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
assert scriptTag == null;
scriptTag = value;
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("SecondGlyph")) {
+ } else if (en[1].equals("SecondGlyph")) {
String[] pn = new String[] { null, "PairValueRecord" };
- if (isParent (pn)) {
- String value = attrs.getValue ("value");
+ if (isParent(pn)) {
+ String value = attrs.getValue("value");
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
} else {
- int gid = mapGlyphId (value, en);
+ int gid = mapGlyphId(value, en);
assert g2 == -1;
g2 = gid;
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("Sequence")) {
+ } else if (en[1].equals("Sequence")) {
String[] pn = new String[] { null, "MultipleSubst" };
- if (isParent (pn)) {
- String index = attrs.getValue ("index");
+ if (isParent(pn)) {
+ String index = attrs.getValue("index");
if (index == null) {
- missingRequiredAttribute (en, "index");
+ missingRequiredAttribute(en, "index");
} else {
- int i = Integer.parseInt (index);
+ int i = Integer.parseInt(index);
if (i != subtableEntries.size()) {
- invalidIndex (en, i, subtableEntries.size());
+ invalidIndex(en, i, subtableEntries.size());
}
}
} else {
- notPermittedInElementContext (en, getParent(), pn);
+ notPermittedInElementContext(en, getParent(), pn);
}
- } else if (en[1].equals ("SequenceIndex")) {
+ } else if (en[1].equals("SequenceIndex")) {
String[] pn1 = new String[] { null, "PosLookupRecord" };
String[] pn2 = new String[] { null, "SubstLookupRecord" };
String[][] pnx = new String[][] { pn1, pn2 };
- if (isParent (pnx)) {
- String value = attrs.getValue ("value");
+ if (isParent(pnx)) {
+ String value = attrs.getValue("value");
int v = -1;
if (value == null) {
- missingRequiredAttribute (en, "value");
+ missingRequiredAttribute(en, "value");
[... 2137 lines stripped ...]
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org