Skip to content

Commit

Permalink
checkstyle on XPSPageContentHandler updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tballison committed Jan 28, 2025
1 parent 8f7438e commit d3f242b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ private void writeRow(List<GlyphRun> row) throws SAXException {
}

// Returns a new list of glyph runs in a row after splitting any runs with large advances into multiple runs
// This fixes issues where a single run has a large advance and text visually is placed in that gap so should be read in a different order
// This fixes issues where a single run has a large advance and text visually is placed in that gap
// so should be read in a different order
private static List<GlyphRun> splitRow(List<GlyphRun> row) {
List<GlyphRun> newRuns = new ArrayList<>();
for (int j = 0; j < row.size(); j++) {
Expand All @@ -375,7 +376,8 @@ private static List<GlyphRun> splitRow(List<GlyphRun> row) {
// If this is the first glyph use hard coded estimate
width += ESTIMATE_GLYPH_WIDTH;
} else {
// If advance is 0.0 it is probably the last glyph in the run, we don't know how wide it is so we use the average of the previous widths as an estimate
// If advance is 0.0 it is probably the last glyph in the run, we don't know how
// wide it is so we use the average of the previous widths as an estimate
width += width / i;
}
} else {
Expand Down Expand Up @@ -558,7 +560,8 @@ private float width() {
// If this is the first glyph use hard coded estimate
width += ESTIMATE_GLYPH_WIDTH;
} else {
// If advance is 0.0 it is probably the last glyph in the run, we don't know how wide it is so we use the average of the previous widths as an estimate
// If advance is 0.0 it is probably the last glyph in the run, we don't
// know how wide it is so we use the average of the previous widths as an estimate
width += width / i;
}
} else {
Expand All @@ -576,7 +579,8 @@ final static class GlyphIndex {
// private int clusterCodeUnitCount;
// private int clusterGlyphCount;

// The placement of the glyph that follows relative to the origin of the current glyph. Measured as a multiple of the fonts em-size.
// The placement of the glyph that follows relative to the origin of the current
// glyph. Measured as a multiple of the fonts em-size.
// Should be multiplied by the font em-size to get a value that can be compared across GlyphRuns
// Will be zero for the last glpyh in a glyph run
private final float advance;
Expand Down

0 comments on commit d3f242b

Please sign in to comment.