Community
Participate
Working Groups
Please support underline and strikethrough font styles. I understand this isn't easy on all platforms. I would be happy if the styles were ignore on non- Windows platforms.
See also 59514
*** This bug has been marked as a duplicate of 59514 ***
This is a more generic request than the TextLayout API.
Thank you
See also bug 54426.
I am looking for these font styles to be available in many widgets (specifically tables). I believe that adding them to the base Font class would offer that capability. Sorry if I wasn't specific enough in my original description.
This issue gets continually raised since SWT invokes OS dialog for changing font properties. The Windows dialog contains checkbox options for setting underline and strike-out. Either SWT should override the font properties dialog from Windows to reflect it's capabilities, or these should be supported in SWT for Windows only if necessary.
We can't offer underline or strike through as API for fonts in SWT because they are not implemented for fonts on every platform. If we offered them as a hint, application code would fail on non-Windows platforms. We could offer the ability to query these attributes but not to set them. We could also improve TextLayout such that it could draw using these attributes. This is how this functionality is exposed on non-Windows platforms. SSQ?
Underline and strikethrough are provided via StyleRange but not as font style but as separate attributes.
Daniel, please reread comment #8.
*** Bug 124551 has been marked as a duplicate of this bug. ***
*** Bug 154600 has been marked as a duplicate of this bug. ***
Just curious since this often comes up with Mylar users: will it possible to support strikethrough on Linux/GTK in the future? Also, is there a more generic way of setting a strikethrough than the following, should strikethrough start being supported on other platforms? // Windows XP only try { Field dataField = data.getClass().getDeclaredField("data"); Object dataObject = dataField.get(data); Class clazz = dataObject.getClass().getSuperclass(); Field strikeOutFiled = clazz.getDeclaredField("lfStrikeOut"); strikeOutFiled.set(dataObject, (byte) 1); STRIKETHROUGH = new Font(Display.getCurrent(), data); } catch (Throwable t) { // Linux or other platform STRIKETHROUGH = defaultFont; }
Is there any possibility to have transparency support for TextLayout any time soon? I do not fully understand why drawing methods from TextLayout do not use alpha parameters from its associated graphics...
(In reply to comment #14) > Is there any possibility to have transparency support for TextLayout any time > soon? > I do not fully understand why drawing methods from TextLayout do not use alpha > parameters from its associated graphics... TextLayout draws with transparency, call setAlpha on GC before passing it to TextLayout#draw(). I believe this works on all platforms.
(In reply to comment #15) > (In reply to comment #14) > > Is there any possibility to have transparency support for TextLayout any time > > soon? > > I do not fully understand why drawing methods from TextLayout do not use alpha > > parameters from its associated graphics... > > TextLayout draws with transparency, call setAlpha on GC before passing it to > TextLayout#draw(). I believe this works on all platforms. I've tried what you suggested but still couldn't get it working. Actually I've tried the code on Windows and carbon MacOS platforms and it works fine. It looks like it's only a cocoa issue...
(In reply to comment #16) > It looks like it's only a cocoa issue... Enter a new bug report with your test code. We will have a look at it (add me to the cc list). Thank you