diff options
author | Silenio Quarti <silenio> | 2009-05-26 17:46:15 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2009-05-26 17:46:15 +0000 |
commit | 4639b469833e6c587d0fdc59a6b4bc4e0f22829d (patch) | |
tree | 40ec45b9f2a5e4ea5eaa3ad46867e5b1847e701f /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse | |
parent | f602cc2c14458912fb3a704dde54c81cd25d71de (diff) | |
download | eclipse.platform.swt-4639b469833e6c587d0fdc59a6b4bc4e0f22829d.tar.gz eclipse.platform.swt-4639b469833e6c587d0fdc59a6b4bc4e0f22829d.tar.xz eclipse.platform.swt-4639b469833e6c587d0fdc59a6b4bc4e0f22829d.zip |
277437 - [Cocoa] GC#drawText font background issue
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java | 1 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java index ff87b982a4..b432b11234 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java @@ -299,6 +299,7 @@ void init(String name, float height, int style, String nsName) { } else { NSString family = NSString.stringWith(name); NSFont nsFont = NSFont.fontWithName(family, size); + if (nsFont == null) nsFont = NSFont.systemFontOfSize(size); NSFontManager manager = NSFontManager.sharedFontManager(); if (nsFont != null) { if ((style & (SWT.BOLD | SWT.ITALIC)) == 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java index 3af27f92a6..45686e0eea 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java @@ -1619,6 +1619,16 @@ public void drawText (String string, int x, int y, int flags) { NSAutoreleasePool pool = checkGC(CLIPPING | TRANSFORM | FONT); try { handle.saveGraphicsState(); + boolean mode = true; + switch (data.textAntialias) { + case SWT.DEFAULT: + /* Printer is off by default */ + if (!handle.isDrawingToScreen()) mode = false; + break; + case SWT.OFF: mode = false; break; + case SWT.ON: mode = true; break; + } + handle.setShouldAntialias(mode); NSAttributedString str = createString(string, flags, true); if ((flags & SWT.DRAW_TRANSPARENT) == 0) { NSSize size = str.size(); |