Hi;
When a user gives us a font not installed on the system (from a Word
document created on another system that does have the font) we get:
System.Drawing.Font fnt = new System.Drawing.Font("'Berlin Sans FB Demi",
11.0, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
java.lang.IllegalArgumentException: Font 'Berlin Sans FB Demi' does not
support
style 'Regular'.
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize,
FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font.<init>(String familyName, Single emSize, FontStyle
style, GraphicsUnit unit)
How should we handle this? We need to get font metrics that are at least
close - we can't throw an exception and give up.

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Walter Wang [MSFT] - 28 Sep 2007 05:55 GMT
Hi Dave,
In your other post about CultureInfo, I've just made a reply and posted
some C++ code to check if a font is installed.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 28 Sep 2007 17:34 GMT
Hi;
Any suggestions on how to pick a substitute font in this case? Or is there
no way to know and I should just use Times New Roman?

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> Hi Dave,
>
[quoted text clipped - 11 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 03 Oct 2007 03:28 GMT
Hi Dave,
Sorry for late reply.
My suggestion would be just first check if the font is installed or not, if
not, then fall back to the default dialog font (which should handle font
substitution correctly).
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 03 Oct 2007 16:48 GMT
Good suggestion - will do.

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> Hi Dave,
>
[quoted text clipped - 14 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.