From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:WOFF2" |
|---|
| claim | "A transformed hmtx (transform version 1) begins with a flags byte: bit 0 SET means the proportional left side bearings (the first numberOfHMetrics lsb values) are omitted and rebuilt from the glyph x minimums, bit 1 SET means the monospace lsbs (glyphs from numberOfHMetrics on) are omitted; a clear bit means that int16 array is stored. Bits 2-7 must be zero, and both bits clear (nothing omitted, so no real transform) is rejected. After the flags come advanceWidth[numberOfHMetrics] (u16), then the lsb arrays that are present." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "WOFF2 hmtx transform version 1" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "decoding a WOFF2 hmtx table with transform version 1" |
|---|
| effect | "advance widths read; an lsb array whose flag bit is set is not stored and is rebuilt from glyf x minimums; a clear bit means the array follows as int16 values" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "ReconstructTransformedHmtx flag handling" |
|---|
| repo | "https://github.com/google/woff2" |
|---|
| commit | "fb9c3379f2605b10f3e8f1d9636664ab5576775c" |
|---|
| path | "src/woff2_dec.cc" |
|---|
| lines | "700-731" |
|---|
|
| type | "source" |
|---|
| detail | "has_proportional_lsbs = (hmtx_flags & 1) == 0; has_monospace_lsbs = (hmtx_flags & 2) == 0; lsb read from the stream only when the has_ flag is true, else x_mins[i]; both true is FONT_COMPRESSION_FAILURE" |
|---|
| repo | "https://github.com/google/woff2" |
|---|
| commit | "fb9c3379f2605b10f3e8f1d9636664ab5576775c" |
|---|
| path | "src/woff2_dec.cc" |
|---|
| lines | "700-790" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Transformed hmtx flags" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:43:14.612Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:41:48.919Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched src/woff2_dec.cc at google/woff2 fb9c3379f260 and read ReconstructTransformedHmtx whole (lines 700-795): has_proportional_lsbs = (flags & 1) == 0, has_monospace_lsbs = (flags & 2) == 0, bits 2-7 must be zero, both true rejected, advance widths first, then proportional lsbs, then monospace lsbs, omitted ones taken from x_mins. Matches the corrected claim." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:51:52.261Z" |
|---|
| summary | "Bit polarity was reversed: in ReconstructTransformedHmtx has_proportional_lsbs = (flags & 1) == 0 and has_monospace_lsbs = (flags & 2) == 0, so a SET bit means the lsb array is omitted (rebuilt from…" |
|---|
| changed | | "claim" |
| "data" |
| "evidence" |
|
|---|
|
|
|---|