Inheritance: IDisposable
Exemplo n.º 1
0
 public TextureFontFace(FontFace nOpenTypeFontFace, string xmlFontInfo, GlyphImage glyphImg)
 {
     //for msdf font
     //1 font atlas may support mutliple font size 
     atlasBuilder = new SimpleFontAtlasBuilder();
     fontAtlas = atlasBuilder.LoadFontInfo(xmlFontInfo);
     fontAtlas.TotalGlyph = glyphImg;
     this.nOpenTypeFontFace = nOpenTypeFontFace; 
 }
Exemplo n.º 2
0
        public WinGdiFontFace(string fontName, FontStyle style)
        {
            this.style = style;
            InstalledFontStyle installedStyle = InstalledFontStyle.Regular;
            switch (style)
            {
                default: break;
                case FontStyle.Bold:
                    installedStyle = InstalledFontStyle.Bold;
                    break;
                case FontStyle.Italic:
                    installedStyle = InstalledFontStyle.Italic;
                    break;
                case FontStyle.Bold | FontStyle.Italic:
                    installedStyle = InstalledFontStyle.Italic;
                    break;
            }

            InstalledFont foundInstalledFont = s_installedFonts.GetFont(fontName, installedStyle);
            //TODO: review 
            this.nopenTypeFontFace = NOpenTypeFontLoader.LoadFont(foundInstalledFont.FontPath, "en", HBDirection.HB_DIRECTION_LTR);
        }