CAP Height Metric Location in TTF File

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Post Reply
dmills
Posts: 3
Joined: Wed Dec 02, 2015 5:46 pm

CAP Height Metric Location in TTF File

Post by dmills »

I am working on a project that requires precise placement of a font for LASER engraving. Specifically centering a font's cap height on a button for centered text.

My question is, where in the TTF tables is the cap height stored?

I use Font Creator currently, but I know from past experience that Font Lab uses cap height too. So, I assume that this information is stored within the font and is not just pulled by Font Creator for the "H" height (Or maybe it is???).

I know how to adjust the cap height in the metrics tab, but my programmer can't find a way to access the Cap Height information directly from the TTF file. I can certainly give them the values for the fonts that I create, but I need a method that works with any font not just our custom fonts. I know that the Right Side Bearing isn't stored directly in the font, but is a calculated value using the Glyph width, Left Side Bearing, and Advance Width. Is that cap height also a calculated value? If so, how can I do that calculation from the font tables.

I know this might be more of an API question, but I need to point them in the right direction so that they can use my fonts.

Thanks!!!
Erwin Denissen
Moderator
Moderator
Posts: 11157
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: CAP Height Metric Location in TTF File

Post by Erwin Denissen »

Erwin Denissen
High-Logic
Proven Font Technology
dmills
Posts: 3
Joined: Wed Dec 02, 2015 5:46 pm

Re: CAP Height Metric Location in TTF File

Post by dmills »

Thanks Erwin,

Do I need to change a setting to have this value included in my font export? My font OS/2 table seems to have everything except the sCapHeight value:

'OS/2' Table - OS/2 and Windows Metrics
---------------------------------------
'OS/2' version: 3
xAvgCharWidth: 559
usWeightClass: 400 'Normal'
usWidthClass: 5 'Medium'
fsType: 0
ySubscriptXSize: 650
ySubscriptYSize: 600
ySubscriptXOffset: 0
ySubscriptYOffset: 75
ySuperscriptXSize: 650
ySuperscriptYSize: 600
ySuperscriptXOffset: 0
ySuperscriptYOffset: 350
yStrikeoutSize: 50
yStrikeoutPosition 310
sFamilyClass: 0 subclass = 0
PANOSE:
Family Kind: 2 'Text and Display'
Serif Style: 11 'Normal Sans'
Weight: 6 'Medium'
Proportion: 4 'Even Width'
Contrast: 2 'None'
Stroke: 2 'Gradual/Diagonal'
Arm Style: 2 'Straight Arms/Wedge'
Lettreform: 2 'Normal/Contact'
Midline: 2 'Standard/Trimmed'
X-height: 4 'Ducking/Standard'
Unicode Range 1( Bits 0 - 31 ): 0xa00002af
Unicode Range 2( Bits 32 - 63 ): 0x5000205b
Unicode Range 3( Bits 64 - 95 ): 0x00000000
Unicode Range 4( Bits 96 - 128 ): 0x00000000
achVendID: 'LINO'
fsSelection: 0x0040 'Regular '
usFirstCharIndex: 0x0020
usLastCharIndex: 0xfb04
sTypoAscender: 714
sTypoDescender: -198
sTypoLineGap: 100
usWinAscent: 973
usWinDescent: 248
CodePage Range 1( Bits 0 - 31 ): 0x20000097
CodePage Range 2( Bits 32- 63 ): 0x00000000
Erwin Denissen
Moderator
Moderator
Posts: 11157
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: CAP Height Metric Location in TTF File

Post by Erwin Denissen »

dmills wrote:Do I need to change a setting to have this value included in my font export?
No. It is included, but it seems your software/tools fail to reveal it.
Erwin Denissen
High-Logic
Proven Font Technology
MikeW
Posts: 625
Joined: Mon May 20, 2013 2:51 pm

Re: CAP Height Metric Location in TTF File

Post by MikeW »

The x and cap heights are listed in the table right after the code page listing which appears is where your's stops. At least with the tool I am using that is where they are found...

Mike
dmills
Posts: 3
Joined: Wed Dec 02, 2015 5:46 pm

Re: CAP Height Metric Location in TTF File

Post by dmills »

Hi Mike and Erwin,
Thanks so much for your help. I will pass this on in my meeting with the programmer today.

Mike, would you mind sharing the tool that you are using. Is that allowed?

Thanks,
DAniel
MikeW
Posts: 625
Joined: Mon May 20, 2013 2:51 pm

Re: CAP Height Metric Location in TTF File

Post by MikeW »

DTL's OTMaster. There's a free version. I use it for a couple of reasons having to do when I was helping a company implement some features in their software having to do with fonts.

Mike
Post Reply