コード例 #1
0
ファイル: FamilyCollection.cs プロジェクト: qcjxberin/MPF
 public bool TryFindGlyph(uint code, out GlyphFace glyph)
 {
     foreach (var face in FontFaces)
     {
         var theGlyph = FindGlyph(face, code);
         if (theGlyph != null)
         {
             glyph = theGlyph;
             return(true);
         }
     }
     glyph = null;
     return(false);
 }
コード例 #2
0
ファイル: FontFamily.cs プロジェクト: qcjxberin/MPF
        internal GlyphFace FindGlyph(uint code)
        {
            GlyphFace glyph = null;

            for (int i = 0; i < _familyIdentifier.TokenCount; i++)
            {
                try
                {
                    var fontFace = LookupFontFamily(_familyIdentifier[i]);
                    if (fontFace?.TryFindGlyph(code, out glyph) ?? false)
                    {
                        break;
                    }
                }
                catch { }
            }
            return(glyph);
        }