Exemplo n.º 1
0
 internal TMP_GlyphValueRecord(GlyphValueRecord valueRecord)
 {
     m_XPlacement = valueRecord.xPlacement;
     m_YPlacement = valueRecord.yPlacement;
     m_XAdvance   = valueRecord.xAdvance;
     m_YAdvance   = valueRecord.yAdvance;
 }
Exemplo n.º 2
0
 public KerningPair(uint firstGlyph, GlyphValueRecord firstGlyphAdjustments, uint secondGlyph, GlyphValueRecord secondGlyphAdjustments)
 {
     m_FirstGlyph             = firstGlyph;
     m_FirstGlyphAdjustments  = firstGlyphAdjustments;
     m_SecondGlyph            = secondGlyph;
     m_SecondGlyphAdjustments = secondGlyphAdjustments;
 }
Exemplo n.º 3
0
 public KerningPair()
 {
     this.m_FirstGlyph             = 0u;
     this.m_FirstGlyphAdjustments  = default(GlyphValueRecord);
     this.m_SecondGlyph            = 0u;
     this.m_SecondGlyphAdjustments = default(GlyphValueRecord);
 }
Exemplo n.º 4
0
        public KerningPair()
        {
            m_FirstGlyph            = 0;
            m_FirstGlyphAdjustments = new GlyphValueRecord();

            m_SecondGlyph            = 0;
            m_SecondGlyphAdjustments = new GlyphValueRecord();
        }
Exemplo n.º 5
0
        public int AddGlyphPairAdjustmentRecord(uint first, GlyphValueRecord firstAdjustments, uint second, GlyphValueRecord secondAdjustments)
        {
            int num = this.kerningPairs.FindIndex((KerningPair item) => item.firstGlyph == first && item.secondGlyph == second);

            if (num == -1)
            {
                this.kerningPairs.Add(new KerningPair(first, firstAdjustments, second, secondAdjustments));
                return(0);
            }
            return(-1);
        }
Exemplo n.º 6
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);
        }