Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Wrong font height with 300% scaled Windows display
Wrong font height with 300% scaled Windows display [message #1832831] Fri, 25 September 2020 21:02 Go to next message
Martin J is currently offline Martin JFriend
Messages: 50
Registered: August 2015
Member
Hi,

I am getting wrong font height from 300% scaled resolution display. I have 4K monitor laptop. Letters are too small on 100% scale. I have to scale to 300%. But the following code returns much smaller font height than actual height. My program relies on this returning correct values.

font.getFontData()[0].getHeight();

Is there any better ways?
Re: Wrong font height with 300% scaled Windows display [message #1832848 is a reply to message #1832831] Sat, 26 September 2020 20:17 Go to previous message
Martin J is currently offline Martin JFriend
Messages: 50
Registered: August 2015
Member
I found a workaround with the following code;

gc.setFont(font);
fontheight = gc.stringExtent("1").y;
Previous Topic:SWT Browser Chromium support
Next Topic:Support for WEBP images
Goto Forum:
  


Current Time: Tue Dec 10 12:37:52 GMT 2024

Powered by FUDForum. Page generated in 0.03347 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top