|Render Problem of AWT loaded TTF file on MacOS [message #648369]
||Wed, 12 January 2011 10:43
| Thomas Fletcher
Registered: July 2009
I'm writing an application that needs to display text with custom TTF fonts. Since until recently there was no SWT support for loading custom TTF we were using AWT to load the font and draw into an image and then transfer that to the display.|
The code looks like:
java.awt.Font f =
.. set attributes for font ..
java.awt.Font f2 = f.deriveFont(<new attributes>);
BufferedImage img = new BufferedImage(..)
java.awt.Graphics gc = img.getGraphics()
This works great on Windows and Linux, but occasionally on Mac (carbon and cocoa) the text will render with a funny A character that looks like a missing glyph to me (with the same font/text combination as on Windows/Linux). Out of a 100 runs of the same app/font/text, this might happen 5 or so times.
Is there some sort of synchronization that I'm missing in using this AWT functionality from SWT on Mac? All of the work is being done in the SWT main thread.
Any insight is welcome, this is a stop ship issue for us on the Mac right now.
Powered by FUDForum
. Page generated in 0.11456 seconds