Page 1 of 1

CAP Height Metric Location in TTF File

Posted: Wed Dec 02, 2015 6:23 pm
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!!!

Re: CAP Height Metric Location in TTF File

Posted: Wed Dec 02, 2015 7:19 pm
by Erwin Denissen

Re: CAP Height Metric Location in TTF File

Posted: Wed Dec 02, 2015 7:44 pm
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

Re: CAP Height Metric Location in TTF File

Posted: Wed Dec 02, 2015 9:57 pm
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.

Re: CAP Height Metric Location in TTF File

Posted: Wed Dec 02, 2015 11:25 pm
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

Re: CAP Height Metric Location in TTF File

Posted: Thu Dec 03, 2015 1:52 pm
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

Re: CAP Height Metric Location in TTF File

Posted: Thu Dec 03, 2015 2:03 pm
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