示例#1
0
        /// <summary>
        /// build glyph shape from glyph to be read
        /// </summary>
        /// <param name="glyphIndex"></param>
        /// <param name="sizeInPoints"></param>
        public void BuildFromGlyph(Glyph glyph, float sizeInPoints)
        {
            //for true type font
            _outputGlyphPoints = glyph.GlyphPoints;
            _outputContours    = glyph.EndPoints;


            //------------
            //temp fix for Cff Font
            if (glyph.IsCffGlyph)
            {
                _cffGlyphData = glyph.GetCff1GlyphData();
                _ownerCff     = glyph.GetOwnerCff();
            }

            //---------------



            if ((RecentFontSizeInPixels = Typeface.ConvPointsToPixels(sizeInPoints)) < 0)
            {
                //convert to pixel size
                //if size< 0 then set _recentPixelScale = 1;
                //mean that no scaling at all, we use original point value
                _recentPixelScale = 1;
            }
            else
            {
                _recentPixelScale = Typeface.CalculateScaleToPixel(RecentFontSizeInPixels);
                IsSizeChanged     = true;
            }
            //-------------------------------------
            FitCurrentGlyph(glyph);
        }
示例#2
0
 public void Run(IGlyphTranslator tx, Cff1Font cff1Font, Cff1GlyphData glyphData, float scale = 1)
 {
     Run(tx, cff1Font, glyphData.GlyphInstructions, scale);
 }