oFont

oFont

Postby yeangpumpeng » Mon Aug 23, 2010 11:04 am

I dont understand why

LOCAL oFont := TFONT():NEW( "SEGOE UI", 0, - 12 , .F., .F.,,,,,,,,,,, )

is bigger than


LOCAL oFont := TFONT():NEW( "SEGOE UI", 0, 12 , .F., .F.,,,,,,,,,,, )

Tx U
yeangpumpeng
 
Posts: 21
Joined: Mon Aug 09, 2010 8:58 am

Re: oFont

Postby Enrico Maria Giordano » Mon Aug 23, 2010 12:44 pm

It's an expected Windows API behavior.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8711
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: oFont

Postby James Bott » Mon Aug 23, 2010 10:58 pm

The negative sign really means points instead of pixels. Without the negative it means pixels.

So, 0,-12 is a 12 point font. 0,12 is a font 0 pixels wide and 12 pixels high. I suspect the zero defaults to something larger than 0.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: oFont

Postby James Bott » Wed Aug 25, 2010 2:50 am

A point is 1/72 of an inch, so a 12 point font would be 12/72 inch. This is independent of the device that is displaying the font.

Pixels are dependent on the device (screen, printer) so they would be different heights on different devices. For this reaon you would generally want to use fonts defined in points rather than pixels.

There is a good definition of points in wikipedia.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: oFont

Postby ukoenig » Wed Aug 25, 2010 7:19 am

Hello,

You can use my < Fontpainter >, to get all Informations, You need.
The will be a new Release in a short Time with Background ( Brush-, Gradient- and Image-Selection )

viewtopic.php?f=3&t=18085&p=94745&hilit=fontpaint#p94745

Image

Preview Release Fontedit 2.1a
Create any Font-Background.

Image

Image

Image

Image

Image

Best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 75 guests