Re: [CSS21] os/2 and hhea tables

Le Sam 23 juin 2012 8:55, Roger Baker a écrit :
>
> I'm trying to better understand/predict font-size versus content area for
> various fonts,

As I said before, Alan Gresley did some tests and, in average, the
vertical relationship is that content area is 1.17 times the CSS
font-size.

and it seems I need a better understanding of font metrics
> (for example, how a font's glyphs relate to the font's em square). From
> the CSS2.1 spec (section 10.8.1):
>
> "Note. It is recommended that implementations that use OpenType or
> TrueType fonts use the metrics "sTypoAscender" and "sTypoDescender" from
> the font's OS/2 table for A and D (after scaling to the current element's
> font size). In the absence of these metrics, the "Ascent" and "Descent"
> metrics from the HHEA table should be used."
>
> I'm usually pretty good at "Googling", but in this case I haven't been
> able to locate OS/2 and HHEA tables for particular fonts.


Roger,

Here is what I recommend for you.  Try to find the software ttfdump.exe
I got it from

http://www.microsoft.com/typography/tools/tools.aspx

See

http://blogs.msdn.com/b/ie/archive/2009/01/27/microsoft-submits-thousands-more-css-2-1-tests-to-the-w3c.aspx#9396887

and

http://blogs.msdn.com/b/ie/archive/2009/01/27/microsoft-submits-thousands-more-css-2-1-tests-to-the-w3c.aspx#9396966

Use:

ttfdump filename -tOS/2 -nx -h


Here is an example of the output when tried on Ahem font (filename:
AHEM____.TTF ) :



ttfdump AHEM____.TTF -tOS/2 -nx -h

; TrueType v1.0 Dump Program - v1.8, Oct 29 2002, rrt, dra, gch, ddb, lcp,
pml
; Copyright (C) 1991 ZSoft Corporation. All rights reserved.
; Portions Copyright (C) 1991-2001 Microsoft Corporation. All rights
reserved.

; Dumping file 'AHEM____.TTF'


'OS/2' Table - OS/2 and Windows Metrics
---------------------------------------
Size = 96 bytes (expecting 96 bytes)
  'OS/2' version:           2
  xAvgCharWidth:            1000
  usWeightClass:            400
  usWidthClass:             5
  fsType:                   0x0000
  ySubscriptXSize:          700
  ySubscriptYSize:          650
  ySubscriptXOffset:        0
  ySubscriptYOffset:        143
  ySuperscriptXSize:        700
  ySuperscriptYSize:        650
  ySuperscriptXOffset:      0
  ySuperscriptYOffset:      453
  yStrikeoutSize:           50
  yStrikeoutPosition:       259
  sFamilyClass:             0    subclass = 0
  PANOSE:                   2  0  4  9  0  0  0  0  0  0
  Unicode Range 1( Bits 0 - 31 ): 800000AF
  Unicode Range 2( Bits 32- 63 ): 10002048
  Unicode Range 3( Bits 64- 95 ): 00000000
  Unicode Range 4( Bits 96-127 ): 00000000
  achVendID:                'W3C'
  fsSelection:              0x0040
  usFirstCharIndex:         0x0020
  usLastCharIndex:          0xF002
  sTypoAscender:            800
  sTypoDescender:           -200
  sTypoLineGap:             0
  usWinAscent:              800
  usWinDescent:             200
  CodePage Range 1( Bits 0 - 31 ): 20000111
  CodePage Range 2( Bits 32- 63 ): 40000000
  sxHeight:                 800
  sCapHeight:               800
  usDefaultChar:            0x0000
  usBreakChar:              0x0020
  usMaxLookups:             0


> I'll I've found
> is general information explaining what the variables such as sTypoAscender
> mean. Can someone please point me in the right direction in terms of how
> to find *specific* font metric information for a given font?

ttfdump.exe is a windows utility program running in command line. If you
can't find it, let me know: I have it.

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Saturday, 23 June 2012 15:59:24 UTC