示例#1
0
 public KerningPair(uint firstGlyph, GlyphValueRecord firstGlyphAdjustments, uint secondGlyph, GlyphValueRecord secondGlyphAdjustments)
 {
     m_FirstGlyph             = firstGlyph;
     m_FirstGlyphAdjustments  = firstGlyphAdjustments;
     m_SecondGlyph            = secondGlyph;
     m_SecondGlyphAdjustments = secondGlyphAdjustments;
 }
示例#2
0
        public KerningPair()
        {
            m_FirstGlyph            = 0;
            m_FirstGlyphAdjustments = new GlyphValueRecord();

            m_SecondGlyph            = 0;
            m_SecondGlyphAdjustments = new GlyphValueRecord();
        }
示例#3
0
        /// <summary>
        /// Add Glyph pair adjustment record
        /// </summary>
        /// <param name="firstGlyph">The first glyph</param>
        /// <param name="firstGlyphAdjustments">Adjustment record for the first glyph</param>
        /// <param name="secondGlyph">The second glyph</param>
        /// <param name="secondGlyphAdjustments">Adjustment record for the second glyph</param>
        /// <returns></returns>
        public int AddGlyphPairAdjustmentRecord(uint first, GlyphValueRecord firstAdjustments, uint second, GlyphValueRecord secondAdjustments)
        {
            int index = kerningPairs.FindIndex(item => item.firstGlyph == first && item.secondGlyph == second);

            if (index == -1)
            {
                kerningPairs.Add(new KerningPair(first, firstAdjustments, second, secondAdjustments));
                return(0);
            }

            // Return -1 if Kerning Pair already exists.
            return(-1);
        }