From 20dae2c29625e0823f6d6189a219d128eab20547 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Thu, 28 Apr 2022 09:56:06 +1000 Subject: [PATCH 1/4] Add name records to `name` table --- formats/data/opentype/aots/cmap0_font1.snap | 188 +++++ formats/data/opentype/aots/cmap10_font1.snap | 194 +++++ formats/data/opentype/aots/cmap10_font2.snap | 194 +++++ formats/data/opentype/aots/cmap12_font1.snap | 194 +++++ formats/data/opentype/aots/cmap14_font1.snap | 194 +++++ formats/data/opentype/aots/cmap2_font1.snap | 188 +++++ formats/data/opentype/aots/cmap4_font1.snap | 188 +++++ formats/data/opentype/aots/cmap4_font2.snap | 188 +++++ formats/data/opentype/aots/cmap4_font3.snap | 188 +++++ formats/data/opentype/aots/cmap4_font4.snap | 188 +++++ formats/data/opentype/aots/cmap6_font1.snap | 188 +++++ formats/data/opentype/aots/cmap6_font2.snap | 188 +++++ formats/data/opentype/aots/cmap8_font1.snap | 188 +++++ formats/data/opentype/woff/valid-001.snap | 676 ++++++++++++++++ formats/data/opentype/woff/valid-005.snap | 642 ++++++++++++++++ .../opentype/woff2/SFNT-TTF-Composite.snap | 719 ++++++++++++++++++ formats/opentype.fathom | 5 +- formats/opentype.snap | 1 + 18 files changed, 4508 insertions(+), 3 deletions(-) diff --git a/formats/data/opentype/aots/cmap0_font1.snap b/formats/data/opentype/aots/cmap0_font1.snap index 30e0b2211..b2b4f6a6d 100644 --- a/formats/data/opentype/aots/cmap0_font1.snap +++ b/formats/data/opentype/aots/cmap0_font1.snap @@ -578,8 +578,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 5064, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 5078, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 5100, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 5122, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 5142, + }, + }, + ], }, ] +5064 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +5078 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +5100 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +5122 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +5142 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 5164 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap10_font1.snap b/formats/data/opentype/aots/cmap10_font1.snap index 8451370eb..dfb215a3a 100644 --- a/formats/data/opentype/aots/cmap10_font1.snap +++ b/formats/data/opentype/aots/cmap10_font1.snap @@ -328,8 +328,202 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 24, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 24, + link = 4830, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 24, + offset = { + offset = 38, + link = 4844, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 24, + offset = { + offset = 62, + link = 4868, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 86, + link = 4892, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 24, + offset = { + offset = 106, + link = 4912, + }, + }, + ], }, ] +4830 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4844 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4868 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4892 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4912 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 4936 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap10_font2.snap b/formats/data/opentype/aots/cmap10_font2.snap index ea100f927..4f122cc7f 100644 --- a/formats/data/opentype/aots/cmap10_font2.snap +++ b/formats/data/opentype/aots/cmap10_font2.snap @@ -324,8 +324,202 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 24, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 24, + link = 4822, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 24, + offset = { + offset = 38, + link = 4836, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 24, + offset = { + offset = 62, + link = 4860, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 86, + link = 4884, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 24, + offset = { + offset = 106, + link = 4904, + }, + }, + ], }, ] +4822 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4836 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4860 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4884 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4904 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 48, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] 4928 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap12_font1.snap b/formats/data/opentype/aots/cmap12_font1.snap index 2530043e9..85d910008 100644 --- a/formats/data/opentype/aots/cmap12_font1.snap +++ b/formats/data/opentype/aots/cmap12_font1.snap @@ -334,8 +334,202 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 24, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 24, + link = 4842, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 24, + offset = { + offset = 38, + link = 4856, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 24, + offset = { + offset = 62, + link = 4880, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 86, + link = 4904, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 24, + offset = { + offset = 106, + link = 4924, + }, + }, + ], }, ] +4842 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4856 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4880 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4904 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4924 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 4948 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap14_font1.snap b/formats/data/opentype/aots/cmap14_font1.snap index 3b22ca2c3..6413357e3 100644 --- a/formats/data/opentype/aots/cmap14_font1.snap +++ b/formats/data/opentype/aots/cmap14_font1.snap @@ -423,8 +423,202 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 24, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 24, + link = 4890, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 24, + offset = { + offset = 38, + link = 4904, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 24, + offset = { + offset = 62, + link = 4928, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 86, + link = 4952, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 24, + offset = { + offset = 106, + link = 4972, + }, + }, + ], }, ] +4890 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4904 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4928 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4952 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4972 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 49, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 4996 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap2_font1.snap b/formats/data/opentype/aots/cmap2_font1.snap index f28585998..bab2e2607 100644 --- a/formats/data/opentype/aots/cmap2_font1.snap +++ b/formats/data/opentype/aots/cmap2_font1.snap @@ -578,8 +578,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 5868, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 5882, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 5904, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 5926, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 5946, + }, + }, + ], }, ] +5868 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +5882 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +5904 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +5926 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +5946 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 50, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 5968 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap4_font1.snap b/formats/data/opentype/aots/cmap4_font1.snap index 8047585b8..1a469126f 100644 --- a/formats/data/opentype/aots/cmap4_font1.snap +++ b/formats/data/opentype/aots/cmap4_font1.snap @@ -342,8 +342,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4832, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4846, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4868, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4890, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4910, + }, + }, + ], }, ] +4832 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4846 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4868 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4890 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4910 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 4932 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap4_font2.snap b/formats/data/opentype/aots/cmap4_font2.snap index e7ab4d09c..fbf46570f 100644 --- a/formats/data/opentype/aots/cmap4_font2.snap +++ b/formats/data/opentype/aots/cmap4_font2.snap @@ -338,8 +338,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4824, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4838, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4860, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4882, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4902, + }, + }, + ], }, ] +4824 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4838 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4860 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4882 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4902 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] 4924 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap4_font3.snap b/formats/data/opentype/aots/cmap4_font3.snap index 22ae61d43..e6319c864 100644 --- a/formats/data/opentype/aots/cmap4_font3.snap +++ b/formats/data/opentype/aots/cmap4_font3.snap @@ -338,8 +338,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4824, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4838, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4860, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4882, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4902, + }, + }, + ], }, ] +4824 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4838 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 51, + ], +] +4860 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 51, + ], +] +4882 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4902 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 51, + ], +] 4924 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap4_font4.snap b/formats/data/opentype/aots/cmap4_font4.snap index 781fe9f94..e6dc689a2 100644 --- a/formats/data/opentype/aots/cmap4_font4.snap +++ b/formats/data/opentype/aots/cmap4_font4.snap @@ -346,8 +346,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4840, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4854, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4876, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4898, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4918, + }, + }, + ], }, ] +4840 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4854 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 52, + ], +] +4876 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 52, + ], +] +4898 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4918 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 52, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 52, + ], +] 4940 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap6_font1.snap b/formats/data/opentype/aots/cmap6_font1.snap index f13586aaf..17339d649 100644 --- a/formats/data/opentype/aots/cmap6_font1.snap +++ b/formats/data/opentype/aots/cmap6_font1.snap @@ -327,8 +327,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4816, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4830, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4852, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4874, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4894, + }, + }, + ], }, ] +4816 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4830 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4852 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +4874 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4894 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 4916 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap6_font2.snap b/formats/data/opentype/aots/cmap6_font2.snap index 01599380e..1139264ba 100644 --- a/formats/data/opentype/aots/cmap6_font2.snap +++ b/formats/data/opentype/aots/cmap6_font2.snap @@ -323,8 +323,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 4812, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 4826, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 4848, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 4870, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 4890, + }, + }, + ], }, ] +4812 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +4826 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4848 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] +4870 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +4890 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 54, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 50, + ], +] 4912 = [ {}, ] diff --git a/formats/data/opentype/aots/cmap8_font1.snap b/formats/data/opentype/aots/cmap8_font1.snap index a0ffc9b64..64410a2e0 100644 --- a/formats/data/opentype/aots/cmap8_font1.snap +++ b/formats/data/opentype/aots/cmap8_font1.snap @@ -8553,8 +8553,196 @@ stdout = ''' version = 0, name_count = 6, storage_offset = 78, + name_records = [ + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 22, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 22, + link = 13092, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 22, + offset = { + offset = 36, + link = 13106, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 22, + offset = { + offset = 58, + link = 13128, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 20, + offset = { + offset = 80, + link = 13150, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 22, + offset = { + offset = 100, + link = 13170, + }, + }, + ], }, ] +13092 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +13106 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 56, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +13128 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 56, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] +13150 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 49, + 0, + 46, + 0, + 48, + ], +] +13170 = [ + [ + 0, + 99, + 0, + 109, + 0, + 97, + 0, + 112, + 0, + 56, + 0, + 95, + 0, + 102, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 49, + ], +] 13192 = [ {}, ] diff --git a/formats/data/opentype/woff/valid-001.snap b/formats/data/opentype/woff/valid-001.snap index f9982a46b..de2a901e6 100644 --- a/formats/data/opentype/woff/valid-001.snap +++ b/formats/data/opentype/woff/valid-001.snap @@ -251,8 +251,684 @@ stdout = ''' version = 0, name_count = 14, storage_offset = 174, + name_records = [ + { + platform = 1, + encoding = 0, + language = 0, + name_id = 1, + length = 13, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 2, + length = 7, + offset = { + offset = 13, + link = 539, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 3, + length = 30, + offset = { + offset = 20, + link = 546, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 4, + length = 13, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 5, + length = 72, + offset = { + offset = 50, + link = 576, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 6, + length = 19, + offset = { + offset = 122, + link = 648, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 8, + length = 22, + offset = { + offset = 141, + link = 667, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 26, + offset = { + offset = 163, + link = 689, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 189, + link = 715, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 60, + offset = { + offset = 203, + link = 729, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 38, + offset = { + offset = 263, + link = 789, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 144, + offset = { + offset = 301, + link = 827, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 38, + offset = { + offset = 263, + link = 789, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 8, + length = 44, + offset = { + offset = 445, + link = 971, + }, + }, + ], }, ] +539 = [ + [ + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +546 = [ + [ + 49, + 46, + 48, + 48, + 48, + 59, + 78, + 111, + 110, + 101, + 59, + 87, + 79, + 70, + 70, + 84, + 101, + 115, + 116, + 67, + 70, + 70, + 45, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +576 = [ + [ + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 32, + 49, + 46, + 48, + 48, + 48, + 59, + 80, + 83, + 32, + 48, + 48, + 49, + 46, + 48, + 48, + 48, + 59, + 104, + 111, + 116, + 99, + 111, + 110, + 118, + 32, + 49, + 46, + 48, + 46, + 53, + 55, + 59, + 109, + 97, + 107, + 101, + 111, + 116, + 102, + 46, + 108, + 105, + 98, + 50, + 46, + 48, + 46, + 50, + 49, + 56, + 57, + 53, + 32, + 68, + 69, + 86, + 69, + 76, + 79, + 80, + 77, + 69, + 78, + 84, + ], +] +648 = [ + [ + 87, + 79, + 70, + 70, + 84, + 101, + 115, + 116, + 67, + 70, + 70, + 45, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +667 = [ + [ + 87, + 101, + 98, + 70, + 111, + 110, + 116, + 115, + 32, + 87, + 111, + 114, + 107, + 105, + 110, + 103, + 32, + 71, + 114, + 111, + 117, + 112, + ], +] +689 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 67, + 0, + 70, + 0, + 70, + ], +] +715 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +729 = [ + [ + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 48, + 0, + 48, + 0, + 59, + 0, + 78, + 0, + 111, + 0, + 110, + 0, + 101, + 0, + 59, + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 67, + 0, + 70, + 0, + 70, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +789 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 67, + 0, + 70, + 0, + 70, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +827 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 32, + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 48, + 0, + 48, + 0, + 59, + 0, + 80, + 0, + 83, + 0, + 32, + 0, + 48, + 0, + 48, + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 48, + 0, + 48, + 0, + 59, + 0, + 104, + 0, + 111, + 0, + 116, + 0, + 99, + 0, + 111, + 0, + 110, + 0, + 118, + 0, + 32, + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 46, + 0, + 53, + 0, + 55, + 0, + 59, + 0, + 109, + 0, + 97, + 0, + 107, + 0, + 101, + 0, + 111, + 0, + 116, + 0, + 102, + 0, + 46, + 0, + 108, + 0, + 105, + 0, + 98, + 0, + 50, + 0, + 46, + 0, + 48, + 0, + 46, + 0, + 50, + 0, + 49, + 0, + 56, + 0, + 57, + 0, + 53, + 0, + 32, + 0, + 68, + 0, + 69, + 0, + 86, + 0, + 69, + 0, + 76, + 0, + 79, + 0, + 80, + 0, + 77, + 0, + 69, + 0, + 78, + 0, + 84, + ], +] +971 = [ + [ + 0, + 87, + 0, + 101, + 0, + 98, + 0, + 70, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 115, + 0, + 32, + 0, + 87, + 0, + 111, + 0, + 114, + 0, + 107, + 0, + 105, + 0, + 110, + 0, + 103, + 0, + 32, + 0, + 71, + 0, + 114, + 0, + 111, + 0, + 117, + 0, + 112, + ], +] 1016 = [ { table_start = 1016, diff --git a/formats/data/opentype/woff/valid-005.snap b/formats/data/opentype/woff/valid-005.snap index 734cfaea0..d27900d84 100644 --- a/formats/data/opentype/woff/valid-005.snap +++ b/formats/data/opentype/woff/valid-005.snap @@ -732,8 +732,650 @@ stdout = ''' version = 0, name_count = 14, storage_offset = 174, + name_records = [ + { + platform = 1, + encoding = 0, + language = 0, + name_id = 1, + length = 13, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 2, + length = 7, + offset = { + offset = 13, + link = 3147, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 3, + length = 47, + offset = { + offset = 20, + link = 3154, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 4, + length = 21, + offset = { + offset = 67, + link = 3201, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 5, + length = 20, + offset = { + offset = 88, + link = 3222, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 6, + length = 19, + offset = { + offset = 108, + link = 3242, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 8, + length = 22, + offset = { + offset = 127, + link = 3261, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 26, + offset = { + offset = 149, + link = 3283, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 175, + link = 3309, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 94, + offset = { + offset = 189, + link = 3323, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 42, + offset = { + offset = 283, + link = 3417, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 40, + offset = { + offset = 325, + link = 3459, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 38, + offset = { + offset = 365, + link = 3499, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 8, + length = 44, + offset = { + offset = 403, + link = 3537, + }, + }, + ], }, ] +3147 = [ + [ + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3154 = [ + [ + 87, + 101, + 98, + 70, + 111, + 110, + 116, + 115, + 87, + 111, + 114, + 107, + 105, + 110, + 103, + 71, + 114, + 111, + 117, + 112, + 58, + 87, + 79, + 70, + 70, + 32, + 84, + 101, + 115, + 116, + 32, + 84, + 84, + 70, + 32, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + 58, + 50, + 48, + 49, + 48, + ], +] +3201 = [ + [ + 87, + 79, + 70, + 70, + 32, + 84, + 101, + 115, + 116, + 32, + 84, + 84, + 70, + 32, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3222 = [ + [ + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 32, + 48, + 48, + 49, + 46, + 48, + 48, + 48, + 32, + 50, + 48, + 49, + 48, + ], +] +3242 = [ + [ + 87, + 79, + 70, + 70, + 84, + 101, + 115, + 116, + 84, + 84, + 70, + 45, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3261 = [ + [ + 87, + 101, + 98, + 70, + 111, + 110, + 116, + 115, + 32, + 87, + 111, + 114, + 107, + 105, + 110, + 103, + 32, + 71, + 114, + 111, + 117, + 112, + ], +] +3283 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + ], +] +3309 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3323 = [ + [ + 0, + 87, + 0, + 101, + 0, + 98, + 0, + 70, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 115, + 0, + 87, + 0, + 111, + 0, + 114, + 0, + 107, + 0, + 105, + 0, + 110, + 0, + 103, + 0, + 71, + 0, + 114, + 0, + 111, + 0, + 117, + 0, + 112, + 0, + 58, + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 32, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + 0, + 58, + 0, + 50, + 0, + 48, + 0, + 49, + 0, + 48, + ], +] +3417 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3459 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 32, + 0, + 48, + 0, + 48, + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 48, + 0, + 48, + 0, + 32, + 0, + 50, + 0, + 48, + 0, + 49, + 0, + 48, + ], +] +3499 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3537 = [ + [ + 0, + 87, + 0, + 101, + 0, + 98, + 0, + 70, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 115, + 0, + 32, + 0, + 87, + 0, + 111, + 0, + 114, + 0, + 107, + 0, + 105, + 0, + 110, + 0, + 103, + 0, + 32, + 0, + 71, + 0, + 114, + 0, + 111, + 0, + 117, + 0, + 112, + ], +] 3584 = [ {}, ] diff --git a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap index 5aa0099c9..ca4ada5e9 100644 --- a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap +++ b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap @@ -739,8 +739,727 @@ stdout = ''' version = 0, name_count = 14, storage_offset = 174, + name_records = [ + { + platform = 1, + encoding = 0, + language = 0, + name_id = 1, + length = 23, + offset = { + offset = 0, + link = {}, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 2, + length = 7, + offset = { + offset = 23, + link = 3349, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 3, + length = 47, + offset = { + offset = 30, + link = 3356, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 4, + length = 31, + offset = { + offset = 77, + link = 3403, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 5, + length = 20, + offset = { + offset = 108, + link = 3434, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 6, + length = 28, + offset = { + offset = 128, + link = 3454, + }, + }, + { + platform = 1, + encoding = 0, + language = 0, + name_id = 8, + length = 22, + offset = { + offset = 156, + link = 3482, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 1, + length = 46, + offset = { + offset = 178, + link = 3504, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 2, + length = 14, + offset = { + offset = 224, + link = 3550, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 3, + length = 94, + offset = { + offset = 238, + link = 3564, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 4, + length = 62, + offset = { + offset = 332, + link = 3658, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 5, + length = 40, + offset = { + offset = 394, + link = 3720, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 6, + length = 56, + offset = { + offset = 434, + link = 3760, + }, + }, + { + platform = 3, + encoding = 1, + language = 1033, + name_id = 8, + length = 44, + offset = { + offset = 490, + link = 3816, + }, + }, + ], }, ] +3349 = [ + [ + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3356 = [ + [ + 87, + 101, + 98, + 70, + 111, + 110, + 116, + 115, + 87, + 111, + 114, + 107, + 105, + 110, + 103, + 71, + 114, + 111, + 117, + 112, + 58, + 87, + 79, + 70, + 70, + 32, + 84, + 101, + 115, + 116, + 32, + 84, + 84, + 70, + 32, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + 58, + 50, + 48, + 49, + 48, + ], +] +3403 = [ + [ + 87, + 79, + 70, + 70, + 32, + 84, + 101, + 115, + 116, + 32, + 84, + 84, + 70, + 32, + 67, + 111, + 109, + 112, + 111, + 115, + 105, + 116, + 101, + 32, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3434 = [ + [ + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 32, + 48, + 48, + 49, + 46, + 48, + 48, + 48, + 32, + 50, + 48, + 49, + 48, + ], +] +3454 = [ + [ + 87, + 79, + 70, + 70, + 84, + 101, + 115, + 116, + 84, + 84, + 70, + 67, + 111, + 109, + 112, + 111, + 115, + 105, + 116, + 101, + 45, + 82, + 101, + 103, + 117, + 108, + 97, + 114, + ], +] +3482 = [ + [ + 87, + 101, + 98, + 70, + 111, + 110, + 116, + 115, + 32, + 87, + 111, + 114, + 107, + 105, + 110, + 103, + 32, + 71, + 114, + 111, + 117, + 112, + ], +] +3504 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 32, + 0, + 67, + 0, + 111, + 0, + 109, + 0, + 112, + 0, + 111, + 0, + 115, + 0, + 105, + 0, + 116, + 0, + 101, + ], +] +3550 = [ + [ + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3564 = [ + [ + 0, + 87, + 0, + 101, + 0, + 98, + 0, + 70, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 115, + 0, + 87, + 0, + 111, + 0, + 114, + 0, + 107, + 0, + 105, + 0, + 110, + 0, + 103, + 0, + 71, + 0, + 114, + 0, + 111, + 0, + 117, + 0, + 112, + 0, + 58, + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 32, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + 0, + 58, + 0, + 50, + 0, + 48, + 0, + 49, + 0, + 48, + ], +] +3658 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 32, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 32, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 32, + 0, + 67, + 0, + 111, + 0, + 109, + 0, + 112, + 0, + 111, + 0, + 115, + 0, + 105, + 0, + 116, + 0, + 101, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3720 = [ + [ + 0, + 86, + 0, + 101, + 0, + 114, + 0, + 115, + 0, + 105, + 0, + 111, + 0, + 110, + 0, + 32, + 0, + 48, + 0, + 48, + 0, + 49, + 0, + 46, + 0, + 48, + 0, + 48, + 0, + 48, + 0, + 32, + 0, + 50, + 0, + 48, + 0, + 49, + 0, + 48, + ], +] +3760 = [ + [ + 0, + 87, + 0, + 79, + 0, + 70, + 0, + 70, + 0, + 84, + 0, + 101, + 0, + 115, + 0, + 116, + 0, + 84, + 0, + 84, + 0, + 70, + 0, + 67, + 0, + 111, + 0, + 109, + 0, + 112, + 0, + 111, + 0, + 115, + 0, + 105, + 0, + 116, + 0, + 101, + 0, + 45, + 0, + 82, + 0, + 101, + 0, + 103, + 0, + 117, + 0, + 108, + 0, + 97, + 0, + 114, + ], +] +3816 = [ + [ + 0, + 87, + 0, + 101, + 0, + 98, + 0, + 70, + 0, + 111, + 0, + 110, + 0, + 116, + 0, + 115, + 0, + 32, + 0, + 87, + 0, + 111, + 0, + 114, + 0, + 107, + 0, + 105, + 0, + 110, + 0, + 103, + 0, + 32, + 0, + 71, + 0, + 114, + 0, + 111, + 0, + 117, + 0, + 112, + ], +] 3860 = [ {}, ] diff --git a/formats/opentype.fathom b/formats/opentype.fathom index 6e1724c88..64f247bd7 100644 --- a/formats/opentype.fathom +++ b/formats/opentype.fathom @@ -988,9 +988,8 @@ let name_table = { name_count <- u16be, /// The offset to the string storage area, relative to the start of the naming table. storage_offset <- u16be, - // /// The array of name records - // TODO: position operations - // name_records <- array16 count (name_record (table_start + storage_offset)), + /// The array of name records + name_records <- array16 name_count (name_record (pos_add_u16 table_start storage_offset)), // TODO: Conditional fields diff --git a/formats/opentype.snap b/formats/opentype.snap index 55d0c2092..5bf952d80 100644 --- a/formats/opentype.snap +++ b/formats/opentype.snap @@ -235,6 +235,7 @@ let name_table : _ = { version <- u16be, name_count <- u16be, storage_offset <- u16be, + name_records <- array16 name_count (name_record (pos_add_u16 table_start storage_offset)), }; let loca_table : _ = fun num_glyphs => fun index_to_loc_format => { offsets <- match index_to_loc_format { From 61a89ce26f0538a04ac62666b1834fdb8698cbc5 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Thu, 28 Apr 2022 10:32:00 +1000 Subject: [PATCH 2/4] Add OS/2 to OpenType format --- formats/data/opentype/aots/cmap0_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap10_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap10_font2.snap | 57 ++++++++- formats/data/opentype/aots/cmap12_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap14_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap2_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap4_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap4_font2.snap | 57 ++++++++- formats/data/opentype/aots/cmap4_font3.snap | 57 ++++++++- formats/data/opentype/aots/cmap4_font4.snap | 57 ++++++++- formats/data/opentype/aots/cmap6_font1.snap | 57 ++++++++- formats/data/opentype/aots/cmap6_font2.snap | 57 ++++++++- formats/data/opentype/aots/cmap8_font1.snap | 57 ++++++++- formats/data/opentype/woff/valid-001.snap | 57 ++++++++- formats/data/opentype/woff/valid-005.snap | 57 ++++++++- .../opentype/woff2/SFNT-TTF-Composite.snap | 57 ++++++++- formats/opentype.fathom | 118 +++++++++++++++++- formats/opentype.snap | 72 ++++++++++- 18 files changed, 1083 insertions(+), 19 deletions(-) diff --git a/formats/data/opentype/aots/cmap0_font1.snap b/formats/data/opentype/aots/cmap0_font1.snap index b2b4f6a6d..97036315e 100644 --- a/formats/data/opentype/aots/cmap0_font1.snap +++ b/formats/data/opentype/aots/cmap0_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap10_font1.snap b/formats/data/opentype/aots/cmap10_font1.snap index dfb215a3a..c77b5153a 100644 --- a/formats/data/opentype/aots/cmap10_font1.snap +++ b/formats/data/opentype/aots/cmap10_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap10_font2.snap b/formats/data/opentype/aots/cmap10_font2.snap index 4f122cc7f..50a13e075 100644 --- a/formats/data/opentype/aots/cmap10_font2.snap +++ b/formats/data/opentype/aots/cmap10_font2.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap12_font1.snap b/formats/data/opentype/aots/cmap12_font1.snap index 85d910008..be6b96406 100644 --- a/formats/data/opentype/aots/cmap12_font1.snap +++ b/formats/data/opentype/aots/cmap12_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap14_font1.snap b/formats/data/opentype/aots/cmap14_font1.snap index 6413357e3..a4410fe29 100644 --- a/formats/data/opentype/aots/cmap14_font1.snap +++ b/formats/data/opentype/aots/cmap14_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap2_font1.snap b/formats/data/opentype/aots/cmap2_font1.snap index bab2e2607..a5761a652 100644 --- a/formats/data/opentype/aots/cmap2_font1.snap +++ b/formats/data/opentype/aots/cmap2_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap4_font1.snap b/formats/data/opentype/aots/cmap4_font1.snap index 1a469126f..53ef26ccd 100644 --- a/formats/data/opentype/aots/cmap4_font1.snap +++ b/formats/data/opentype/aots/cmap4_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap4_font2.snap b/formats/data/opentype/aots/cmap4_font2.snap index fbf46570f..31067c8cf 100644 --- a/formats/data/opentype/aots/cmap4_font2.snap +++ b/formats/data/opentype/aots/cmap4_font2.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap4_font3.snap b/formats/data/opentype/aots/cmap4_font3.snap index e6319c864..c90423b6c 100644 --- a/formats/data/opentype/aots/cmap4_font3.snap +++ b/formats/data/opentype/aots/cmap4_font3.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap4_font4.snap b/formats/data/opentype/aots/cmap4_font4.snap index e6dc689a2..ebe6cded8 100644 --- a/formats/data/opentype/aots/cmap4_font4.snap +++ b/formats/data/opentype/aots/cmap4_font4.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap6_font1.snap b/formats/data/opentype/aots/cmap6_font1.snap index 17339d649..f5afdf40e 100644 --- a/formats/data/opentype/aots/cmap6_font1.snap +++ b/formats/data/opentype/aots/cmap6_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap6_font2.snap b/formats/data/opentype/aots/cmap6_font2.snap index 1139264ba..f6c4313b7 100644 --- a/formats/data/opentype/aots/cmap6_font2.snap +++ b/formats/data/opentype/aots/cmap6_font2.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/aots/cmap8_font1.snap b/formats/data/opentype/aots/cmap8_font1.snap index 64410a2e0..13aa08fd1 100644 --- a/formats/data/opentype/aots/cmap8_font1.snap +++ b/formats/data/opentype/aots/cmap8_font1.snap @@ -188,7 +188,62 @@ stdout = ''' {}, ] 4288 = [ - {}, + { + version = 2, + x_avg_char_width = 2500, + us_weight_class = 400, + us_width_class = 5, + fs_type = 12, + y_subscript_x_size = 500, + y_subscript_y_size = 500, + y_subscript_x_offset = 250, + y_subscript_y_offset = 50, + y_superscript_x_size = 500, + y_superscript_y_size = 500, + y_superscript_x_offset = 0, + y_superscript_y_offset = 500, + y_strikeout_size = 50, + y_strikeout_position = 500, + s_family_class = 0, + panose = [ + 2, + 10, + 6, + 3, + 6, + 5, + 11, + 2, + 2, + 4, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1094992453, + fs_selection = 64, + us_first_char_index = 65, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 2500, + s_typo_descender = 0, + s_typo_line_gap = 200, + us_win_ascent = 2500, + usWinDescent = 0, + }, + ul_code_page_range1 = 3762225663, + ul_code_page_range2 = 4294901760, + }, + sx_height = 2500, + s_cap_height = 2500, + us_default_char = 65, + us_break_char = 65, + us_max_context = 0, + }, + }, ] 4384 = [ { diff --git a/formats/data/opentype/woff/valid-001.snap b/formats/data/opentype/woff/valid-001.snap index de2a901e6..4b8c0dbc1 100644 --- a/formats/data/opentype/woff/valid-001.snap +++ b/formats/data/opentype/woff/valid-001.snap @@ -243,7 +243,62 @@ stdout = ''' }, ] 256 = [ - {}, + { + version = 4, + x_avg_char_width = 1525, + us_weight_class = 400, + us_width_class = 5, + fs_type = 0, + y_subscript_x_size = 650, + y_subscript_y_size = 600, + y_subscript_x_offset = 0, + y_subscript_y_offset = 75, + y_superscript_x_size = 650, + y_superscript_y_size = 600, + y_superscript_x_offset = 0, + y_superscript_y_offset = 350, + y_strikeout_size = 50, + y_strikeout_position = 300, + s_family_class = 0, + panose = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1315925605, + fs_selection = 448, + us_first_char_index = 32, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 750, + s_typo_descender = -250, + s_typo_line_gap = 0, + us_win_ascent = 1000, + usWinDescent = 0, + }, + ul_code_page_range1 = 536870913, + ul_code_page_range2 = 0, + }, + sx_height = 500, + s_cap_height = 750, + us_default_char = 0, + us_break_char = 32, + us_max_context = 0, + }, + }, ] 352 = [ { diff --git a/formats/data/opentype/woff/valid-005.snap b/formats/data/opentype/woff/valid-005.snap index d27900d84..060078e97 100644 --- a/formats/data/opentype/woff/valid-005.snap +++ b/formats/data/opentype/woff/valid-005.snap @@ -255,7 +255,62 @@ stdout = ''' }, ] 312 = [ - {}, + { + version = 3, + x_avg_char_width = 3124, + us_weight_class = 400, + us_width_class = 5, + fs_type = 4, + y_subscript_x_size = 1434, + y_subscript_y_size = 1331, + y_subscript_x_offset = 0, + y_subscript_y_offset = 287, + y_superscript_x_size = 1434, + y_superscript_y_size = 1331, + y_superscript_x_offset = 0, + y_superscript_y_offset = 977, + y_strikeout_size = 102, + y_strikeout_position = 512, + s_family_class = 0, + panose = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1315925605, + fs_selection = 64, + us_first_char_index = 32, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 1536, + s_typo_descender = -512, + s_typo_line_gap = 0, + us_win_ascent = 1454, + usWinDescent = 20, + }, + ul_code_page_range1 = 1, + ul_code_page_range2 = 0, + }, + sx_height = 1024, + s_cap_height = 1536, + us_default_char = 0, + us_break_char = 32, + us_max_context = 0, + }, + }, ] 408 = [ { diff --git a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap index ca4ada5e9..11dca7646 100644 --- a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap +++ b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap @@ -255,7 +255,62 @@ stdout = ''' }, ] 312 = [ - {}, + { + version = 3, + x_avg_char_width = 3124, + us_weight_class = 400, + us_width_class = 5, + fs_type = 4, + y_subscript_x_size = 1434, + y_subscript_y_size = 1331, + y_subscript_x_offset = 0, + y_subscript_y_offset = 287, + y_superscript_x_size = 1434, + y_superscript_y_size = 1331, + y_superscript_x_offset = 0, + y_superscript_y_offset = 977, + y_strikeout_size = 102, + y_strikeout_position = 512, + s_family_class = 0, + panose = [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + ul_unicode_range1 = 1, + ul_unicode_range2 = 0, + ul_unicode_range3 = 0, + ul_unicode_range4 = 0, + ach_vend_id = 1315925605, + fs_selection = 64, + us_first_char_index = 32, + us_last_char_index = 80, + data = { + version_1 = { + version_0 = { + s_typo_ascender = 1536, + s_typo_descender = -512, + s_typo_line_gap = 0, + us_win_ascent = 1454, + usWinDescent = 20, + }, + ul_code_page_range1 = 1, + ul_code_page_range2 = 0, + }, + sx_height = 1024, + s_cap_height = 1536, + us_default_char = 0, + us_break_char = 32, + us_max_context = 0, + }, + }, ] 408 = [ { diff --git a/formats/opentype.fathom b/formats/opentype.fathom index 64f247bd7..86c5527ef 100644 --- a/formats/opentype.fathom +++ b/formats/opentype.fathom @@ -1119,7 +1119,113 @@ let glyf_table = fun (num_glyphs : U16) => { // ----------------------------------------------------------------------------- -// TODO: "OS/2" .. "sbix" tables +/// # OS/2 Version 0 +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/os2#version-0) +/// - [Apple's TrueType Reference Manual: The `'OS/2'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html) +let os2_version_0 = { + s_typo_ascender <- s16be, + s_typo_descender <- s16be, + s_typo_line_gap <- s16be, + us_win_ascent <- u16be, + usWinDescent <- u16be, +}; + +/// # OS/2 Version 1 +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/os2#version-1) +/// - [Apple's TrueType Reference Manual: The `'OS/2'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html) +let os2_version_1 = { + version_0 <- os2_version_0, + ul_code_page_range1 <- u32be, + ul_code_page_range2 <- u32be, +}; + +/// # OS/2 Version 2, 3, 4 +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/os2#version-2) +/// - [Apple's TrueType Reference Manual: The `'OS/2'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html) +let os2_version_2_3_4 = { + version_1 <- os2_version_1, + sx_height <- s16be, + s_cap_height <- s16be, + us_default_char <- u16be, + us_break_char <- u16be, + us_max_context <- u16be, +}; + +/// # OS/2 Version 5 +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/os2#version-0) +/// - [Apple's TrueType Reference Manual: The `'OS/2'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html) +let os2_version_5 = { + parent <- os2_version_2_3_4, + usLowerOpticalPointSize <- u16be, + usUpperOpticalPointSize <- u16be, +}; + +/// # OS/2 and Windows Metrics Table +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/os2) +/// - [Apple's TrueType Reference Manual: The `'OS/2'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html) +let os2_table = fun (table_length : U32) => { + version <- u16be, + x_avg_char_width <- s16be, + us_weight_class <- u16be, + us_width_class <- u16be, + fs_type <- u16be, + y_subscript_x_size <- s16be, + y_subscript_y_size <- s16be, + y_subscript_x_offset <- s16be, + y_subscript_y_offset <- s16be, + y_superscript_x_size <- s16be, + y_superscript_y_size <- s16be, + y_superscript_x_offset <- s16be, + y_superscript_y_offset <- s16be, + y_strikeout_size <- s16be, + y_strikeout_position <- s16be, + s_family_class <- s16be, + panose <- array8 10 u8, + ul_unicode_range1 <- u32be, + ul_unicode_range2 <- u32be, + ul_unicode_range3 <- u32be, + ul_unicode_range4 <- u32be, + ach_vend_id <- tag, + fs_selection <- u16be, + us_first_char_index <- u16be, + us_last_char_index <- u16be, + data <- match version { + // Note: Documentation for OS/2 version 0 in Appleā€™s TrueType Reference Manual stops at the + // usLastCharIndex field and does not include the last five fields of the table as it was + // defined by Microsoft. Some legacy TrueType fonts may have been built with a shortened + // version 0 OS/2 table. Applications should check the table length for a version 0 OS/2 + // table before reading these fields. + 0 => match (u32_gte table_length 78) { + true => os2_version_0, + false => {}, + }, + 1 => os2_version_1, + 2 => os2_version_2_3_4, + 3 => os2_version_2_3_4, + 4 => os2_version_2_3_4, + 5 => os2_version_5, + _ => fail, + } +}; + +// ----------------------------------------------------------------------------- + +// TODO: "PCLT" .. "sbix" tables // ----------------------------------------------------------------------------- @@ -1289,6 +1395,14 @@ let table_directory = fun (file_start : Pos) => { link <- link_table file_start table_record table_format, }; + let required_table_with_len = + fun (table_id : Repr tag) => + fun (table_format : (U32 -> Format)) => { + // TODO: let formats + table_record <- unwrap (Repr table_record) (find_table _ table_records table_id), + link <- link_table file_start table_record (table_format table_record.length), + }; + let optional_table = fun (table_id : Repr tag) => fun (table_format : Format) => @@ -1313,7 +1427,7 @@ let table_directory = fun (file_start : Pos) => { maxp.num_glyphs, }, name <- required_table "name" name_table, - os2 <- required_table "OS/2" unknown_table, + os2 <- required_table_with_len "OS/2" os2_table, post <- required_table "post" unknown_table, // TrueType Outline Tables diff --git a/formats/opentype.snap b/formats/opentype.snap index 5bf952d80..2e1b978eb 100644 --- a/formats/opentype.snap +++ b/formats/opentype.snap @@ -281,6 +281,70 @@ let glyph : _ = { }, }; let glyf_table : _ = fun num_glyphs => { glyphs <- array16 num_glyphs glyph }; +let os2_version_0 : _ = { + s_typo_ascender <- s16be, + s_typo_descender <- s16be, + s_typo_line_gap <- s16be, + us_win_ascent <- u16be, + usWinDescent <- u16be, +}; +let os2_version_1 : _ = { + version_0 <- os2_version_0, + ul_code_page_range1 <- u32be, + ul_code_page_range2 <- u32be, +}; +let os2_version_2_3_4 : _ = { + version_1 <- os2_version_1, + sx_height <- s16be, + s_cap_height <- s16be, + us_default_char <- u16be, + us_break_char <- u16be, + us_max_context <- u16be, +}; +let os2_version_5 : _ = { + parent <- os2_version_2_3_4, + usLowerOpticalPointSize <- u16be, + usUpperOpticalPointSize <- u16be, +}; +let os2_table : _ = fun table_length => { + version <- u16be, + x_avg_char_width <- s16be, + us_weight_class <- u16be, + us_width_class <- u16be, + fs_type <- u16be, + y_subscript_x_size <- s16be, + y_subscript_y_size <- s16be, + y_subscript_x_offset <- s16be, + y_subscript_y_offset <- s16be, + y_superscript_x_size <- s16be, + y_superscript_y_size <- s16be, + y_superscript_x_offset <- s16be, + y_superscript_y_offset <- s16be, + y_strikeout_size <- s16be, + y_strikeout_position <- s16be, + s_family_class <- s16be, + panose <- array8 10 u8, + ul_unicode_range1 <- u32be, + ul_unicode_range2 <- u32be, + ul_unicode_range3 <- u32be, + ul_unicode_range4 <- u32be, + ach_vend_id <- tag, + fs_selection <- u16be, + us_first_char_index <- u16be, + us_last_char_index <- u16be, + data <- match version { + 0 => match (u32_gte table_length 78) { + false => {}, + true => os2_version_0, + }, + 1 => os2_version_1, + 2 => os2_version_2_3_4, + 3 => os2_version_2_3_4, + 4 => os2_version_2_3_4, + 5 => os2_version_5, + _ => fail, + }, +}; let base_table : _ = unknown_table; let gdef_table : _ = unknown_table; let gpos_table : _ = unknown_table; @@ -314,6 +378,12 @@ let table_directory : _ = fun file_start => { table_record <- unwrap (Repr table_record) (find_table (_ file_start sfnt_version _sfnt_version num_tables search_range entry_selector range_shift table_records table_id table_format) table_records table_id), link <- link_table file_start table_record table_format, }; + let required_table_with_len : + _ file_start sfnt_version _sfnt_version num_tables search_range entry_selector range_shift table_records = + fun table_id => fun table_format => { + table_record <- unwrap (Repr table_record) (find_table (_ file_start sfnt_version _sfnt_version num_tables search_range entry_selector range_shift table_records table_id table_format) table_records table_id), + link <- link_table file_start table_record (table_format table_record.length), + }; let optional_table : _ file_start sfnt_version _sfnt_version num_tables search_range entry_selector range_shift table_records = fun table_id => fun table_format => option_fold (Repr table_record) Format {} (fun record => link_table file_start record table_format) (find_table (_ file_start sfnt_version _sfnt_version num_tables search_range entry_selector range_shift table_records table_id table_format) table_records table_id); @@ -328,7 +398,7 @@ let table_directory : _ = fun file_start => { table <- htmx_table hhea.number_of_long_horizontal_metrics maxp.num_glyphs, }, name <- required_table "name" name_table, - os2 <- required_table "OS/2" unknown_table, + os2 <- required_table_with_len "OS/2" os2_table, post <- required_table "post" unknown_table, cvt <- optional_table "cvt " unknown_table, fpgm <- optional_table "fpgm" unknown_table, From 8f8a4516c22ff29faa479e4124542894931e4ed0 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Thu, 28 Apr 2022 11:07:41 +1000 Subject: [PATCH 3/4] Add post table to OpenType format --- formats/data/opentype/aots/cmap0_font1.snap | 13 +++- formats/data/opentype/aots/cmap10_font1.snap | 13 +++- formats/data/opentype/aots/cmap10_font2.snap | 13 +++- formats/data/opentype/aots/cmap12_font1.snap | 13 +++- formats/data/opentype/aots/cmap14_font1.snap | 13 +++- formats/data/opentype/aots/cmap2_font1.snap | 13 +++- formats/data/opentype/aots/cmap4_font1.snap | 13 +++- formats/data/opentype/aots/cmap4_font2.snap | 13 +++- formats/data/opentype/aots/cmap4_font3.snap | 13 +++- formats/data/opentype/aots/cmap4_font4.snap | 13 +++- formats/data/opentype/aots/cmap6_font1.snap | 13 +++- formats/data/opentype/aots/cmap6_font2.snap | 13 +++- formats/data/opentype/aots/cmap8_font1.snap | 13 +++- formats/data/opentype/woff/valid-001.snap | 13 +++- formats/data/opentype/woff/valid-005.snap | 13 +++- .../opentype/woff2/SFNT-TTF-Composite.snap | 13 +++- formats/opentype.fathom | 74 +++++++++++++++++-- formats/opentype.snap | 27 ++++++- 18 files changed, 286 insertions(+), 23 deletions(-) diff --git a/formats/data/opentype/aots/cmap0_font1.snap b/formats/data/opentype/aots/cmap0_font1.snap index 97036315e..3e3511527 100644 --- a/formats/data/opentype/aots/cmap0_font1.snap +++ b/formats/data/opentype/aots/cmap0_font1.snap @@ -824,7 +824,18 @@ stdout = ''' ], ] 5164 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap10_font1.snap b/formats/data/opentype/aots/cmap10_font1.snap index c77b5153a..028fb8ca1 100644 --- a/formats/data/opentype/aots/cmap10_font1.snap +++ b/formats/data/opentype/aots/cmap10_font1.snap @@ -580,7 +580,18 @@ stdout = ''' ], ] 4936 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap10_font2.snap b/formats/data/opentype/aots/cmap10_font2.snap index 50a13e075..92949fff8 100644 --- a/formats/data/opentype/aots/cmap10_font2.snap +++ b/formats/data/opentype/aots/cmap10_font2.snap @@ -576,7 +576,18 @@ stdout = ''' ], ] 4928 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap12_font1.snap b/formats/data/opentype/aots/cmap12_font1.snap index be6b96406..cbf34bed1 100644 --- a/formats/data/opentype/aots/cmap12_font1.snap +++ b/formats/data/opentype/aots/cmap12_font1.snap @@ -586,7 +586,18 @@ stdout = ''' ], ] 4948 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap14_font1.snap b/formats/data/opentype/aots/cmap14_font1.snap index a4410fe29..9d964a0b5 100644 --- a/formats/data/opentype/aots/cmap14_font1.snap +++ b/formats/data/opentype/aots/cmap14_font1.snap @@ -675,7 +675,18 @@ stdout = ''' ], ] 4996 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap2_font1.snap b/formats/data/opentype/aots/cmap2_font1.snap index a5761a652..712e856ae 100644 --- a/formats/data/opentype/aots/cmap2_font1.snap +++ b/formats/data/opentype/aots/cmap2_font1.snap @@ -824,7 +824,18 @@ stdout = ''' ], ] 5968 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap4_font1.snap b/formats/data/opentype/aots/cmap4_font1.snap index 53ef26ccd..155d6df61 100644 --- a/formats/data/opentype/aots/cmap4_font1.snap +++ b/formats/data/opentype/aots/cmap4_font1.snap @@ -588,7 +588,18 @@ stdout = ''' ], ] 4932 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap4_font2.snap b/formats/data/opentype/aots/cmap4_font2.snap index 31067c8cf..31beb363d 100644 --- a/formats/data/opentype/aots/cmap4_font2.snap +++ b/formats/data/opentype/aots/cmap4_font2.snap @@ -584,7 +584,18 @@ stdout = ''' ], ] 4924 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap4_font3.snap b/formats/data/opentype/aots/cmap4_font3.snap index c90423b6c..6c04cc290 100644 --- a/formats/data/opentype/aots/cmap4_font3.snap +++ b/formats/data/opentype/aots/cmap4_font3.snap @@ -584,7 +584,18 @@ stdout = ''' ], ] 4924 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap4_font4.snap b/formats/data/opentype/aots/cmap4_font4.snap index ebe6cded8..b82dda9fe 100644 --- a/formats/data/opentype/aots/cmap4_font4.snap +++ b/formats/data/opentype/aots/cmap4_font4.snap @@ -592,7 +592,18 @@ stdout = ''' ], ] 4940 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap6_font1.snap b/formats/data/opentype/aots/cmap6_font1.snap index f5afdf40e..c7f64b816 100644 --- a/formats/data/opentype/aots/cmap6_font1.snap +++ b/formats/data/opentype/aots/cmap6_font1.snap @@ -573,7 +573,18 @@ stdout = ''' ], ] 4916 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap6_font2.snap b/formats/data/opentype/aots/cmap6_font2.snap index f6c4313b7..5239aa0f3 100644 --- a/formats/data/opentype/aots/cmap6_font2.snap +++ b/formats/data/opentype/aots/cmap6_font2.snap @@ -569,7 +569,18 @@ stdout = ''' ], ] 4912 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/aots/cmap8_font1.snap b/formats/data/opentype/aots/cmap8_font1.snap index 13aa08fd1..79a024b95 100644 --- a/formats/data/opentype/aots/cmap8_font1.snap +++ b/formats/data/opentype/aots/cmap8_font1.snap @@ -8799,7 +8799,18 @@ stdout = ''' ], ] 13192 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -100, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/woff/valid-001.snap b/formats/data/opentype/woff/valid-001.snap index 4b8c0dbc1..b7b169311 100644 --- a/formats/data/opentype/woff/valid-001.snap +++ b/formats/data/opentype/woff/valid-001.snap @@ -1144,7 +1144,18 @@ stdout = ''' }, ] 1248 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -75, + underline_thickness = 50, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] 1280 = [ {}, diff --git a/formats/data/opentype/woff/valid-005.snap b/formats/data/opentype/woff/valid-005.snap index 060078e97..a53f3d029 100644 --- a/formats/data/opentype/woff/valid-005.snap +++ b/formats/data/opentype/woff/valid-005.snap @@ -1432,7 +1432,18 @@ stdout = ''' ], ] 3584 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -154, + underline_thickness = 102, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap index 11dca7646..03608c2bf 100644 --- a/formats/data/opentype/woff2/SFNT-TTF-Composite.snap +++ b/formats/data/opentype/woff2/SFNT-TTF-Composite.snap @@ -1516,7 +1516,18 @@ stdout = ''' ], ] 3860 = [ - {}, + { + version = 196608, + italic_angle = 0, + underline_position = -154, + underline_thickness = 102, + is_fixed_pitch = 0, + min_mem_type42 = 0, + max_mem_type42 = 0, + min_mem_type1 = 0, + max_mem_type1 = 0, + names = {}, + }, ] ''' stderr = '' diff --git a/formats/opentype.fathom b/formats/opentype.fathom index 86c5527ef..2d5336fb1 100644 --- a/formats/opentype.fathom +++ b/formats/opentype.fathom @@ -1052,14 +1052,12 @@ let simple_glyph = fun (number_of_contours : U16) => { instruction_length <- u16be, /// Array of instruction byte code for the glyph. instructions <- array16 instruction_length u8, - /// Array of flag elements. See below for details regarding the number of flag array elements. + /// Array of flag elements. // flags[variable] <- uint8, - /// xCoordinates[variable] Contour point x-coordinates. See below for details regarding the - /// number of coordinate array elements. Coordinate for the first point is relative to (0,0); + /// xCoordinates[variable] Contour point x-coordinates. Coordinate for the first point is relative to (0,0); /// others are relative to previous point. // or int16 <- uint8, - /// yCoordinates[variable] Contour point y-coordinates. See below for details regarding the - /// number of coordinate array elements. Coordinate for the first point is relative to (0,0); + /// yCoordinates[variable] Contour point y-coordinates. Coordinate for the first point is relative to (0,0); /// others are relative to previous point. // or int16 <- uint8, }; @@ -1225,6 +1223,70 @@ let os2_table = fun (table_length : U32) => { // ----------------------------------------------------------------------------- + + +/// # PostScript Table +/// +/// ## References +/// +/// - [Microsoft's OpenType Spec: Glyph Data](https://docs.microsoft.com/en-us/typography/opentype/spec/post) +/// - [Apple's TrueType Reference Manual: The `'post'` table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html) +let post_table = { + /// 0x00010000 for version 1.0 0x00020000 for version 2.0 + /// 0x00025000 for version 2.5 (deprecated) 0x00030000 for version 3.0 + version <- version16dot16, + /// Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, + /// negative for text that leans to the right (forward). + italic_angle <- fixed, + /// This is the suggested distance of the top of the underline from the baseline (negative + /// values indicate below baseline). The PostScript definition of this FontInfo dictionary key + /// (the y coordinate of the center of the stroke) is not used for historical reasons. The + /// value of the PostScript key may be calculated by subtracting half the underlineThickness + /// from the value of this field. + underline_position <- fword, + /// Suggested values for the underline thickness. In general, the underline thickness should + /// match the thickness of the underscore character (U+005F LOW LINE), and should also match + /// the strikeout thickness, which is specified in the OS/2 table. + underline_thickness <- fword, + /// Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally + /// spaced (i.e. monospaced). + is_fixed_pitch <- u32be, + /// Minimum memory usage when an OpenType font is downloaded. + min_mem_type42 <- u32be, + /// Maximum memory usage when an OpenType font is downloaded. + max_mem_type42 <- u32be, + /// Minimum memory usage when an OpenType font is downloaded as a Type 1 font. + min_mem_type1 <- u32be, + /// Maximum memory usage when an OpenType font is downloaded as a Type 1 font. + max_mem_type1 <- u32be, + names <- match version { + /// Version 1, standard Macintosh names + 0x00010000 => {}, + /// Version 2, non-stanard names stored in table as Pascal strings + 0x00020000 => { + /// Number of glyphs (this should be the same as numGlyphs in 'maxp' table). + num_glyphs <- u16be, + /// Array of indices into the string data. + glyph_name_index <- array16 num_glyphs u16be, + /// Storage for the string data. + string_data <- stream_pos, + }, + /// Version 2.5 (deprecated), offset from standard Macintosh index + 0x00025000 => { + /// Number of glyphs + num_glyphs <- u16be, + /// Difference between graphic index and standard order of glyph + offset <- array16 num_glyphs s8, + }, + /// Version 3, no glyph names stored in font + 0x00030000 => {}, + _ => fail, + } +}; + + +// ----------------------------------------------------------------------------- + // TODO: "PCLT" .. "sbix" tables @@ -1428,7 +1490,7 @@ let table_directory = fun (file_start : Pos) => { }, name <- required_table "name" name_table, os2 <- required_table_with_len "OS/2" os2_table, - post <- required_table "post" unknown_table, + post <- required_table "post" post_table, // TrueType Outline Tables // diff --git a/formats/opentype.snap b/formats/opentype.snap index 2e1b978eb..dc6ec43db 100644 --- a/formats/opentype.snap +++ b/formats/opentype.snap @@ -345,6 +345,31 @@ let os2_table : _ = fun table_length => { _ => fail, }, }; +let post_table : _ = { + version <- version16dot16, + italic_angle <- fixed, + underline_position <- fword, + underline_thickness <- fword, + is_fixed_pitch <- u32be, + min_mem_type42 <- u32be, + max_mem_type42 <- u32be, + min_mem_type1 <- u32be, + max_mem_type1 <- u32be, + names <- match version { + 0x10000 => {}, + 0x20000 => { + num_glyphs <- u16be, + glyph_name_index <- array16 num_glyphs u16be, + string_data <- stream_pos, + }, + 0x25000 => { + num_glyphs <- u16be, + offset <- array16 num_glyphs s8, + }, + 0x30000 => {}, + _ => fail, + }, +}; let base_table : _ = unknown_table; let gdef_table : _ = unknown_table; let gpos_table : _ = unknown_table; @@ -399,7 +424,7 @@ let table_directory : _ = fun file_start => { }, name <- required_table "name" name_table, os2 <- required_table_with_len "OS/2" os2_table, - post <- required_table "post" unknown_table, + post <- required_table "post" post_table, cvt <- optional_table "cvt " unknown_table, fpgm <- optional_table "fpgm" unknown_table, glyf <- optional_table "glyf" { From fd85d294600c60e4afa8854b4b7846616139b6d3 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Wed, 4 May 2022 16:39:56 +1000 Subject: [PATCH 4/4] Don't fail on unknown OS/2 and post table versions --- formats/opentype.fathom | 11 +++++++++-- formats/opentype.snap | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/formats/opentype.fathom b/formats/opentype.fathom index 2d5336fb1..676068a24 100644 --- a/formats/opentype.fathom +++ b/formats/opentype.fathom @@ -1217,7 +1217,9 @@ let os2_table = fun (table_length : U32) => { 3 => os2_version_2_3_4, 4 => os2_version_2_3_4, 5 => os2_version_5, - _ => fail, + // The previous OS/2 versions are all additive. So if we encounter a newer version try + // reading it as the newest one we know about. + _ => os2_version_5, } }; @@ -1279,8 +1281,13 @@ let post_table = { offset <- array16 num_glyphs s8, }, /// Version 3, no glyph names stored in font + /// + /// This version is required for CFF fonts. 0x00030000 => {}, - _ => fail, + // Apple defines a version 4 but it's not part of OpenType and says it + // should be avoided: + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html + _ => {}, } }; diff --git a/formats/opentype.snap b/formats/opentype.snap index dc6ec43db..c9471a13f 100644 --- a/formats/opentype.snap +++ b/formats/opentype.snap @@ -342,7 +342,7 @@ let os2_table : _ = fun table_length => { 3 => os2_version_2_3_4, 4 => os2_version_2_3_4, 5 => os2_version_5, - _ => fail, + _ => os2_version_5, }, }; let post_table : _ = { @@ -367,7 +367,7 @@ let post_table : _ = { offset <- array16 num_glyphs s8, }, 0x30000 => {}, - _ => fail, + _ => {}, }, }; let base_table : _ = unknown_table;