Beispiel #1
0
        public override Box CreateBox(TexStyle style)
        {
            var pref   = TEXPreference.main;
            var font   = FontIndex == -2 ? TexUtility.RenderFont : FontIndex;
            var FStyle = FontStyle == TexUtility.FontStyleDefault ? TexUtility.RenderFontStyle : FontStyle;

            if (font >= 0 && !pref.IsCharAvailable(font, Character))
            {
                // It's unicode, do return Unicode
                CharacterInfo info;
                var           c = pref.fontData[font].CreateCharacterDataOnTheFly(Character, TexUtility.SizeFactor(style), out info);
                return(UnicodeBox.Get(c, font, info));
            }
            else
            {
                if (font == -1)
                {
                    //var chSymbol = pref.charMapData[Character, -1];
                    //if (chSymbol == -1)
                    return(CharBox.Get(style, pref.GetCharMetric(Character, style), FStyle));
                }
                else
                {
                    return(CharBox.Get(style, pref.GetCharMetric(font, Character, style), FStyle));
                }
            }
        }
Beispiel #2
0
        public override Box CreateBox(TexStyle style)
        {
            // CharacterInfo ch;
            var           f = TEXPreference.main.fontData[fontIndex];
            CharacterInfo info;
            var           c = f.CreateCharacterDataOnTheFly(charIndex, TexUtility.SizeFactor(style), out info);

            return(UnicodeBox.Get(c, fontIndex, info));
        }