Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non-integer Font Size

Status
Not open for further replies.

victoryhighway2

Programmer
Jul 18, 2005
42
US
Hello Group,
I'm trying to write a program that will simulate the display of our LCD display module. We are giving the user the choice of fonts, font sizes and colors to display. In my simulator, I want to simulate what the display will look like on our LCD display module, but I'm running into a problem. The LCD display we're using is a 68 DPI display, while most PC's are configured for 96 DPI. I've tried multiplying the font sizes by a factor of (96/68), but this results with a fractional point size. I'm trying to use the RichTextBox control to display the text, but unfortunately it only allows integer point sizes. I need to have the display on the simulator match the display on the LCD display as close as possible.

Does anyone have any suggestions to workaround this problem?

Regards,
Geoffrey
 
Monitor size and screen resolution are what you should be calculating with, not DPI. I'm not sure how you'll check monitor size, though.

Lee
 
>I'm not sure how you'll check monitor size

Tut! A quick keyword search in this forum should find my code to do exactly that ...

(I'll make it easy: thread222-749258)
 
Then, thanks to strongm, I guess the problem is entirely solved now. :)#

Lee
 
This gives me some interesting food for thought. It also looks like this will be a bit more difficult than I originally thought.

I realize that I will be able to scale my graphics by discovering the size of the monitor and the resolution of the monitor by reading the registry, but will I able to re-scale the fonts?

Regards,
Geoffrey
 
Used the same scaling ratio to multiply the original font size by to get the appropriate final font size.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top