> Hi,
>
> here is a fix which corrects the RTFConsumer to return the correct font for
> composite fontNames such as Futura-Light or Futura-Book.
Hmmm.
What about taking a completely different approach in the method, and
instead doing a
[NSFont fontWithName: fontName size: fontSize];
(which automatically parses fontName properly etc) and then patching up
the font by adding the traits NSBoldFontMask or NSItalicFontMask if
required ?
Something like
- (NSFont*) currentFont
{
NSFontManager *fm = [NSFontManager sharedFontManager];
NSFont *font;
// int weight;
font = [NSFont fontWithName: fontName size: fontSize];
if (font == nil)
{
NSDebugMLLog(@"RTFParser",
@"Could not find font %@ size %f ", fontName, fontSize);
font = [NSFont userFontOfSize: fontSize];
}
if (bold)
{
// weight = 9;
font = [fm convertFont: font toHaveTrait: NSBoldFontMask];
}
else
{
// weight = 5;
font = [fm convertFont: font toNotHaveTrait: NSBoldFontMask];
}
if (italic)
{
font = [fm convertFont: font toHaveTrait: NSItalicFontMask];
}
else
{
font = [fm convertFont: font toNotHaveTrait: NSItalicFontMask];
}
return font;
}
Do you think that would be fine ? It works for me, does it work for you ?
I'd much prefer this solution if it's Ok for you.
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep