Solved

Font height in RichEdit control

Posted on 1998-11-27
2
376 Views
Last Modified: 2013-12-03
I'm using a richedit control as a editor in an application that is producing information to be displayed on screen. We want the font sizes to be always the same regardless of the
Windows settings so I'm using the Height property to specify the pixel height rather use the the Size property.
The problem is that certain pixel heights cannot be selected in the richedit. It appears  that only heights that map directly to point sizes are allowed. For example at the standard small fonts setting of 96dpi, a 14 point font is 19 pixels high, and can be shown. But at the large font setting of 120dpi there is no point size corresponding to this height and the richedit control changes the height to 18.

Any suggestions?

Terry Farmer
0
Comment
Question by:tfarmer
2 Comments
 
LVL 2

Expert Comment

by:brainware
ID: 1348250
What about Reading the Font Settings in Registry and use the font+sizes user have configured?
The info stored in windows is not the dpi/pixels but Font Size?
or do i remember wrong..
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 200 total points
ID: 1348251
The problem here is that WIN32 can't cope with fractional font sizes in terms of points (the fact that Word can do this is because they fudge it knowing that when they kick it out to the printer they can round it off in the more precise resolution of the printer to make fractional point fonts work - though they will not change size on screen necessarily).

Unfortunately you are between a rock and a hard place - is the one or two pixel error too much?

Cheers,

Raymond.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now