示例#1
0
 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));
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }