Browse Source

FOP-3102: Move composite glyphs to the end

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1904868 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_8
Simon Steiner 1 year ago
parent
commit
07c10456a3

+ 4
- 4
fop-core/src/main/java/org/apache/fop/fonts/truetype/GlyfTable.java View File

private final FontFileReader in; private final FontFileReader in;


/** All the composite glyphs that appear in the subset. */ /** All the composite glyphs that appear in the subset. */
private Set<Integer> compositeGlyphs = new TreeSet<Integer>();
protected Set<Integer> compositeGlyphs = new TreeSet<Integer>();


/** All the glyphs that are composed, but do not appear in the subset. */ /** All the glyphs that are composed, but do not appear in the subset. */
protected Set<Integer> composedGlyphs = new TreeSet<Integer>(); protected Set<Integer> composedGlyphs = new TreeSet<Integer>();
this.in = in; this.in = in;
} }


private static enum GlyfFlags {
public enum GlyfFlags {


ARG_1_AND_2_ARE_WORDS(4, 2), ARG_1_AND_2_ARE_WORDS(4, 2),
ARGS_ARE_XY_VALUES, ARGS_ARE_XY_VALUES,
* @param flags the glyph data flags * @param flags the glyph data flags
* @return offset to the next glyph if any, or 0 * @return offset to the next glyph if any, or 0
*/ */
static int getOffsetToNextComposedGlyf(int flags) {
public static int getOffsetToNextComposedGlyf(int flags) {
int offset = 0; int offset = 0;
for (GlyfFlags flag : GlyfFlags.values()) { for (GlyfFlags flag : GlyfFlags.values()) {
offset += (flags & flag.bitMask) > 0 ? flag.argsCountIfSet : flag.argsCountIfNotSet; offset += (flags & flag.bitMask) > 0 ? flag.argsCountIfSet : flag.argsCountIfNotSet;
* @param flags the glyph data flags * @param flags the glyph data flags
* @return true if there is another composed glyph, otherwise false. * @return true if there is another composed glyph, otherwise false.
*/ */
static boolean hasMoreComposites(int flags) {
public static boolean hasMoreComposites(int flags) {
return (flags & MORE_COMPONENTS.bitMask) > 0; return (flags & MORE_COMPONENTS.bitMask) > 0;
} }
} }

Loading…
Cancel
Save