示例#1
0
 DWrite.Font GetFont(FontFace face)
 {
     DWrite.Font result;
     if (engine.customCollection.GetFontFromFontFace(face, out result))
     {
         return(result);
     }
     return(fontCollection.GetFontFromFontFace(face));
 }
示例#2
0
        uint FontHash(FontFace face, float size)
        {
            var font  = fontCollection.GetFontFromFontFace(face);
            var name  = font.FontFamily.FamilyNames.GetString(0);
            var name2 = font.FaceNames.GetString(0);

            unchecked
            {
                int hash = 17;
                hash = hash * 31 + name.GetHashCode();
                hash = hash * 31 + name2.GetHashCode();
                hash = hash * 31 + size.GetHashCode();
                return((uint)hash);
            }
        }