🐛 Fix font weight/style metadata (#186)

This fixes a bug that Bold is interpreted as a standard font style (instead of Book) by some applications and operating systems.

This sets correct values to following metadata:
* head: macStyle: https://learn.microsoft.com/en-us/typography/opentype/spec/head
* OS/2: fsSelection: https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection
* OS/2: usWeightClass: https://learn.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass
This commit is contained in:
Tomek Weksej
2024-03-20 15:36:17 +01:00
committed by GitHub
parent 1babf4977d
commit 7554d7ab76
13 changed files with 65 additions and 14 deletions
+3
View File
@@ -291,6 +291,9 @@ const patchHmtx = (dom) => {
copyConfigAttribute(dom, configDom, '/ttFont/hhea/advanceWidthMax', 'value');
copyConfigAttribute(dom, configDom, '/ttFont/hhea/xMaxExtent', 'value');
copyConfigAttribute(dom, configDom, '/ttFont/CFF/CFFFont/FontBBox', 'value');
copyConfigAttribute(dom, configDom, '/ttFont/head/macStyle', 'value');
copyConfigAttribute(dom, configDom, '/ttFont/OS_2/fsSelection', 'value');
copyConfigAttribute(dom, configDom, '/ttFont/OS_2/usWeightClass', 'value');
copyConfigAttribute(
dom,
configDom,