Bug 508851 - Debug source viewers (breakpoint condition, Display view) use wrong font
Summary: Debug source viewers (breakpoint condition, Display view) use wrong font
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.7 M5   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 502061 508859
Blocks:
  Show dependency tree
 
Reported: 2016-12-07 12:43 EST by Markus Keller CLA
Modified: 2017-11-21 11:01 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2016-12-07 12:43:34 EST
Debug source viewers (breakpoint condition, Display view) use a wrong font (OS font instead of monospace text font).

Was OK until (including) I20161121-2000. Broken in I20161123-2000 and later. Only seems to affect new workspaces. Looks OK in old workspaces that were created before the breakage.

Smoking gun is bug 502061. Maybe the lines 481-490 ...

		PreferenceConverter.putValue(store, JFaceResources.TEXT_FONT, JFaceResources.getFontRegistry().getFontData(PreferenceConstants.EDITOR_TEXT_FONT));
[..]

... were not just for compatibility with old bundles, but were really necessary.

The JDISourceViewer does refer to JFaceResources.TEXT_FONT.
Comment 1 Markus Keller CLA 2016-12-07 12:45:52 EST
I have to finish something else first, but I'll have a look later.
Please ping me or write a comment here if you start to investigate.
Comment 2 Markus Keller CLA 2016-12-07 16:03:07 EST
The cited lines are the ones that produced an AFE in bug 506913, so adding them back unchanged is not a good idea either.

Furthermore, this is not backwards compatibility code, but normal sync code that should update JFace fonts when Eclipse workspace preferences are changed.

However, the code was at the wrong layer. It synced the Java editor font with JFaceResources.TEXT_FONT. That is conceptually wrong. I filed bug 508859 to fix that.


Keeping this bug for the necessary fixes in JDT Debug, which should not use JFaceResources.TEXT_FONT for Java source viewers. It should use org.eclipse.jdt.ui.PreferenceConstants.EDITOR_TEXT_FONT instead.
Comment 3 Sarika Sinha CLA 2016-12-08 05:03:09 EST
JFaceResources.TEXT_FONT is used by platform Debug, Platform Ant and JDT Debug.

In JDT Debug I can replace them by org.eclipse.jdt.ui.PreferenceConstants.EDITOR_TEXT_FONT.

Any change for Platform Debug and Ant Suggested?
Comment 4 Eclipse Genie CLA 2016-12-08 09:46:27 EST
New Gerrit change created: https://git.eclipse.org/r/86705
Comment 6 Sarika Sinha CLA 2017-01-24 00:17:01 EST
Verified using
Eclipse SDK

Version: Oxygen (4.7)
Build id: I20170123-2000
Comment 7 Carsten Reckord CLA 2017-07-06 10:02:18 EDT
I ran into this issue after updating my existing Neon.3 installation to Oxygen. Afterwards, the Display view was suddenly using Segoe UI 9, a font that is configured nowhere in my Eclipse preferences, and even eliminated in my Windows 10 settings wherever possible... The default dialog font and all other non-monospace fonts in the preferences are configured to use Tahoma.

Grepping through the workspace metadata and <eclipse>/configuration folders, I found a single place containing a reference to Segoe UI: 

.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml contained this:

	<section name="org.eclipse.jdt.debug.ui.RUNTIME_CLASSPATH_ADVANCED_DIALOG">
		...
		<item value="1|Segoe UI|9.0|0|WINDOWS|1|-12|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI" key="DIALOG_FONT_NAME"/>
		...
	</section>

Unsurprisingly, given the section name, changing this doesn't help. I have yet to figure out how to get a proper monospace font back that's actually readable :(
Comment 8 Dani Megert CLA 2017-07-17 10:22:54 EDT
(In reply to Carsten Reckord from comment #7)

As you can see this bug is marked fixed. If you see this using Oxygen, a new bug needs to be reported.