web engine - experimental web browser

OTF/TTF font file parsing #23

open opened by pierrelf.com

Phase 2 first step: Implement OTF/TTF font file parsing in the text crate.

  • Parse the OpenType/TrueType table directory (offset table + table records)
  • Parse head table (font header: units per em, bounding box, index format)
  • Parse maxp table (maximum profile: number of glyphs)
  • Parse hhea table (horizontal header: ascent, descent, line gap)
  • Parse hmtx table (horizontal metrics: advance width + left side bearing per glyph)
  • Parse cmap table (character to glyph index mapping, format 4 and format 12)
  • Parse name table (font family name, style name)
  • Parse loca table (glyph location offsets)
  • Load fonts from /System/Library/Fonts/ and /Library/Fonts/
  • Write unit tests for each table parser using a real system font

This lays the foundation for glyph outline extraction and rasterization in subsequent issues.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:meotu43t6usg4qdwzenk4s2t/sh.tangled.repo.issue/3mfkxphr6nn2e