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; }
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); }