| View previous topic :: View next topic |
| Author |
Message |
Renald Yazmir Guest
|
Posted: Wed Apr 25, 2007 8:37 pm Post subject: Character width in pixels |
|
|
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
|
Posted: Thu Apr 26, 2007 12:32 am Post subject: Re: Character width in pixels |
|
|
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
|
Posted: Thu Apr 26, 2007 2:47 pm Post subject: Re: Character width in pixels |
|
|
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
|
Posted: Thu Apr 26, 2007 8:30 pm Post subject: Re: Character width in pixels |
|
|
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 |
|
 |
|