@@ -68,12 +68,23 @@ public XGlyphTypeface(string key, XFontSource fontSource)
68
68
Initialize ( ) ;
69
69
}
70
70
71
+ // ReSharper disable once UnusedMember.Global
72
+ public XGlyphTypeface ( string key , XFontFamily fontFamily , XFontSource fontSource , XStyleSimulations styleSimulations )
73
+ {
74
+ _key = key ;
75
+ _fontFamily = fontFamily ;
76
+ _fontSource = fontSource ;
77
+ _styleSimulations = styleSimulations ;
78
+ _fontface = OpenTypeFontface . CetOrCreateFrom ( fontSource ) ;
79
+
80
+ Initialize ( ) ;
81
+ }
82
+
71
83
public static XGlyphTypeface GetOrCreateFrom ( string familyName , FontResolvingOptions fontResolvingOptions )
72
84
{
73
85
// Check cache for requested type face.
74
86
string typefaceKey = ComputeKey ( familyName , fontResolvingOptions ) ;
75
- XGlyphTypeface glyphTypeface ;
76
- if ( GlyphTypefaceCache . TryGetGlyphTypeface ( typefaceKey , out glyphTypeface ) )
87
+ if ( GlyphTypefaceCache . TryGetGlyphTypeface ( typefaceKey , out var glyphTypeface ) )
77
88
{
78
89
// Just return existing one.
79
90
return glyphTypeface ;
@@ -88,8 +99,7 @@ public static XGlyphTypeface GetOrCreateFrom(string familyName, FontResolvingOpt
88
99
}
89
100
// Now create the font family at the first.
90
101
XFontFamily fontFamily ;
91
- PlatformFontResolverInfo platformFontResolverInfo = fontResolverInfo as PlatformFontResolverInfo ;
92
- if ( platformFontResolverInfo != null )
102
+ if ( fontResolverInfo is PlatformFontResolverInfo platformFontResolverInfo )
93
103
{
94
104
}
95
105
else
0 commit comments