Thanks Georg, I applied it (with a small modification to make sure we
first try if we can find the fontname as it is, and only if not we try
reading it as a composite name)
> Hi Nicola,
>
> here is my suggestion for a fix, which corrects the RTFConsumer to return the
> correct font for composite fontNames such as Helvetica-Light or Futura-Book.
> I didn't succeed to implement your approach (using -fontWithName: and then
> patching up the font by adding the traits), because -fontWithName: would return
> nil for a composite fontName, if it doesn't exist (or at least not the desired
> font-family).
>
> Example: If the desired fontName would be Futura-Condensed which is not
> installed, then fontWithName would return nil. By using -fontWithFamily: we
> have at least a font with the desired family. So this approach seems a lot more
> tolerant to me.
Ok - thanks - I agree :-)
> }
>
> ! font = [[NSFontManager sharedFontManager] fontWithFamily: fontFamily
> traits: traits
> weight: weight
> size: fontSize];
> +
> + /* set the typeface for composite names, if it is not correct.
> + */
> + if ( font && range.length
> + && ![[font fontName] rangeOfString:fontName].length )
> + {
> + font = [[NSFontManager sharedFontManager] convertFont:font
> + toFace:fontName];
> + font = [[NSFontManager sharedFontManager] convertFont:font
> + toHaveTrait:traits];
> + }
I wasn't sure about this part, if it was really needed - I didn't add it
yet.
Please let me know if I got it wrong and it's really needed, I'll add it
:-)
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep