Methods Summary |
---|
public java.lang.String[] | getG1()
return g1;
|
public java.lang.String[] | getG2()
return g2;
|
public float | getK()
return k;
|
public java.lang.String | getLocalName()
return SVGConstants.SVG_HKERN_TAG;
|
public java.lang.String[] | getRequiredTraits()
return REQUIRED_TRAITS;
|
public java.lang.String | getTraitImpl(java.lang.String name)HKern handles the u1, u2, g1, g2 and k traits.
if (SVGConstants.SVG_U1_ATTRIBUTE == name) {
return unicodeRangeToStringTrait(u1);
} else if (SVGConstants.SVG_U2_ATTRIBUTE == name) {
return unicodeRangeToStringTrait(u2);
} else if (SVGConstants.SVG_G1_ATTRIBUTE == name) {
return toStringTrait(g1);
} else if (SVGConstants.SVG_G2_ATTRIBUTE == name) {
return toStringTrait(g2);
} else if (SVGConstants.SVG_K_ATTRIBUTE == name) {
return Float.toString(k);
} else {
return super.getTraitImpl(name);
}
|
public int[][] | getU1()
return u1;
|
public int[][] | getU2()
return u2;
|
boolean | matches(Glyph glyph, int[][] u, java.lang.String[] g)Checks if the input glyph is a match for the input
set of unicode ranges and/or glyph names.
String gu = glyph.getUnicode();
String[] gg = glyph.getGlyphName();
if (u != null && gu != null && gu.length() == 1) {
char c = gu.charAt(0);
for (int i = 0; i < u.length; i++) {
if (c >= u[i][0] && c <= u[i][1]) {
return true;
}
}
}
if (gg != null && g != null) {
for (int i = 0; i < gg.length; i++) {
String gn = gg[i];
for (int j = 0; j < g.length; j++) {
if (g[j].equals(gn)) {
return true;
}
}
}
}
return false;
|
public boolean | matchesFirst(Glyph g)Checks if the input glyph is a match for u1 or g1.
return matches(g, u1, g1);
|
public boolean | matchesSecond(Glyph g)Checks if the input glyph is a match for u2 or g2.
return matches(g, u2, g2);
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype HKern .
return new HKern(doc);
|
public void | setG1(java.lang.String[] g1)Sets this kerning entry first glyph names matches.
if (equal(g1, this.g1)) {
return;
}
modifyingNode();
this.g1 = g1;
modifiedNode();
|
public void | setG2(java.lang.String[] g2)Sets this kerning entry second glyph names matches.
if (equal(g2, this.g2)) {
return;
}
modifyingNode();
this.g2 = g2;
modifiedNode();
|
public void | setK(float k)Sets this kernixng entry's advance.
if (this.k == k) {
return;
}
modifyingNode();
this.k = k;
modifiedNode();
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)HKern handles the u1, u2, g1, g2 and k traits.
if (SVGConstants.SVG_U1_ATTRIBUTE == name) {
checkWriteLoading(name);
setU1(parseUnicodeRangeTrait(name, value));
} else if (SVGConstants.SVG_U2_ATTRIBUTE == name) {
checkWriteLoading(name);
setU2(parseUnicodeRangeTrait(name, value));
} else if (SVGConstants.SVG_G1_ATTRIBUTE == name) {
checkWriteLoading(name);
setG1(parseStringArrayTrait(name, value, SVGConstants.COMMA_STR));
} else if (SVGConstants.SVG_G2_ATTRIBUTE == name) {
checkWriteLoading(name);
setG2(parseStringArrayTrait(name, value, SVGConstants.COMMA_STR));
} else if (SVGConstants.SVG_K_ATTRIBUTE == name) {
checkWriteLoading(name);
setK(parseFloatTrait(name, value));
} else {
super.setTraitImpl(name, value);
}
|
public void | setU1(int[][] u1)Sets this kerning entry's first match
if (u1 != null) {
for (int i = 0; i < u1.length; i++) {
if (u1[i] == null || u1[i].length != 2) {
throw new IllegalArgumentException();
}
}
}
if (equal(u1, this.u1)) {
return;
}
modifyingNode();
this.u1 = u1;
modifiedNode();
|
public void | setU2(int[][] u2)Sets this kerning entry's second match
if (u2 != null) {
for (int i = 0; i < u2.length; i++) {
if (u2[i] == null || u2[i].length != 2) {
throw new IllegalArgumentException();
}
}
}
if (equal(u2, this.u2)) {
return;
}
modifyingNode();
this.u2 = u2;
modifiedNode();
|
boolean | supportsTrait(java.lang.String traitName)HKern handles the u1, u2, g1, g2 and k traits.
if (SVGConstants.SVG_U1_ATTRIBUTE == traitName
||
SVGConstants.SVG_U2_ATTRIBUTE == traitName
||
SVGConstants.SVG_G1_ATTRIBUTE == traitName
||
SVGConstants.SVG_G2_ATTRIBUTE == traitName
||
SVGConstants.SVG_K_ATTRIBUTE == traitName) {
return true;
}
return super.supportsTrait(traitName);
|