public override bool Equals(Object obj) { if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } else { FontFaceStyle p = (FontFaceStyle)obj; return((FaceName.ToLowerInvariant() == p.FaceName.ToLowerInvariant()) && (Style == p.Style)); } }
private string getFileName(FontFaceStyle fs) { string prefixFileName = getPrefixFileName(fs.FaceName); switch (fs.Style) { case (FontStyle.Italic | FontStyle.Bold): prefixFileName += "bi"; break; case (FontStyle.Bold): prefixFileName += "bd"; break; case (FontStyle.Italic): prefixFileName += "i"; break; } return(prefixFileName); }
public string GetFontPath(string face, FontStyle style) { string faceName = getFaceName(face); FontFaceStyle fs = new FontFaceStyle(faceName, style); string fileFont = getFileName(fs); if (fileFont != null) { fileFont += _trueTypeFileExt; foreach (Uri d in _fontDictionaries) { string fullPath = Path.Combine(d.AbsolutePath, fileFont); if (System.IO.File.Exists(fullPath)) { return(fullPath); } } } return(null); }