Home » U++ Library support » RichText,QTF,RTF... » Zooming font of RichText to the size of StdFont
Re: Zooming font of RichText to the size of StdFont [message #20049 is a reply to message #20006] |
Fri, 13 February 2009 15:11   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Zeth wrote on Mon, 09 February 2009 03:39 | I've read about it and it seems to be a Windows XP specific problem with GetDeviceCaps always returning 96. I ended up checking my main window size (it isn't resizable):
if(this->GetSize().cx > 690){ //Assume Large font
DPI = 120;
}
float Multiplier = DPI / 96;
I've attached a small testcase which shows my problem. If you load it with 96 dpi all is ok, but when you change it to use 120dpi then you can see the scrollArea StaticText control is not automatically resized and the buttons are no longer of the same size. Basically all the manually added controls are not resized according to the current dpi. How do you guys handle this?
|
FontZoom.
Check Ctrl::
static int HorzLayoutZoom(int cx);
static int VertLayoutZoom(int cy);
The basic idea is to query the size of specific text with current default GUI font. Knowing its "default size" (as defined by its size in WinXP with small fonts, but that is hardly relevant) you compute zooming ratio.
Mirek
[Updated on: Fri, 13 February 2009 15:11] Report message to a moderator
|
|
|
 |
|
Zooming font of RichText to the size of StdFont
By: Novo on Sat, 03 January 2009 06:45
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: mirek on Sun, 04 January 2009 15:07
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: Novo on Wed, 07 January 2009 05:20
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: mirek on Wed, 07 January 2009 13:29
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: Zeth on Sun, 08 February 2009 11:46
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: mirek on Mon, 09 February 2009 08:03
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: Zeth on Mon, 09 February 2009 09:39
|
 |
|
Re: Zooming font of RichText to the size of StdFont
By: mirek on Fri, 13 February 2009 15:11
|
 |
|
Prompt with non-system dpi for text at first
|
 |
|
Re: Prompt with non-system dpi for text at first
|
 |
|
Re: Prompt with non-system dpi for text at first
By: mirek on Sun, 29 November 2009 23:31
|
 |
|
Re: Prompt with non-system dpi for text at first
|
 |
|
Re: Prompt with non-system dpi for text at first
By: mirek on Thu, 10 December 2009 19:16
|
Goto Forum:
Current Time: Mon Apr 28 06:01:22 CEST 2025
Total time taken to generate the page: 0.00493 seconds
|