Exemplo n.º 1
0
        public static void UpdateAllCffGlyphBounds(this Typeface typeface)
        {
            //TODO: review here again,

            if (typeface.IsCffFont && !typeface._evalCffGlyphBounds)
            {
                int j = typeface.GlyphCount;
                CFF.CffEvaluationEngine evalEngine  = new CFF.CffEvaluationEngine();
                CffBoundFinder          boundFinder = new CffBoundFinder();
                for (ushort i = 0; i < j; ++i)
                {
                    Glyph g = typeface.GetGlyphByIndex(i);
                    boundFinder.Reset();

#if DEBUG
                    //if (i == 106 && typeface.Name == "Cyrillic Modern")
                    //{
                    //    CFF.dbugCffInstHelper.dbugDumpInstructionListToFile(
                    //        g._cff1GlyphData.GlyphInstructions,
                    //        "test_106.txt");
                    //}
#endif

                    evalEngine.Run(boundFinder,
                                   g._ownerCffFont,
                                   g._cff1GlyphData.GlyphInstructions);

                    g.Bounds = boundFinder.GetResultBounds();
                }
                typeface._evalCffGlyphBounds = true;
            }
        }
Exemplo n.º 2
0
        public static void UpdateAllCffGlyphBounds(this Typeface typeface)
        {
            //TODO: review here again,

            if (typeface.IsCffFont && !typeface._evalCffGlyphBounds)
            {
                int j = typeface.GlyphCount;
                CFF.CffEvaluationEngine evalEngine  = new CFF.CffEvaluationEngine();
                CffBoundFinder          boundFinder = new CffBoundFinder();
                for (ushort i = 0; i < j; ++i)
                {
#if DEBUG
                    //if (i == 3084)
                    //{

                    //}
#endif
                    Glyph g = typeface.GetGlyphByIndex(i);
                    boundFinder.Reset();

                    evalEngine.Run(boundFinder,
                                   g._ownerCffFont,
                                   g._cff1GlyphData.GlyphInstructions);

                    g.Bounds = boundFinder.GetResultBounds();
                }
                typeface._evalCffGlyphBounds = true;
            }
        }
Exemplo n.º 3
0
        public GlyphPathBuilderBase(Typeface typeface)
        {
            _typeface = typeface;
            this.UseTrueTypeInstructions = true;//default?
            _recentPixelScale            = 1;

            if (typeface.IsCffFont)
            {
                _cffEvalEngine = new CffEvaluationEngine();
            }
        }
 //-----------
 //for CFF1
 public static void Read(this IGlyphTranslator tx, CFF.Cff1Font cff1Font, CFF.Cff1GlyphData glyphData, float scale = 1)
 {
     CFF.CffEvaluationEngine evalEngine = new CFF.CffEvaluationEngine();
     evalEngine.Run(tx, cff1Font, glyphData.GlyphInstructions, scale);
 }