diff options
author | Silenio Quarti <silenio> | 2002-12-06 01:16:31 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2002-12-06 01:16:31 +0000 |
commit | 3d28a1173132af3b3240878eef7d2d280f89e91e (patch) | |
tree | aa2dce6637a006563db7df9807e0cc88b2ce6bc5 | |
parent | e5c24fee9ab626fb723a2851128eb43c4c4354b2 (diff) | |
download | eclipse.platform.swt-3d28a1173132af3b3240878eef7d2d280f89e91e.tar.gz eclipse.platform.swt-3d28a1173132af3b3240878eef7d2d280f89e91e.tar.xz eclipse.platform.swt-3d28a1173132af3b3240878eef7d2d280f89e91e.zip |
*** empty log message ***
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index 9899f6f448..8adb409ee8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -1240,7 +1240,10 @@ public FontMetrics getFontMetrics() { fm.ascent = info.ascent; fm.descent = info.descent; fm.leading = info.leading; - fm.averageCharWidth = info.widMax / 2; + /* This code is intentionaly comment. Not right for fixed width fonts. */ + //fm.averageCharWidth = info.widMax / 3; + String s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + fm.averageCharWidth = stringExtent(s).x / s.length(); fm.height = fm.ascent + fm.descent; return fm; } |