Module: ExtractTtc::Constants
- Defined in:
- lib/extract_ttc/constants.rb
Overview
Constants module containing immutable constant definitions for TTC/TTF font file operations.
This module defines all magic numbers, version identifiers, and file format constants used throughout the extract_ttc gem. These values are based on the TrueType Collection and TrueType Font specifications.
Constant Summary collapse
- TTC_TAG =
TrueType Collection file signature tag. All valid TTC files must begin with this 4-byte tag.
"ttcf"- TTC_VERSION_1 =
TrueType Collection Version 1.0 identifier. Represents the original TTC format version.
0x00010000- TTC_VERSION_2 =
TrueType Collection Version 2.0 identifier. Represents the extended TTC format with digital signature support.
0x00020000- HEAD_TAG =
Head table tag identifier. The ‘head’ table contains global font header information including the checksum adjustment field.
"head"- CHECKSUM_ADJUSTMENT_MAGIC =
Magic number used for font file checksum adjustment calculation. This constant is used in conjunction with the file checksum to compute the checksumAdjustment value stored in the ‘head’ table. Formula: checksumAdjustment = CHECKSUM_ADJUSTMENT_MAGIC - file_checksum
0xB1B0AFBA
- SUPPORTED_VERSIONS =
Supported TTC version numbers. An array of valid version identifiers for TrueType Collection files.
[TTC_VERSION_1, TTC_VERSION_2].freeze
- TABLE_ALIGNMENT =
Table data alignment boundary in bytes. All table data in TTF files must be aligned to 4-byte boundaries, with padding added as necessary.
4