예제 #1
0
 public KerningPair(uint firstGlyph, GlyphValueRecord_Legacy firstGlyphAdjustments, uint secondGlyph, GlyphValueRecord_Legacy secondGlyphAdjustments)
 {
     m_FirstGlyph             = firstGlyph;
     m_FirstGlyphAdjustments  = firstGlyphAdjustments;
     m_SecondGlyph            = secondGlyph;
     m_SecondGlyphAdjustments = secondGlyphAdjustments;
 }
예제 #2
0
 internal TMP_GlyphValueRecord(GlyphValueRecord_Legacy valueRecord)
 {
     m_XPlacement = valueRecord.xPlacement;
     m_YPlacement = valueRecord.yPlacement;
     m_XAdvance   = valueRecord.xAdvance;
     m_YAdvance   = valueRecord.yAdvance;
 }
예제 #3
0
        public KerningPair()
        {
            m_FirstGlyph            = 0;
            m_FirstGlyphAdjustments = new GlyphValueRecord_Legacy();

            m_SecondGlyph            = 0;
            m_SecondGlyphAdjustments = new GlyphValueRecord_Legacy();
        }
예제 #4
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_Legacy firstAdjustments, uint second, GlyphValueRecord_Legacy 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);
        }