Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Font height in RichEdit control

Posted on 1998-11-27
2
Medium Priority
?
386 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 400 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

916 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