Bug 548140

Summary: [win32][StyledText] Hieroglyph causes preceding spaces to change size
Product: [Eclipse Project] Platform Reporter: Alexandr Miloslavskiy <alexandr.miloslavskiy>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: alexandr.miloslavskiy, ts-swt
Version: 4.12   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=536562
Whiteboard:
Attachments:
Description Flags
Repro snippet none

Description Alexandr Miloslavskiy CLA 2019-06-11 06:03:04 EDT
I have debugged it a bit and found out this:
1) 'ScriptItemize' WINAPI allocates spaces preceding the hieroglyphs into the same "run".
2) 'TextLayout.shape' fails, because hieroglyphs are not found in selected font.
3) Fallback font 'Microsoft Sans Serif' is selected.
4) Preceding spaces are using this font, therefore the size is different.

A possible solution:
When "run" is composed of "good" and "bad" characters, split them into separate "runs", so that "good" characters can continue to use non-fallback font.
Comment 1 Alexandr Miloslavskiy CLA 2019-06-11 06:05:39 EDT
Created attachment 278888 [details]
Repro snippet