// convert value in other unit to this unit public float toUnit(TeXParser parser, float value, TeXUnit otherUnit) throws TeXSyntaxException { if (equals(otherUnit)) { return value; } if (otherUnit.equals(FixedUnit.PT)) { return value / parser.getListener().emToPt(1f); } return otherUnit.toPt(parser, value) / parser.getListener().emToPt(1f); }
// convert value in this unit to other unit public float fromUnit(TeXParser parser, float value, TeXUnit otherUnit) throws TeXSyntaxException { if (equals(otherUnit)) { return value; } if (otherUnit.equals(FixedUnit.PT)) { return parser.getListener().emToPt(value); } return otherUnit.fromPt(parser, parser.getListener().emToPt(value)); }
public void process(TeXParser parser) throws IOException { parser.getListener().getWriteable().write("em"); }
public float fromPt(TeXParser parser, float value) throws TeXSyntaxException { return value / parser.getListener().emToPt(1f); }
public float toPt(TeXParser parser, float value) throws TeXSyntaxException { return parser.getListener().emToPt(value); }
public TeXObjectList string(TeXParser parser) throws IOException { TeXObjectList list = new TeXObjectList(); list.add(parser.getListener().getOther((int) parser.getTabChar())); return list; }