eclipse.platform.swt
eclipse.platform.swt copied to clipboard
Show Print Margin bug for few fonts
I am seeing an unusual behavior with Show Print Margin option when I changed to a other font. I installed external font BIZ UDGothic When I changed default one to this and I select the option preferences-> text editors -> show print margin (80) there is extra padding in editor.
To Reproduce 1] Install BIZ UDGothic font (see attached zip -> download and double click on it -> install) 2] open attached TestRuler.txt file in eclipse (now it will have default font selected in my case Courier New) 3] Go to preferences -> text editors -> select Show print margin (80) 4] Now check the file it having extra padding.
Expected behavior It has to be same behavior like other fonts.
Screenshots See attached screenshots with two fonts.
Environment:
- Select the platform(s) on which the behavior is seen:
-
- Windows (11)
Version since I'm seeing this behavior in Eclipse Committers Version: 2022-03 (4.23.0) Build id: 20220310-1457
Any update on this. Thanks in advance!
Not able to reproduce in latest version of eclipse (windows 10)
Edit : Able to reproduce in Eclipse SDK (Windows 10)
Version: 2023-09 (4.29) Build id: I20230813-1800
provided performing missing step : Change the font to BIZ UDGothic using Preferences > Colors and Fonts
Hello @lathapatil, Thanks for the update. You mean it is working in the 4.28 version? Currently, as an organisation, we are not able to move to a newer version. We are using the 4.23 version, where this issue still persists. Could you please help me with that, or can you give me the class name where this code change was done for this issue so it will be helpful?
Hello @lathapatil , I'm able to reproduce the issue in latest version eclipse(4.28).
Eclipse IDE for Eclipse Committers (includes Incubating components)
Version: 2023-06 (4.28.0) Build id: 20230608-1333
Could you please check? Thanks
Hi @rushi1698 , Even I have checked in the same version of eclipse and downloaded Eclipse IDE for Eclipse Committers . Only difference is Windows version . I am using Windows 10 for testing.
I will try to test it if I can manage to find windows 11 machine.
May be you can debug and check TextEditorDefaultsPreferencePage.java as initial point
Edit : Hello @rushi1698 ,
This issue is reproducible in windows 10 as well . I missed a step here i.e. change the font to BIZ UDGothic using preferences page. May be you can mention this step as well in the steps to reproduce.
I can reproduce this in Eclipse 4.28 with Windows 11.
(I don't know how to fix it, maybe something to do with calculating text metrics)
@Phillipus Thanks for confirming. @lathapatil I tried on Windows 10 with the latest version of Eclipse, but the issue is still the same.
This is not only with specific fonts. If the font is changed to a different one, again the margin line shows on a different column.
This is not only with specific fonts. If the font is changed to a different one, again the margin line shows on a different column.
Can confirm this happening with several Windows fonts - Verdana, Arial, Calibri, for example.
Edit: and also happening on Mac.
I'm still seeing this on Windows using Eclipse 4.31RC2. Using the default Text Font: Consolas 10, and Print margin: 80
| Consolas 9 ❌ | Consolas 10 ❌ | Consolas 11 ✔ | Consolas 12 ✔ |
|---|---|---|---|
Other fonts:
| Courier New 9 ✔ | Courier New 10 ✔ | Courier New 11 ❌ | Courier New 12 ❌ |
|---|---|---|---|
| Cascadia Mono 9 ✔ | Cascadia Mono 10 ✔ | Cascadia Mono 11 ❌ | Cascadia Mono 12 ❌ |
|---|---|---|---|
I have been able to locate where the margin calculation is taking place,
from SourceViewerDecorationSupport to MarginPainter.
However, I am struggling to comprehend the further debug information regarding retrieving font information from the operating system and calculating the necessary pixels for the given margin.
It seems like every debug detail is presented solely in numerical form. Could someone offer assistance on how to debug this issue further ?