예제 #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;
            }
        }
예제 #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;
            }
        }