static Typefaces GetGlobalTypefaces() { var reader = new OpenFontReader(); Typeface LoadFont(string fileName) { var typeface = reader.Read( System.Reflection.Assembly.GetExecutingAssembly() .GetManifestResourceStream($"CSharpMath.Rendering.Reference_Fonts.{fileName}") ); if (typeface == null) { throw new Structures.InvalidCodePathException("Invalid predefined font!"); } typeface.UpdateAllCffGlyphBounds(); return(typeface); } var globalTypefaces = new Typefaces(LoadFont("latinmodern-math.otf")); globalTypefaces.AddOverride(LoadFont("AMS-Capital-Blackboard-Bold.otf")); globalTypefaces.AddSupplement(LoadFont("cyrillic-modern-nmr10.otf")); return(globalTypefaces); }
static Fonts() { var reader = new OpenFontReader(); Typeface LoadFont(string fileName) { var typeface = reader.Read( System.Reflection.Assembly.GetExecutingAssembly() .GetManifestResourceStream($"CSharpMath.Rendering.Reference_Fonts.{fileName}") ); typeface.UpdateAllCffGlyphBounds(); return(typeface); } GlobalTypefaces = new Typefaces(LoadFont("latinmodern-math.otf")); GlobalTypefaces.AddOverride(LoadFont("AMS-Capital-Blackboard-Bold.otf")); GlobalTypefaces.AddSupplement(LoadFont("cyrillic-modern-nmr10.otf")); }