/** * {@inheritDoc} */ public override byte GetFlags(int i) { GlyfCompositeComp c = GetCompositeComp(i); if (c != null) { descriptions.TryGetValue(c.GlyphIndex, out IGlyphDescription gd); return(gd.GetFlags(i - c.FirstIndex)); } return(0); }
/** * {@inheritDoc} */ public override int GetEndPtOfContours(int i) { GlyfCompositeComp c = GetCompositeCompEndPt(i); if (c != null) { descriptions.TryGetValue(c.GlyphIndex, out IGlyphDescription gd); return(gd.GetEndPtOfContours(i - c.FirstContour) + c.FirstIndex); } return(0); }
/** * {@inheritDoc} */ public override short GetYCoordinate(int i) { GlyfCompositeComp c = GetCompositeComp(i); if (c != null && descriptions.TryGetValue(c.GlyphIndex, out IGlyphDescription gd)) { int n = i - c.FirstIndex; int x = gd.GetXCoordinate(n); int y = gd.GetYCoordinate(n); short y1 = (short)c.ScaleY(x, y); y1 += (short)c.YTranslate; return(y1); } return(0); }
/** * Constructor. * * @param bais the stream to be read * @param glyphTable the Glyphtable containing all glyphs * @ is thrown if something went wrong */ public GlyfCompositeDescript(TTFDataStream bais, GlyphTable glyphTable) : base((short)-1, bais) { this.glyphTable = glyphTable; // Get all of the composite components GlyfCompositeComp comp; do { comp = new GlyfCompositeComp(bais); components.Add(comp); }while ((comp.Flags & GlyfCompositeComp.MORE_COMPONENTS) != 0); // Are there hinting instructions to read? if ((comp.Flags & GlyfCompositeComp.WE_HAVE_INSTRUCTIONS) != 0) { ReadInstructions(bais, (bais.ReadUnsignedShort())); } InitDescriptions(); }