DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2221
Version: 1.3-feature
Fix Version: 1.3.0 (r6951)


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


Link: http://www.fltk.org/str.php?L2221
Version: 1.3-feature
Fix Version: 1.3.0 (r6951)

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to