diff options
author | Bogdan Gheorghe <gheorghe> | 2008-05-14 17:11:13 +0000 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe> | 2008-05-14 17:11:13 +0000 |
commit | 238f5073d068c68377683fe890837e5610cfd291 (patch) | |
tree | 9ff83e876623706e8f1e3f006878d0146164ea9c /bundles | |
parent | a0531845de6cc6b13e9665b27cef614e35b4a0db (diff) | |
download | eclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.tar.gz eclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.tar.xz eclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.zip |
226007 BIDI3.4: search results appear shaped improperly
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java index 9be015cf4c..dd2f67119c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java @@ -160,6 +160,7 @@ void computeRuns () { } } int strlen = OS.strlen(ptr); + Font defaultFont = font != null ? font : device.systemFont; for (int i = 0; i < styles.length - 1; i++) { StyleItem styleItem = styles[i]; TextStyle style = styleItem.style; @@ -171,7 +172,7 @@ void computeRuns () { byteStart = Math.min(byteStart, strlen); byteEnd = Math.min(byteEnd, strlen); Font font = style.font; - if (font != null && !font.isDisposed()) { + if (font != null && !font.isDisposed() && !defaultFont.equals(font)) { int /*long*/ attr = OS.pango_attr_font_desc_new (font.handle); OS.memmove (attribute, attr, PangoAttribute.sizeof); attribute.start_index = byteStart; @@ -1763,6 +1764,7 @@ public void setFont (Font font) { if (font != null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); Font oldFont = this.font; if (oldFont == font) return; + freeRuns(); this.font = font; if (oldFont != null && oldFont.equals(font)) return; OS.pango_layout_set_font_description(layout, font != null ? font.handle : device.systemFont.handle); |