Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extracting StymeManager
Next Topic: RichTextLayoutTracer example improvement
Goto Forum:
  


Current Time: Tue May 14 05:06:24 CEST 2024

Total time taken to generate the page: 0.02465 seconds