Community
Participate
Working Groups
Partial Styling of Ligatures - known problem, currently if you select only part of a ligature and attempt to apply a style to it, the caret positioning/rendering for the ligature gets messed up. Need to talk to bidi folks about how to handle this. Word Pad actually renders the ligature as its parts when this is done. Unable to apply the scenario in PageDesigner. NOTES: MA (06/09/2001 18:08:14) The Arabic experts have expressed their preference that, in such a case, the scope of the style application be extended to include all characters forming the ligature. LK (04/10/2001 16:54:16) Due to line style listeners we would need to do this during the getLineStyleData callback. Need to check the beginning and end of each style range to see if it is in a ligature. Code something like the following. Waiting until bidiColoring code pulled out since this code calls getLineStyleData excessively. if (isListening(LineGetStyle)) { StyledTextEvent event = new StyledTextEvent(content); event.detail = lineOffset; event.text = line; notifyListeners(LineGetStyle, event); if (event.styles == null) { event.styles = new StyleRange[0]; } if (isBidi()) { GC gc = new GC(this); if (StyledTextBidi.isLigated(gc)) { for (int i=0; i<event.styles.length; i++) { StyleRange range = event.styles[i]; int relativeStart = range.start - lineOffset; StyledTextBidi bidi = new StyledTextBidi(gc, tabWidth, line, null, null, getStyleOffsets(line, lineOffset, event.styles)); int startLigature = bidi.getLigatureStartOffset(relativeStart); if (startLigature != relativeStart) { range.start = range.start - (relativeStart - startLigature); range.length = range.length + (relativeStart - startLigature); } int rangeEnd = range.start + range.length; int relativeEnd = rangeEnd - lineOffset - 1; int endLigature = bidi.getLigatureEndOffset(relativeEnd); if (endLigature != relativeEnd) range.length = range.length + (endLigature - relativeEnd); } } gc.dispose(); } return event; }
PRODUCT VERSION: 2.006
Changed getLineStyleData method to check if the font supports ligatures and if so to check for partially styled ligatures and apply the style to the entire ligature.