Solved

Font height in RichEdit control

Posted on 1998-11-27
2
377 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

932 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

11 Experts available now in Live!

Get 1:1 Help Now