svn path=/trunk/mcs/; revision=53101
+2005-11-16 Konstantin Triger <kostat@mainsoft.com>
+
+ * FontFamily.jvm.cs: fix for custom font collection
+
2005-11-14 Vladimir Krasnov <vladimirk@mainsoft.com>
* FontFamily.jvm.cs: fixed GetName
2005-11-14 Vladimir Krasnov <vladimirk@mainsoft.com>
* FontFamily.jvm.cs: fixed GetName
}
private readonly string _name;
}
private readonly string _name;
- private readonly FontCollection _fontCollection;
private awt.FontMetrics _fontMetrics = null;
private FontStyle _lastStyle = FontStyle.Regular;
private awt.FontMetrics _fontMetrics = null;
private FontStyle _lastStyle = FontStyle.Regular;
public FontFamily(string name, FontCollection fontCollection) {
if (fontCollection == null)
public FontFamily(string name, FontCollection fontCollection) {
if (fontCollection == null)
- _fontCollection = _installedFonts;
- else
- _fontCollection = fontCollection;
+ fontCollection = _installedFonts;
- if ( !_fontCollection.Contains(name) )
- _name = _genericSansSerif._name;
+ if (fontCollection.Contains(name))
+ _name = name;
+ else {
+ _name = ToGenericFontName(GenericFontFamilies.SansSerif);
+ fontCollection = _installedFonts;
+ }
- _name = name;
- _font = _fontCollection.GetInitialFont( _name );
+ _font = fontCollection.GetInitialFont( _name );
}
public FontFamily(GenericFontFamilies genericFamily) : this(ToGenericFontName(genericFamily)) {
}
public FontFamily(GenericFontFamilies genericFamily) : this(ToGenericFontName(genericFamily)) {