[pdf4st] AW: Font height

  • From: "Christian Haider" <Christian.Haider@xxxxxxxxxxxxxxxxxxxxxxx>
  • To: <pdf4st@xxxxxxxxxxxxx>
  • Date: Fri, 20 Apr 2012 15:49:18 +0200

(Originally submitted by ChristianHaider on Fri, 2011-12-02 10:55.) 

The height of a font (various measures like #capHeight, xHeight,
#ascender, #descender) is defined in the font coordinate space which is
usually scaled to 1000 @ 1000 for a font of size 1. To get the real
value it has to be multiplied by the font size and divided by 1000. For
your example that would be: 

(Graphics.Fonts.Font fontAt: #Helvetica)capHeight * 10 / 1000

which results in 7.18.

 

Von: pdf4st-bounce@xxxxxxxxxxxxx [mailto:pdf4st-bounce@xxxxxxxxxxxxx] Im
Auftrag von Christian Haider
Gesendet: Freitag, 20. April 2012 15:45
An: pdf4st@xxxxxxxxxxxxx
Betreff: [pdf4st] Font height 

 

(Originally Submitted by bobn on Thu, 2011-12-01 20:18.) 

How can I get the height of a font? I had hoped to use something like...


(Graphics.Fonts.Font fontAt: #Helvetica)capHeight

...but that answers 718. Is there a way to map that to 'Helvetica size
10'? 

Is the height of a 'Helvetica size 10' just '10'? 

Other related posts:

  • » [pdf4st] AW: Font height - Christian Haider