public OpenFontStore() { installFontCollection = InstalledFontCollection.GetSharedFontCollection(fontCollection => { fontCollection.SetFontNameDuplicatedHandler((f0, f1) => FontNameDuplicatedDecision.Skip); fontCollection.LoadSystemFonts(); }); _defaultFontNotFoundHandler = (fontCollection, fontName, subfamName, style) => { //TODO: implement font not found mapping here //_fontsMapping["monospace"] = "Courier New"; //_fontsMapping["Helvetica"] = "Arial"; fontName = fontName.ToUpper(); switch (fontName) { case "MONOSPACE": return(fontCollection.GetFont("Courier New", style)); case "HELVETICA": return(fontCollection.GetFont("Arial", style)); case "TAHOMA": //default font must found //if not throw err //this prevent infinit loop throw new System.NotSupportedException(); default: return(fontCollection.GetFont("tahoma", style)); } }; }
public void SetFontNotFoundHandler(FontNotFoundHandler fontNotFoundHandler) { this.fontNotFoundHandler = fontNotFoundHandler; }
public void SetFontNotFoundHandler(FontNotFoundHandler fontNotFoundHandler) { installFontCollection.SetFontNotFoundHandler(fontNotFoundHandler); }
public static void SetFontNotFoundHandler(FontNotFoundHandler fontNotFoundHandler) { s_installFontCollection.SetFontNotFoundHandler(fontNotFoundHandler); }
public void SetFontNotFoundHandler(FontNotFoundHandler handler) { fontNotFoundHandler = handler; }
public void SetFontNotFoundHandler(FontNotFoundHandler handler) { fontNotFoundHandler = handler; }