🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Renald Yazmir Wed, 25 Apr 2007 15:37
Character width in pixels
#2050
Author: Renald Yazmir
Date: Wed, 25 Apr 2007 15:37
25 lines
1344 bytes
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
Re: Character width in pixels
#2051
Author: Bob Gonder
Date: Wed, 25 Apr 2007 19:32
21 lines
1526 bytes
Renald Yazmir wrote:

>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?

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

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

>What parameter in LOGFONT needs to be set?

I would think 
	OUT_RASTER_PRECIS
	FIXED_PITCH
	FF_MODERN
Re: Character width in pixels
#2055
Author: Eelke
Date: Thu, 26 Apr 2007 09:47
12 lines
1058 bytes
Renald Yazmir schreef:
> Hello,
> 
> 
> 
> Is it possible to set font that all characters have the same width in 
> pixels?
> 
> 
Use a monospaced font like Courier New.

Eelke
Re: Character width in pixels
#2058
Author: danzer
Date: Thu, 26 Apr 2007 15:30
27 lines
1492 bytes
Renald Yazmir wrote:
> 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads