@@ -347,41 +347,172 @@ class (either by a font designer or by some automated means) the
347
347
"""
348
348
349
349
TT_OS2_typo_ascender = """
350
- TODO
350
+ The typographic ascender for this font. Remember that this is not the
351
+ same as `TT_HoriHeader.ascender`, which Apple defines in a far
352
+ different manner.
353
+
354
+ The suggested usage for `typo_ascender` is that it be used in
355
+ conjunction with `TT_Header.units_per_em` to compute a typographically
356
+ correct default line spacing. The goal is to free applications from
357
+ Macintosh or Windows-specific metrics which are constrained by
358
+ backward compatibility requirements. These new metrics, when combined
359
+ with the character design widths, will allow applications to lay out
360
+ documents in a typographically correct and portable fashion.
361
+
362
+ For CJK (Chinese, Japanese, and Korean) fonts that are intended to be
363
+ used for vertical writing (in addition to horizontal writing), the
364
+ required value for `typo_ascender` is that which describes the top of
365
+ the of the ideographic em-box. For example, if the ideographic em-box
366
+ of the font extends from coordinates 0,-120 to 1000,880 (that is, a
367
+ 1000x1000 box set 120 design units below the Latin baseline), then the
368
+ value of `typo_ascender` must be set to 880. Failing to adhere to these
369
+ requirements will result in incorrect vertical layout.
351
370
"""
352
371
353
372
TT_OS2_typo_descender = """
354
- TODO
373
+ The typographic descender for this font. Remember that this is not the
374
+ same as the `TT_HoriHeader.descender`, which Apple defines in a far
375
+ different manner.
376
+
377
+ The suggested usage for `typo_descender` is that it be used in
378
+ conjunction with `TT_Header.units_per_em` to compute a typographically
379
+ correct default line spacing. The goal is to free applications from
380
+ Macintosh or Windows-specific metrics which are constrained by
381
+ backward compatability requirements. These new metrics, when combined
382
+ with the character design widths, will allow applications to lay out
383
+ documents in a typographically correct and portable fashion.
384
+
385
+ For CJK (Chinese, Japanese, and Korean) fonts that are intended to be
386
+ used for vertical writing (in addition to horizontal writing), the
387
+ required value for `typo_descender` is that which describes the bottom
388
+ of the of the ideographic em-box. For example, if the ideographic
389
+ em-box of the font extends from coordinates 0,-120 to 1000,880 (that
390
+ is, a 1000x1000 box set 120 design units below the Latin baseline),
391
+ then the value of `typo_descender` must be set to -120. Failing to
392
+ adhere to these requirements will result in incorrect vertical layout.
355
393
"""
356
394
357
395
TT_OS2_typo_line_gap = """
358
- TODO
359
- """
396
+ The typographic line gap for this font. Remember that this is not the
397
+ same as `TT_HoriHeader.line_gap`, which Apple defines in a far
398
+ different manner.
399
+
400
+ The suggested usage for `typo_line_gap` is that it be used in
401
+ conjunction with `TTHeader.units_per_em` to compute a typographically
402
+ correct default line spacing. Typical values average 7-10% of units
403
+ per em. The goal is to free applications from Macintosh or
404
+ Windows-specific metrics which are constrained by backward
405
+ compatability requirements. These new metrics, when combined with the
406
+ character design widths, will allow applications to lay out documents
407
+ in a typographically correct and portable fashion. """
360
408
361
409
TT_OS2_win_ascent = """
362
- TODO
410
+ The ascender metric for Windows. This, too, is distinct from Apple's
411
+ `TT_HoriHeader.ascender` value and from the `typo_ascender`
412
+ values. `win_ascent` is computed as the ``y_max`` for all characters
413
+ in the Windows ANSI character set. `win_ascent` is used to compute the
414
+ Windows font height and default line spacing. For platform 3 encoding
415
+ 0 fonts, it is the same as `TT_Header.y_max`. Windows will clip the
416
+ bitmap of any portion of a glyph that appears above this value. Some
417
+ applications use this value to determine default line spacing. This is
418
+ strongly discouraged. The typographic ascender, descender and line gap
419
+ fields in conjunction with `TT_Header.units_per_em` should be used for
420
+ this purpose. Developers should set this field keeping the above
421
+ factors in mind.
422
+
423
+ If any clipping is unacceptable, then the value should be set to
424
+ `TT_Header.y_max`.
425
+
426
+ However, if a developer desires to provide appropriate default line
427
+ spacing using this field, for those applications that continue to use
428
+ this field for doing so (against OpenType recommendations), then the
429
+ value should be set appropriately. In such a case, it may result in
430
+ some glyph bitmaps being clipped.
363
431
"""
364
432
365
433
TT_OS2_win_descent = """
366
- TODO
434
+ The descender metric for Windows. This, too, is distinct from Apple's
435
+ `TT_HoriHeader.descender` value and from the
436
+ `typo_descender`. `win_descent` is computed as the ``-y_min`` for all
437
+ characters in the Windows ANSI character set. `win_descent` is used to
438
+ compute the Windows font height and default line spacing. For platform
439
+ 3 encoding 0 fonts, it is the same as ``-TTHeader.y_min``. Windows
440
+ will clip the bitmap of any portion of a glyph that appears below this
441
+ value. Some applications use this value to determine default line
442
+ spacing. This is strongly discouraged. The typographic ascender,
443
+ descender and line gap fields in conjunction with unitsPerEm should be
444
+ used for this purpose. Developers should set this field keeping the
445
+ above factors in mind.
446
+
447
+ If any clipping is unacceptable, then the value should be set to
448
+ `TT_Header.y_min`.
449
+
450
+ However, if a developer desires to provide appropriate default line
451
+ spacing using this field, for those applications that continue to use
452
+ this field for doing so (against OpenType recommendations), then the
453
+ value should be set appropriately. In such a case, it may result in
454
+ some glyph bitmaps being clipped.
367
455
"""
368
456
369
457
TT_OS2_x_height = """
370
- TODO
458
+ This metric specifies the distance between the baseline and the
459
+ approximate height of non-ascending lowercase letters measured in font
460
+ units. This value would normally be specified by a type designer but
461
+ in situations where that is not possible, for example when a legacy
462
+ font is being converted, the value may be set equal to the top of the
463
+ unscaled and unhinted glyph bounding box of the glyph encoded at
464
+ ``U+0078`` (``LATIN SMALL LETTER X``). If no glyph is encoded in this
465
+ position the field should be set to 0.
466
+
467
+ This metric, if specified, can be used in font substitution: the
468
+ `x_height` value of one font can be scaled to approximate the apparent
469
+ size of another.
371
470
"""
372
471
373
472
TT_OS2_cap_height = """
374
- TODO
473
+ This metric specifies the distance between the baseline and the
474
+ approximate height of uppercase letters measured in font units. This
475
+ value would normally be specified by a type designer but in situations
476
+ where that is not possible, for example when a legacy font is being
477
+ converted, the value may be set equal to the top of the unscaled and
478
+ unhinted glyph bounding box of the glyph encoded at ``U+0048`` (``LATIN
479
+ CAPITAL LETTER H``). If no glyph is encoded in this position the field
480
+ should be set to 0.
481
+
482
+ This metric, if specified, can be used in systems that specify type
483
+ size by capital height measured in millimeters. It can also be used as
484
+ an alignment metric; the top of a drop capital, for instance, can be
485
+ aligned to the `cap_height` metric of the first line of text.
375
486
"""
376
487
377
488
TT_OS2_default_char = """
378
- TODO
489
+ Whenever a request is made for a character that is not in the font,
490
+ Windows provides this default character. If the value of this field is
491
+ zero, glyph ID 0 is to be used for the default character otherwise
492
+ this is the Unicode encoding of the glyph that Windows uses as the
493
+ default character. This field cannot represent supplementary character
494
+ values (codepoints greater than ``0xFFFF``), and so applications are
495
+ strongly discouraged from using this field.
379
496
"""
380
497
381
498
TT_OS2_break_char = """
382
- TODO
499
+ This is the Unicode encoding of the glyph that Windows uses as the
500
+ break character. The break character is used to separate words and
501
+ justify text. Most fonts specify 'space' as the break character. This
502
+ field cannot represent supplementary character values (codepoints
503
+ greater than ``0xFFFF``), and so applications are strongly discouraged
504
+ from using this field.
383
505
"""
384
506
385
507
TT_OS2_max_context = """
386
- TODO
508
+ The maximum length of a target glyph context for any feature in this
509
+ font. For example, a font which has only a pair kerning feature should
510
+ set this field to 2. If the font also has a ligature feature in which
511
+ the glyph sequence "f f i" is substituted by the ligature "ffi", then
512
+ this field should be set to 3. This field could be useful to
513
+ sophisticated line-breaking engines in determining how far they should
514
+ look ahead to test whether something could change that effects the
515
+ line breaking. For chaining contextual lookups, the length of the
516
+ string (covered glyph) + (input sequence) + (lookahead sequence)
517
+ should be considered.
387
518
"""
0 commit comments