Community
Participate
Working Groups
Created attachment 126969 [details] My quick solution Build ID: M20080911-1700 Steps To Reproduce: We're building a WYSIWYG editor using Draw2D. I'm missing the possibility of setting TextStyles (or equivalent) on a TextFlow. This would make it possible to use the underline-features (including SWT.UNDERLINE_ERROR for marking text by a spellchecker). I already created a subclass of TextFlow (StyledTextFlow) on which one can add TextStyle objects on a specific range. To apply these TextStyles, I made an override of paintText(), but this method is called with substrings (the fragmented parts) so the offsets given for the TextStyles won't always match. I also added basic support for sub-/superscript, by changing the y-coordinate when drawing the string. This currently has no effect on the line-height, so setting the baseline too high or too low, makes the string (partially) invisible. I could make the necessary changes to the Draw2D source myself, but I don't want to change the Draw2D/GEF plugin, because that would mean extra effort when updating to new releases. More information: Any other enhancement to Draw2D text which enables the rendering of subscript and superscript, and makes it possible to decorate text with SWT.UNDERLINE.ERROR are welcome, obviously.