| Summary: | Font size is very small in the Web Page Editor for some GTK/Linux environments | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Java Server Faces | Reporter: | Eric Norman <Eric.Norman> | ||||||
| Component: | UI | Assignee: | Ian Trimble <ian.trimble> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | raghunathan.srinivasan, thatnitind | ||||||
| Version: | unspecified | Flags: | raghunathan.srinivasan:
iplog+
|
||||||
| Target Milestone: | 3.5 M7 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Eric Norman
Created attachment 209327 [details]
Screenshot that shows the font size in the design tab
Created attachment 209328 [details]
Screenshot that shows the font size in the preview tab
The following code change to CSSFontManager seems to work for me, but maybe there is a better way to do it:
// the scale to convert the px to pt.
private final static double FONT_SCALE = fontDpi() / 72;
//get the font DPI from the display or a system property
static double fontDpi() {
double fontDpi = -1;
if ("gtk".equals(SWT.getPlatform())) {
//check if AWT has a value for the gnome font DPI
Object value = Toolkit.getDefaultToolkit().getDesktopProperty("gnome.Xft/DPI");
if (value instanceof Integer) {
fontDpi = (double)(((Integer)value).intValue() / 1024);
if (fontDpi == -1) {
fontDpi = 96;
}
if (fontDpi < 50) {
fontDpi = 50;
}
}
}
if (fontDpi == -1) {
//fallback to the DPI reported by the display
fontDpi = (double)Display.getCurrent().getDPI().x;
}
return fontDpi;
}
We will review. Thanks for providing a possible fix. Is there any chance of getting a fix for this issue? The WTP html editor is not usable in the current state. We will review for M7. Relevant discussion: https://www.java.net//node/672090 |