Manolo,

Tried this patch, seems to have fixed the text anti-aliasing on  
10.4.11, as you said. Thanks.

I had a bit of a struggle getting this to apply - the patch seems to  
have been molested in the mail so I had to unwrap a lot of the lines  
by hand...


On 9 Dec 2009, at 23:36, manolo gouy wrote:
>
> Ian: you are right, you get non-antialiased text on 10.4. This is
> something I overlooked because it does not happen on >= 10.5.
> But it's easy to repair, apply this patch (as an svn diff)
> to fl_font_mac.cxx.
> (This is a patch to put in the svn, not something only for Ian)
>
> svn diff fl_font_mac.cxx
> Index: fl_font_mac.cxx
> ===================================================================
> --- fl_font_mac.cxx   (revision 6958)
> +++ fl_font_mac.cxx   (working copy)
> @@ -485,8 +485,14 @@
>    ATSUSetLayoutControls(layout, 1, &iTag, &iSize, &iValuePtr);
>
>    err = ATSUSetTextPointerLocation(layout, uniStr,
> kATSUFromTextBeginning, n, n);
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, true);
> +#endif
>    err = ATSUDrawText(layout, kATSUFromTextBeginning, n,  
> FloatToFixed(x),
> FloatToFixed(y));
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, false);
>  #endif
> +#endif
>  #if defined(__APPLE_COCOA__) && MAC_OS_X_VERSION_MAX_ALLOWED >=
> MAC_OS_X_VERSION_10_5
>    }
>  #endif
> @@ -520,7 +526,13 @@
>    ATSUSetLayoutControls(layout, 2, iTag, iSize, aAttr);
>
>    err = ATSUSetTextPointerLocation(layout, uniStr,
> kATSUFromTextBeginning, n, n);
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, true);
> +#endif
>    err = ATSUDrawText(layout, kATSUFromTextBeginning, n,  
> FloatToFixed(x),
> FloatToFixed(y));
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, false);
> +#endif
>    //restore layout baseline
>    ang = IntToFixed(0);
>    ATSUSetLayoutControls(layout, 2, iTag, iSize, aAttr);
> @@ -553,8 +565,14 @@
>    ATSUSetLayoutControls (layout, 2, iTag, iSize, aAttr );
>
>    err = ATSUSetTextPointerLocation(layout, uniStr,
> kATSUFromTextBeginning, n, n);
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, true);
> +#endif
>    err = ATSUDrawText(layout, kATSUFromTextBeginning, n,
> FloatToFixed(x-offs), FloatToFixed(y));
> +#if defined(__APPLE_COCOA__)
> +  CGContextSetShouldAntialias(fl_gc, false);
>  #endif
> +#endif
>  #if defined(__APPLE_COCOA__) && MAC_OS_X_VERSION_MAX_ALLOWED >=
> MAC_OS_X_VERSION_10_5
>    }
>  #endif

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to