FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oFont
Posts: 21
Joined: Mon Aug 09, 2010 08:58 AM
oFont
Posted: 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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: oFont
Posted: Mon Aug 23, 2010 12:44 PM

It's an expected Windows API behavior.

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: oFont
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: oFont
Posted: Wed Aug 25, 2010 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: oFont
Posted: Wed Aug 25, 2010 07: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



Preview Release Fontedit 2.1a
Create any Font-Background.











Best regards
Uwe :-)
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.

Continue the discussion