Issue #484 Advance fixed for DefineFont2

This commit is contained in:
Jindra Petk
2014-01-15 07:19:42 +01:00
parent ba3bbc9710
commit 4b74c6f943
2 changed files with 2 additions and 2 deletions

View File

@@ -373,7 +373,7 @@ public class DefineText2Tag extends TextTag implements DrawableTag {
if (nextChar != null) {
kerningAdjustment = font.getGlyphKerningAdjustment(tags, tr.glyphEntries[i].glyphIndex, font.charToGlyph(tags, nextChar));
}
advance = (int) Math.round(20.0 * Math.round((double) textHeight * (font.getGlyphAdvance(tr.glyphEntries[i].glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0)));
advance = (int) Math.round(font.getDivider() * Math.round((double) textHeight * (font.getGlyphAdvance(tr.glyphEntries[i].glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0)));
} else {
advance = (int) Math.round(20.0 * FontTag.getSystemFontAdvance(fontName, font.getFontStyle(), textHeight / 20, c, nextChar));
}

View File

@@ -373,7 +373,7 @@ public class DefineTextTag extends TextTag implements DrawableTag {
if (nextChar != null) {
kerningAdjustment = font.getGlyphKerningAdjustment(tags, tr.glyphEntries[i].glyphIndex, font.charToGlyph(tags, nextChar));
}
advance = (int) Math.round(20.0 * Math.round((double) textHeight * (font.getGlyphAdvance(tr.glyphEntries[i].glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0)));
advance = (int) Math.round(font.getDivider() * Math.round((double) textHeight * (font.getGlyphAdvance(tr.glyphEntries[i].glyphIndex) + kerningAdjustment) / (font.getDivider() * 1024.0)));
} else {
advance = (int) Math.round(20.0 * FontTag.getSystemFontAdvance(fontName, font.getFontStyle(), textHeight / 20, c, nextChar));
}