PdfSharp.Fonts.OpenType.GlyphDataTable.AddCompositeGlyphs C# (CSharp) Method

AddCompositeGlyphs() public method

If the specified glyph is a composite glyph add the glyphs it is made of to the glyph table.
public AddCompositeGlyphs ( object>.Dictionary glyphs, int glyph ) : void
glyphs object>.Dictionary
glyph int
return void
    void AddCompositeGlyphs(Dictionary<int, object> glyphs, int glyph)
    {
      //int start = this.fontData.loca.GetOffset(glyph);
      int start = GetOffset(glyph);
      // Has no contour?
      if (start == GetOffset(glyph + 1))
        return;
      this.fontData.Position = start;
      int numContours = this.fontData.ReadShort();
      // Is not a composite glyph?
      if (numContours >= 0)
        return;
      this.fontData.SeekOffset(8);
      for (; ; )
      {
        int flags = this.fontData.ReadUFWord();
        int cGlyph = this.fontData.ReadUFWord();
        if (!glyphs.ContainsKey(cGlyph))
          glyphs.Add(cGlyph, null);
        if ((flags & MORE_COMPONENTS) == 0)
          return;
        int offset = (flags & ARG_1_AND_2_ARE_WORDS) == 0 ? 2 : 4;
        if ((flags & WE_HAVE_A_SCALE) != 0)
          offset += 2;
        else if ((flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0)
          offset += 4;
        if ((flags & WE_HAVE_A_TWO_BY_TWO) != 0)
          offset += 8;
        this.fontData.SeekOffset(offset);
      }
    }