BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Character width in pixels

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Renald Yazmir
Guest





PostPosted: Wed Apr 25, 2007 8:37 pm    Post subject: Character width in pixels Reply with quote



Hello,



Is it possible to set font that all characters have the same width in
pixels?

Currently with my settings all digits are 5 pixels, space and period are 4
pixels.



I am using GetTextExtentPoint32(..) to determine character width in pixels.



What parameter in LOGFONT needs to be set?

Any examples?



Thank you

Rony
Back to top
Bob Gonder
Guest





PostPosted: Thu Apr 26, 2007 12:32 am    Post subject: Re: Character width in pixels Reply with quote



Renald Yazmir wrote:

Quote:
Is it possible to set font that all characters have the same width in
pixels?

Currently with my settings all digits are 5 pixels, space and period are 4
pixels.

What settings are you using?

Quote:
I am using GetTextExtentPoint32(..) to determine character width in pixels.

It might also be easier to check the character widths by using
GetCharWidth32()

Quote:
What parameter in LOGFONT needs to be set?

I would think
OUT_RASTER_PRECIS
FIXED_PITCH
FF_MODERN
Back to top
Eelke
Guest





PostPosted: Thu Apr 26, 2007 2:47 pm    Post subject: Re: Character width in pixels Reply with quote



Renald Yazmir schreef:
Quote:
Hello,



Is it possible to set font that all characters have the same width in
pixels?


Use a monospaced font like Courier New.


Eelke
Back to top
danzer
Guest





PostPosted: Thu Apr 26, 2007 8:30 pm    Post subject: Re: Character width in pixels Reply with quote

Renald Yazmir wrote:
Quote:
Hello,



Is it possible to set font that all characters have the same width in
pixels?

Currently with my settings all digits are 5 pixels, space and period are 4
pixels.



I am using GetTextExtentPoint32(..) to determine character width in pixels.



What parameter in LOGFONT needs to be set?

Any examples?


You might want to examine the ExtTextOut function and in particular the
lpDx argument. Using the lpDx argument you can control the position of
the characters regardless of the font used.

Danzer
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.