@wordpress/edit-site 6.33.3 → 6.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (654) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-editor/use-site-editor-settings.js +14 -2
  3. package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
  4. package/build/components/canvas-loader/index.js +5 -8
  5. package/build/components/canvas-loader/index.js.map +3 -3
  6. package/build/components/editor/index.js +2 -40
  7. package/build/components/editor/index.js.map +3 -3
  8. package/build/components/layout/index.js +5 -7
  9. package/build/components/layout/index.js.map +3 -3
  10. package/build/components/page-patterns/fields.js +4 -3
  11. package/build/components/page-patterns/fields.js.map +3 -3
  12. package/build/components/page-templates/fields.js +2 -2
  13. package/build/components/page-templates/fields.js.map +3 -3
  14. package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +22 -46
  15. package/build/components/sidebar-global-styles/index.js.map +7 -0
  16. package/build/components/sidebar-navigation-screen-global-styles/content.js +38 -16
  17. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
  18. package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -7
  19. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
  20. package/build/components/sidebar-navigation-screen-main/index.js +0 -9
  21. package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
  22. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  23. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  24. package/build/components/site-editor-routes/stylebook.js +5 -3
  25. package/build/components/site-editor-routes/stylebook.js.map +3 -3
  26. package/build/components/site-editor-routes/styles.js +33 -11
  27. package/build/components/site-editor-routes/styles.js.map +3 -3
  28. package/build/components/welcome-guide/index.js +0 -2
  29. package/build/components/welcome-guide/index.js.map +3 -3
  30. package/build/hooks/commands/use-common-commands.js +10 -12
  31. package/build/hooks/commands/use-common-commands.js.map +3 -3
  32. package/build/hooks/commands/use-set-command-context.js +0 -5
  33. package/build/hooks/commands/use-set-command-context.js.map +2 -2
  34. package/build/index.js +0 -1
  35. package/build/index.js.map +2 -2
  36. package/build/posts.js +0 -1
  37. package/build/posts.js.map +2 -2
  38. package/build/store/private-actions.js +0 -8
  39. package/build/store/private-actions.js.map +2 -2
  40. package/build/store/private-selectors.js +0 -5
  41. package/build/store/private-selectors.js.map +2 -2
  42. package/build/store/reducer.js +0 -8
  43. package/build/store/reducer.js.map +2 -2
  44. package/build-module/components/block-editor/use-site-editor-settings.js +14 -2
  45. package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
  46. package/build-module/components/canvas-loader/index.js +5 -8
  47. package/build-module/components/canvas-loader/index.js.map +2 -2
  48. package/build-module/components/editor/index.js +4 -46
  49. package/build-module/components/editor/index.js.map +2 -2
  50. package/build-module/components/layout/index.js +5 -7
  51. package/build-module/components/layout/index.js.map +2 -2
  52. package/build-module/components/page-patterns/fields.js +5 -7
  53. package/build-module/components/page-patterns/fields.js.map +2 -2
  54. package/build-module/components/page-templates/fields.js +6 -6
  55. package/build-module/components/page-templates/fields.js.map +2 -2
  56. package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +21 -41
  57. package/build-module/components/sidebar-global-styles/index.js.map +7 -0
  58. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +42 -6
  59. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
  60. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -6
  61. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
  62. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -10
  63. package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
  64. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  65. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  66. package/build-module/components/site-editor-routes/stylebook.js +3 -1
  67. package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
  68. package/build-module/components/site-editor-routes/styles.js +31 -9
  69. package/build-module/components/site-editor-routes/styles.js.map +2 -2
  70. package/build-module/components/welcome-guide/index.js +0 -2
  71. package/build-module/components/welcome-guide/index.js.map +2 -2
  72. package/build-module/hooks/commands/use-common-commands.js +13 -12
  73. package/build-module/hooks/commands/use-common-commands.js.map +2 -2
  74. package/build-module/hooks/commands/use-set-command-context.js +0 -5
  75. package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
  76. package/build-module/index.js +0 -1
  77. package/build-module/index.js.map +2 -2
  78. package/build-module/posts.js +0 -1
  79. package/build-module/posts.js.map +2 -2
  80. package/build-module/store/private-actions.js +0 -7
  81. package/build-module/store/private-actions.js.map +2 -2
  82. package/build-module/store/private-selectors.js +0 -4
  83. package/build-module/store/private-selectors.js.map +2 -2
  84. package/build-module/store/reducer.js +0 -8
  85. package/build-module/store/reducer.js.map +2 -2
  86. package/build-style/posts-rtl.css +13 -50
  87. package/build-style/posts.css +13 -50
  88. package/build-style/style-rtl.css +722 -726
  89. package/build-style/style.css +722 -726
  90. package/package.json +49 -44
  91. package/src/components/block-editor/use-site-editor-settings.js +21 -2
  92. package/src/components/canvas-loader/index.js +5 -9
  93. package/src/components/editor/index.js +2 -50
  94. package/src/components/layout/index.js +6 -10
  95. package/src/components/page-patterns/fields.js +5 -7
  96. package/src/components/page-templates/fields.js +6 -6
  97. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
  98. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
  99. package/src/components/sidebar-navigation-screen/style.scss +5 -12
  100. package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
  101. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
  102. package/src/components/sidebar-navigation-screen-main/index.js +1 -12
  103. package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
  104. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  105. package/src/components/site-editor-routes/stylebook.js +4 -1
  106. package/src/components/site-editor-routes/styles.js +35 -9
  107. package/src/components/site-hub/style.scss +1 -1
  108. package/src/components/welcome-guide/index.js +0 -2
  109. package/src/components/welcome-guide/style.scss +1 -2
  110. package/src/hooks/commands/use-common-commands.js +19 -12
  111. package/src/hooks/commands/use-set-command-context.js +0 -11
  112. package/src/index.js +0 -1
  113. package/src/posts.js +0 -1
  114. package/src/posts.scss +0 -1
  115. package/src/store/private-actions.js +0 -14
  116. package/src/store/private-selectors.js +0 -11
  117. package/src/store/reducer.js +0 -18
  118. package/src/style.scss +2 -9
  119. package/tsconfig.json +3 -11
  120. package/build/components/editor-canvas-container/index.js +0 -139
  121. package/build/components/editor-canvas-container/index.js.map +0 -7
  122. package/build/components/global-styles/background-panel.js +0 -62
  123. package/build/components/global-styles/background-panel.js.map +0 -7
  124. package/build/components/global-styles/block-preview-panel.js +0 -87
  125. package/build/components/global-styles/block-preview-panel.js.map +0 -7
  126. package/build/components/global-styles/color-indicator-wrapper.js +0 -50
  127. package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
  128. package/build/components/global-styles/color-palette-panel.js +0 -133
  129. package/build/components/global-styles/color-palette-panel.js.map +0 -7
  130. package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
  131. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  132. package/build/components/global-styles/dimensions-panel.js +0 -92
  133. package/build/components/global-styles/dimensions-panel.js.map +0 -7
  134. package/build/components/global-styles/font-families.js +0 -114
  135. package/build/components/global-styles/font-families.js.map +0 -7
  136. package/build/components/global-styles/font-family-item.js +0 -48
  137. package/build/components/global-styles/font-family-item.js.map +0 -7
  138. package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
  139. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  140. package/build/components/global-styles/font-library-modal/context.js +0 -386
  141. package/build/components/global-styles/font-library-modal/context.js.map +0 -7
  142. package/build/components/global-styles/font-library-modal/font-card.js +0 -76
  143. package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
  144. package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
  145. package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  146. package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
  147. package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  148. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
  149. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  150. package/build/components/global-styles/font-library-modal/index.js +0 -110
  151. package/build/components/global-styles/font-library-modal/index.js.map +0 -7
  152. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
  153. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  154. package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
  155. package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  156. package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
  157. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  158. package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
  159. package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  160. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
  161. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  162. package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
  163. package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  164. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
  165. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  166. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
  167. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  168. package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
  169. package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  170. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
  171. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  172. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
  173. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  174. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
  175. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  176. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
  177. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  178. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
  179. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  180. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
  181. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  182. package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
  183. package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  184. package/build/components/global-styles/font-sizes/font-size.js +0 -260
  185. package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
  186. package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
  187. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  188. package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
  189. package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  190. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
  191. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  192. package/build/components/global-styles/gradients-palette-panel.js +0 -144
  193. package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
  194. package/build/components/global-styles/header.js +0 -54
  195. package/build/components/global-styles/header.js.map +0 -7
  196. package/build/components/global-styles/highlighted-colors.js +0 -57
  197. package/build/components/global-styles/highlighted-colors.js.map +0 -7
  198. package/build/components/global-styles/hooks.js +0 -113
  199. package/build/components/global-styles/hooks.js.map +0 -7
  200. package/build/components/global-styles/icon-with-current-color.js +0 -53
  201. package/build/components/global-styles/icon-with-current-color.js.map +0 -7
  202. package/build/components/global-styles/index.js +0 -39
  203. package/build/components/global-styles/index.js.map +0 -7
  204. package/build/components/global-styles/navigation-button.js +0 -48
  205. package/build/components/global-styles/navigation-button.js.map +0 -7
  206. package/build/components/global-styles/palette.js +0 -86
  207. package/build/components/global-styles/palette.js.map +0 -7
  208. package/build/components/global-styles/preset-colors.js +0 -40
  209. package/build/components/global-styles/preset-colors.js.map +0 -7
  210. package/build/components/global-styles/preview-colors.js +0 -82
  211. package/build/components/global-styles/preview-colors.js.map +0 -7
  212. package/build/components/global-styles/preview-styles.js +0 -214
  213. package/build/components/global-styles/preview-styles.js.map +0 -7
  214. package/build/components/global-styles/preview-typography.js +0 -68
  215. package/build/components/global-styles/preview-typography.js.map +0 -7
  216. package/build/components/global-styles/preview-wrapper.js +0 -101
  217. package/build/components/global-styles/preview-wrapper.js.map +0 -7
  218. package/build/components/global-styles/root-menu.js +0 -72
  219. package/build/components/global-styles/root-menu.js.map +0 -7
  220. package/build/components/global-styles/screen-background.js +0 -59
  221. package/build/components/global-styles/screen-background.js.map +0 -7
  222. package/build/components/global-styles/screen-block-list.js +0 -170
  223. package/build/components/global-styles/screen-block-list.js.map +0 -7
  224. package/build/components/global-styles/screen-block.js +0 -316
  225. package/build/components/global-styles/screen-block.js.map +0 -7
  226. package/build/components/global-styles/screen-color-palette.js +0 -64
  227. package/build/components/global-styles/screen-color-palette.js.map +0 -7
  228. package/build/components/global-styles/screen-colors.js +0 -81
  229. package/build/components/global-styles/screen-colors.js.map +0 -7
  230. package/build/components/global-styles/screen-css.js +0 -92
  231. package/build/components/global-styles/screen-css.js.map +0 -7
  232. package/build/components/global-styles/screen-layout.js +0 -51
  233. package/build/components/global-styles/screen-layout.js.map +0 -7
  234. package/build/components/global-styles/screen-revisions/index.js +0 -179
  235. package/build/components/global-styles/screen-revisions/index.js.map +0 -7
  236. package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
  237. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  238. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
  239. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  240. package/build/components/global-styles/screen-root.js +0 -99
  241. package/build/components/global-styles/screen-root.js.map +0 -7
  242. package/build/components/global-styles/screen-shadows.js +0 -49
  243. package/build/components/global-styles/screen-shadows.js.map +0 -7
  244. package/build/components/global-styles/screen-style-variations.js +0 -70
  245. package/build/components/global-styles/screen-style-variations.js.map +0 -7
  246. package/build/components/global-styles/screen-typography-element.js +0 -167
  247. package/build/components/global-styles/screen-typography-element.js.map +0 -7
  248. package/build/components/global-styles/screen-typography.js +0 -68
  249. package/build/components/global-styles/screen-typography.js.map +0 -7
  250. package/build/components/global-styles/shadow-utils.js +0 -125
  251. package/build/components/global-styles/shadow-utils.js.map +0 -7
  252. package/build/components/global-styles/shadows-edit-panel.js +0 -501
  253. package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
  254. package/build/components/global-styles/shadows-panel.js +0 -206
  255. package/build/components/global-styles/shadows-panel.js.map +0 -7
  256. package/build/components/global-styles/size-control/index.js +0 -80
  257. package/build/components/global-styles/size-control/index.js.map +0 -7
  258. package/build/components/global-styles/style-variations-container.js +0 -124
  259. package/build/components/global-styles/style-variations-container.js.map +0 -7
  260. package/build/components/global-styles/subtitle.js +0 -37
  261. package/build/components/global-styles/subtitle.js.map +0 -7
  262. package/build/components/global-styles/typeset.js +0 -78
  263. package/build/components/global-styles/typeset.js.map +0 -7
  264. package/build/components/global-styles/typography-elements.js +0 -123
  265. package/build/components/global-styles/typography-elements.js.map +0 -7
  266. package/build/components/global-styles/typography-example.js +0 -81
  267. package/build/components/global-styles/typography-example.js.map +0 -7
  268. package/build/components/global-styles/typography-panel.js +0 -69
  269. package/build/components/global-styles/typography-panel.js.map +0 -7
  270. package/build/components/global-styles/typography-preview.js +0 -80
  271. package/build/components/global-styles/typography-preview.js.map +0 -7
  272. package/build/components/global-styles/ui.js +0 -355
  273. package/build/components/global-styles/ui.js.map +0 -7
  274. package/build/components/global-styles/utils.js +0 -92
  275. package/build/components/global-styles/utils.js.map +0 -7
  276. package/build/components/global-styles/variations/variation.js +0 -118
  277. package/build/components/global-styles/variations/variation.js.map +0 -7
  278. package/build/components/global-styles/variations/variations-color.js +0 -61
  279. package/build/components/global-styles/variations/variations-color.js.map +0 -7
  280. package/build/components/global-styles/variations/variations-panel.js +0 -71
  281. package/build/components/global-styles/variations/variations-panel.js.map +0 -7
  282. package/build/components/global-styles/variations/variations-typography.js +0 -75
  283. package/build/components/global-styles/variations/variations-typography.js.map +0 -7
  284. package/build/components/global-styles-renderer/index.js +0 -57
  285. package/build/components/global-styles-renderer/index.js.map +0 -7
  286. package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
  287. package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  288. package/build/components/global-styles-sidebar/index.js +0 -202
  289. package/build/components/global-styles-sidebar/index.js.map +0 -7
  290. package/build/components/revisions/index.js +0 -120
  291. package/build/components/revisions/index.js.map +0 -7
  292. package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  293. package/build/components/style-book/categories.js +0 -86
  294. package/build/components/style-book/categories.js.map +0 -7
  295. package/build/components/style-book/color-examples.js +0 -65
  296. package/build/components/style-book/color-examples.js.map +0 -7
  297. package/build/components/style-book/constants.js +0 -319
  298. package/build/components/style-book/constants.js.map +0 -7
  299. package/build/components/style-book/duotone-examples.js +0 -69
  300. package/build/components/style-book/duotone-examples.js.map +0 -7
  301. package/build/components/style-book/examples.js +0 -237
  302. package/build/components/style-book/examples.js.map +0 -7
  303. package/build/components/style-book/index.js +0 -644
  304. package/build/components/style-book/index.js.map +0 -7
  305. package/build/components/style-book/types.js +0 -17
  306. package/build/components/style-book/types.js.map +0 -7
  307. package/build/components/welcome-guide/styles.js +0 -145
  308. package/build/components/welcome-guide/styles.js.map +0 -7
  309. package/build/hooks/index.js +0 -3
  310. package/build/hooks/index.js.map +0 -7
  311. package/build/hooks/push-changes-to-global-styles/index.js +0 -319
  312. package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
  313. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
  314. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  315. package/build/utils/set-nested-value.js +0 -43
  316. package/build/utils/set-nested-value.js.map +0 -7
  317. package/build-module/components/editor-canvas-container/index.js +0 -120
  318. package/build-module/components/editor-canvas-container/index.js.map +0 -7
  319. package/build-module/components/global-styles/background-panel.js +0 -38
  320. package/build-module/components/global-styles/background-panel.js.map +0 -7
  321. package/build-module/components/global-styles/block-preview-panel.js +0 -67
  322. package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
  323. package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
  324. package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
  325. package/build-module/components/global-styles/color-palette-panel.js +0 -107
  326. package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
  327. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
  328. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  329. package/build-module/components/global-styles/dimensions-panel.js +0 -72
  330. package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
  331. package/build-module/components/global-styles/font-families.js +0 -92
  332. package/build-module/components/global-styles/font-families.js.map +0 -7
  333. package/build-module/components/global-styles/font-family-item.js +0 -32
  334. package/build-module/components/global-styles/font-family-item.js.map +0 -7
  335. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
  336. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  337. package/build-module/components/global-styles/font-library-modal/context.js +0 -372
  338. package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
  339. package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
  340. package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
  341. package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
  342. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  343. package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
  344. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  345. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
  346. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  347. package/build-module/components/global-styles/font-library-modal/index.js +0 -83
  348. package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
  349. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
  350. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  351. package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
  352. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  353. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
  354. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  355. package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
  356. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  357. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
  358. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  359. package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
  360. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  361. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
  362. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  363. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
  364. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  365. package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
  366. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  367. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
  368. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  369. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
  370. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  371. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
  372. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  373. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
  374. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  375. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
  376. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  377. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
  378. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  379. package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
  380. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  381. package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
  382. package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
  383. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
  384. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  385. package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
  386. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  387. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
  388. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  389. package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
  390. package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
  391. package/build-module/components/global-styles/header.js +0 -41
  392. package/build-module/components/global-styles/header.js.map +0 -7
  393. package/build-module/components/global-styles/highlighted-colors.js +0 -37
  394. package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
  395. package/build-module/components/global-styles/hooks.js +0 -77
  396. package/build-module/components/global-styles/hooks.js.map +0 -7
  397. package/build-module/components/global-styles/icon-with-current-color.js +0 -19
  398. package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
  399. package/build-module/components/global-styles/index.js +0 -5
  400. package/build-module/components/global-styles/index.js.map +0 -7
  401. package/build-module/components/global-styles/navigation-button.js +0 -28
  402. package/build-module/components/global-styles/navigation-button.js.map +0 -7
  403. package/build-module/components/global-styles/palette.js +0 -63
  404. package/build-module/components/global-styles/palette.js.map +0 -7
  405. package/build-module/components/global-styles/preset-colors.js +0 -20
  406. package/build-module/components/global-styles/preset-colors.js.map +0 -7
  407. package/build-module/components/global-styles/preview-colors.js +0 -55
  408. package/build-module/components/global-styles/preview-colors.js.map +0 -7
  409. package/build-module/components/global-styles/preview-styles.js +0 -188
  410. package/build-module/components/global-styles/preview-styles.js.map +0 -7
  411. package/build-module/components/global-styles/preview-typography.js +0 -38
  412. package/build-module/components/global-styles/preview-typography.js.map +0 -7
  413. package/build-module/components/global-styles/preview-wrapper.js +0 -85
  414. package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
  415. package/build-module/components/global-styles/root-menu.js +0 -58
  416. package/build-module/components/global-styles/root-menu.js.map +0 -7
  417. package/build-module/components/global-styles/screen-background.js +0 -29
  418. package/build-module/components/global-styles/screen-background.js.map +0 -7
  419. package/build-module/components/global-styles/screen-block-list.js +0 -150
  420. package/build-module/components/global-styles/screen-block-list.js.map +0 -7
  421. package/build-module/components/global-styles/screen-block.js +0 -293
  422. package/build-module/components/global-styles/screen-block.js.map +0 -7
  423. package/build-module/components/global-styles/screen-color-palette.js +0 -34
  424. package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
  425. package/build-module/components/global-styles/screen-colors.js +0 -51
  426. package/build-module/components/global-styles/screen-colors.js.map +0 -7
  427. package/build-module/components/global-styles/screen-css.js +0 -62
  428. package/build-module/components/global-styles/screen-css.js.map +0 -7
  429. package/build-module/components/global-styles/screen-layout.js +0 -21
  430. package/build-module/components/global-styles/screen-layout.js.map +0 -7
  431. package/build-module/components/global-styles/screen-revisions/index.js +0 -155
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
  434. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  435. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
  436. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  437. package/build-module/components/global-styles/screen-root.js +0 -79
  438. package/build-module/components/global-styles/screen-root.js.map +0 -7
  439. package/build-module/components/global-styles/screen-shadows.js +0 -14
  440. package/build-module/components/global-styles/screen-shadows.js.map +0 -7
  441. package/build-module/components/global-styles/screen-style-variations.js +0 -43
  442. package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
  443. package/build-module/components/global-styles/screen-typography-element.js +0 -141
  444. package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
  445. package/build-module/components/global-styles/screen-typography.js +0 -38
  446. package/build-module/components/global-styles/screen-typography.js.map +0 -7
  447. package/build-module/components/global-styles/shadow-utils.js +0 -98
  448. package/build-module/components/global-styles/shadow-utils.js.map +0 -7
  449. package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
  450. package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
  451. package/build-module/components/global-styles/shadows-panel.js +0 -185
  452. package/build-module/components/global-styles/shadows-panel.js.map +0 -7
  453. package/build-module/components/global-styles/size-control/index.js +0 -70
  454. package/build-module/components/global-styles/size-control/index.js.map +0 -7
  455. package/build-module/components/global-styles/style-variations-container.js +0 -94
  456. package/build-module/components/global-styles/style-variations-container.js.map +0 -7
  457. package/build-module/components/global-styles/subtitle.js +0 -17
  458. package/build-module/components/global-styles/subtitle.js.map +0 -7
  459. package/build-module/components/global-styles/typeset.js +0 -54
  460. package/build-module/components/global-styles/typeset.js.map +0 -7
  461. package/build-module/components/global-styles/typography-elements.js +0 -98
  462. package/build-module/components/global-styles/typography-elements.js.map +0 -7
  463. package/build-module/components/global-styles/typography-example.js +0 -61
  464. package/build-module/components/global-styles/typography-example.js.map +0 -7
  465. package/build-module/components/global-styles/typography-panel.js +0 -49
  466. package/build-module/components/global-styles/typography-panel.js.map +0 -7
  467. package/build-module/components/global-styles/typography-preview.js +0 -60
  468. package/build-module/components/global-styles/typography-preview.js.map +0 -7
  469. package/build-module/components/global-styles/ui.js +0 -334
  470. package/build-module/components/global-styles/ui.js.map +0 -7
  471. package/build-module/components/global-styles/utils.js +0 -66
  472. package/build-module/components/global-styles/utils.js.map +0 -7
  473. package/build-module/components/global-styles/variations/variation.js +0 -88
  474. package/build-module/components/global-styles/variations/variation.js.map +0 -7
  475. package/build-module/components/global-styles/variations/variations-color.js +0 -34
  476. package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
  477. package/build-module/components/global-styles/variations/variations-panel.js +0 -46
  478. package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
  479. package/build-module/components/global-styles/variations/variations-typography.js +0 -48
  480. package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
  481. package/build-module/components/global-styles-renderer/index.js +0 -33
  482. package/build-module/components/global-styles-renderer/index.js.map +0 -7
  483. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
  484. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  485. package/build-module/components/global-styles-sidebar/index.js +0 -175
  486. package/build-module/components/global-styles-sidebar/index.js.map +0 -7
  487. package/build-module/components/revisions/index.js +0 -96
  488. package/build-module/components/revisions/index.js.map +0 -7
  489. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  490. package/build-module/components/style-book/categories.js +0 -64
  491. package/build-module/components/style-book/categories.js.map +0 -7
  492. package/build-module/components/style-book/color-examples.js +0 -38
  493. package/build-module/components/style-book/color-examples.js.map +0 -7
  494. package/build-module/components/style-book/constants.js +0 -290
  495. package/build-module/components/style-book/constants.js.map +0 -7
  496. package/build-module/components/style-book/duotone-examples.js +0 -49
  497. package/build-module/components/style-book/duotone-examples.js.map +0 -7
  498. package/build-module/components/style-book/examples.js +0 -208
  499. package/build-module/components/style-book/examples.js.map +0 -7
  500. package/build-module/components/style-book/index.js +0 -635
  501. package/build-module/components/style-book/index.js.map +0 -7
  502. package/build-module/components/style-book/types.js +0 -1
  503. package/build-module/components/style-book/types.js.map +0 -7
  504. package/build-module/components/welcome-guide/styles.js +0 -115
  505. package/build-module/components/welcome-guide/styles.js.map +0 -7
  506. package/build-module/hooks/index.js +0 -2
  507. package/build-module/hooks/index.js.map +0 -7
  508. package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
  509. package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
  510. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
  511. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  512. package/build-module/utils/set-nested-value.js +0 -23
  513. package/build-module/utils/set-nested-value.js.map +0 -7
  514. package/build-types/components/style-book/categories.d.ts +0 -18
  515. package/build-types/components/style-book/categories.d.ts.map +0 -1
  516. package/build-types/components/style-book/color-examples.d.ts +0 -7
  517. package/build-types/components/style-book/color-examples.d.ts.map +0 -1
  518. package/build-types/components/style-book/constants.d.ts +0 -11
  519. package/build-types/components/style-book/constants.d.ts.map +0 -1
  520. package/build-types/components/style-book/duotone-examples.d.ts +0 -9
  521. package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
  522. package/build-types/components/style-book/examples.d.ts +0 -12
  523. package/build-types/components/style-book/examples.d.ts.map +0 -1
  524. package/build-types/components/style-book/types.d.ts +0 -72
  525. package/build-types/components/style-book/types.d.ts.map +0 -1
  526. package/lib/inflate.js +0 -3333
  527. package/lib/lib-font.browser.js +0 -3861
  528. package/lib/unbrotli.js +0 -2039
  529. package/src/components/editor-canvas-container/index.js +0 -149
  530. package/src/components/editor-canvas-container/style.scss +0 -43
  531. package/src/components/global-styles/README.md +0 -17
  532. package/src/components/global-styles/background-panel.js +0 -55
  533. package/src/components/global-styles/block-preview-panel.js +0 -81
  534. package/src/components/global-styles/color-indicator-wrapper.js +0 -23
  535. package/src/components/global-styles/color-palette-panel.js +0 -110
  536. package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
  537. package/src/components/global-styles/dimensions-panel.js +0 -86
  538. package/src/components/global-styles/font-families.js +0 -128
  539. package/src/components/global-styles/font-family-item.js +0 -47
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
  541. package/src/components/global-styles/font-library-modal/context.js +0 -540
  542. package/src/components/global-styles/font-library-modal/font-card.js +0 -67
  543. package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
  544. package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
  545. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
  546. package/src/components/global-styles/font-library-modal/index.js +0 -106
  547. package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
  548. package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
  549. package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
  550. package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
  551. package/src/components/global-styles/font-library-modal/style.scss +0 -220
  552. package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
  553. package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
  554. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
  555. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
  556. package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
  557. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
  558. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
  559. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
  560. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
  561. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
  562. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
  563. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
  564. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
  565. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
  566. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
  567. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
  568. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
  569. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
  570. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
  571. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
  572. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
  573. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
  574. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
  575. package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
  576. package/src/components/global-styles/font-sizes/font-size.js +0 -265
  577. package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
  578. package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
  579. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
  580. package/src/components/global-styles/gradients-palette-panel.js +0 -123
  581. package/src/components/global-styles/header.js +0 -48
  582. package/src/components/global-styles/highlighted-colors.js +0 -39
  583. package/src/components/global-styles/hooks.js +0 -111
  584. package/src/components/global-styles/icon-with-current-color.js +0 -21
  585. package/src/components/global-styles/index.js +0 -1
  586. package/src/components/global-styles/navigation-button.js +0 -38
  587. package/src/components/global-styles/palette.js +0 -90
  588. package/src/components/global-styles/preset-colors.js +0 -18
  589. package/src/components/global-styles/preview-colors.js +0 -58
  590. package/src/components/global-styles/preview-styles.js +0 -185
  591. package/src/components/global-styles/preview-typography.js +0 -39
  592. package/src/components/global-styles/preview-wrapper.js +0 -126
  593. package/src/components/global-styles/root-menu.js +0 -84
  594. package/src/components/global-styles/screen-background.js +0 -37
  595. package/src/components/global-styles/screen-block-list.js +0 -187
  596. package/src/components/global-styles/screen-block.js +0 -358
  597. package/src/components/global-styles/screen-color-palette.js +0 -42
  598. package/src/components/global-styles/screen-colors.js +0 -55
  599. package/src/components/global-styles/screen-css.js +0 -67
  600. package/src/components/global-styles/screen-layout.js +0 -30
  601. package/src/components/global-styles/screen-revisions/index.js +0 -202
  602. package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
  603. package/src/components/global-styles/screen-revisions/style.scss +0 -194
  604. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
  605. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
  606. package/src/components/global-styles/screen-root.js +0 -102
  607. package/src/components/global-styles/screen-shadows.js +0 -13
  608. package/src/components/global-styles/screen-style-variations.js +0 -52
  609. package/src/components/global-styles/screen-typography-element.js +0 -121
  610. package/src/components/global-styles/screen-typography.js +0 -45
  611. package/src/components/global-styles/shadow-utils.js +0 -158
  612. package/src/components/global-styles/shadows-edit-panel.js +0 -525
  613. package/src/components/global-styles/shadows-panel.js +0 -196
  614. package/src/components/global-styles/size-control/index.js +0 -89
  615. package/src/components/global-styles/stories/index.story.js +0 -427
  616. package/src/components/global-styles/style-variations-container.js +0 -132
  617. package/src/components/global-styles/style.scss +0 -265
  618. package/src/components/global-styles/subtitle.js +0 -17
  619. package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
  620. package/src/components/global-styles/test/utils.spec.js +0 -59
  621. package/src/components/global-styles/typeset.js +0 -73
  622. package/src/components/global-styles/typography-elements.js +0 -102
  623. package/src/components/global-styles/typography-example.js +0 -76
  624. package/src/components/global-styles/typography-panel.js +0 -54
  625. package/src/components/global-styles/typography-preview.js +0 -70
  626. package/src/components/global-styles/ui.js +0 -448
  627. package/src/components/global-styles/utils.js +0 -88
  628. package/src/components/global-styles/variations/style.scss +0 -43
  629. package/src/components/global-styles/variations/variation.js +0 -108
  630. package/src/components/global-styles/variations/variations-color.js +0 -45
  631. package/src/components/global-styles/variations/variations-panel.js +0 -65
  632. package/src/components/global-styles/variations/variations-typography.js +0 -54
  633. package/src/components/global-styles-renderer/index.js +0 -42
  634. package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
  635. package/src/components/global-styles-sidebar/index.js +0 -206
  636. package/src/components/global-styles-sidebar/style.scss +0 -80
  637. package/src/components/revisions/index.js +0 -109
  638. package/src/components/style-book/categories.ts +0 -97
  639. package/src/components/style-book/color-examples.tsx +0 -57
  640. package/src/components/style-book/constants.ts +0 -308
  641. package/src/components/style-book/duotone-examples.tsx +0 -57
  642. package/src/components/style-book/examples.tsx +0 -273
  643. package/src/components/style-book/index.js +0 -804
  644. package/src/components/style-book/style.scss +0 -44
  645. package/src/components/style-book/test/categories.js +0 -166
  646. package/src/components/style-book/types.ts +0 -80
  647. package/src/components/welcome-guide/styles.js +0 -139
  648. package/src/hooks/index.js +0 -4
  649. package/src/hooks/push-changes-to-global-styles/index.js +0 -388
  650. package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
  651. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
  652. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
  653. package/src/utils/set-nested-value.js +0 -39
  654. package/tsconfig.tsbuildinfo +0 -1
@@ -1,3861 +0,0 @@
1
- /**
2
- * Credits:
3
- *
4
- * lib-font
5
- * https://github.com/Pomax/lib-font
6
- * https://github.com/Pomax/lib-font/blob/master/lib-font.browser.js
7
- *
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2020 pomax@nihongoresources.com
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /* eslint eslint-comments/no-unlimited-disable: 0 */
32
- /* eslint-disable */
33
- // import pako from 'pako';
34
- import unbrotli from "./unbrotli";
35
- import GzipDecode from "./inflate";
36
-
37
- let fetchFunction = globalThis.fetch;
38
- // if ( ! fetchFunction ) {
39
- // let backlog = [];
40
- // fetchFunction = globalThis.fetch = ( ...args ) =>
41
- // new Promise( ( resolve, reject ) => {
42
- // backlog.push( { args: args, resolve: resolve, reject: reject } );
43
- // } );
44
- // import( 'fs' )
45
- // .then( ( fs ) => {
46
- // fetchFunction = globalThis.fetch = async function ( path ) {
47
- // return new Promise( ( resolve, reject ) => {
48
- // fs.readFile( path, ( err, data ) => {
49
- // if ( err ) return reject( err );
50
- // resolve( { ok: true, arrayBuffer: () => data.buffer } );
51
- // } );
52
- // } );
53
- // };
54
- // while ( backlog.length ) {
55
- // let instruction = backlog.shift();
56
- // fetchFunction( ...instruction.args )
57
- // .then( ( data ) => instruction.resolve( data ) )
58
- // .catch( ( err ) => instruction.reject( err ) );
59
- // }
60
- // } )
61
- // .catch( ( err ) => {
62
- // console.error( err );
63
- // throw new Error(
64
- // `lib-font cannot run unless either the Fetch API or Node's filesystem module is available.`
65
- // );
66
- // } );
67
- // }
68
- class Event {
69
- constructor( type, detail = {}, msg ) {
70
- this.type = type;
71
- this.detail = detail;
72
- this.msg = msg;
73
- Object.defineProperty( this, `__mayPropagate`, {
74
- enumerable: false,
75
- writable: true,
76
- } );
77
- this.__mayPropagate = true;
78
- }
79
- preventDefault() {}
80
- stopPropagation() {
81
- this.__mayPropagate = false;
82
- }
83
- valueOf() {
84
- return this;
85
- }
86
- toString() {
87
- return this.msg
88
- ? `[${ this.type } event]: ${ this.msg }`
89
- : `[${ this.type } event]`;
90
- }
91
- }
92
- class EventManager {
93
- constructor() {
94
- this.listeners = {};
95
- }
96
- addEventListener( type, listener, useCapture ) {
97
- let bin = this.listeners[ type ] || [];
98
- if ( useCapture ) bin.unshift( listener );
99
- else bin.push( listener );
100
- this.listeners[ type ] = bin;
101
- }
102
- removeEventListener( type, listener ) {
103
- let bin = this.listeners[ type ] || [];
104
- let pos = bin.findIndex( ( e ) => e === listener );
105
- if ( pos > -1 ) {
106
- bin.splice( pos, 1 );
107
- this.listeners[ type ] = bin;
108
- }
109
- }
110
- dispatch( event ) {
111
- let bin = this.listeners[ event.type ];
112
- if ( bin ) {
113
- for ( let l = 0, e = bin.length; l < e; l++ ) {
114
- if ( ! event.__mayPropagate ) break;
115
- bin[ l ]( event );
116
- }
117
- }
118
- }
119
- }
120
- const startDate = new Date( `1904-01-01T00:00:00+0000` ).getTime();
121
- function asText( data ) {
122
- return Array.from( data )
123
- .map( ( v ) => String.fromCharCode( v ) )
124
- .join( `` );
125
- }
126
- class Parser {
127
- constructor( dict, dataview, name ) {
128
- this.name = ( name || dict.tag || `` ).trim();
129
- this.length = dict.length;
130
- this.start = dict.offset;
131
- this.offset = 0;
132
- this.data = dataview;
133
- [
134
- `getInt8`,
135
- `getUint8`,
136
- `getInt16`,
137
- `getUint16`,
138
- `getInt32`,
139
- `getUint32`,
140
- `getBigInt64`,
141
- `getBigUint64`,
142
- ].forEach( ( name ) => {
143
- let fn = name.replace( /get(Big)?/, '' ).toLowerCase();
144
- let increment = parseInt( name.replace( /[^\d]/g, '' ) ) / 8;
145
- Object.defineProperty( this, fn, {
146
- get: () => this.getValue( name, increment ),
147
- } );
148
- } );
149
- }
150
- get currentPosition() {
151
- return this.start + this.offset;
152
- }
153
- set currentPosition( position ) {
154
- this.start = position;
155
- this.offset = 0;
156
- }
157
- skip( n = 0, bits = 8 ) {
158
- this.offset += ( n * bits ) / 8;
159
- }
160
- getValue( type, increment ) {
161
- let pos = this.start + this.offset;
162
- this.offset += increment;
163
- try {
164
- return this.data[ type ]( pos );
165
- } catch ( e ) {
166
- console.error( `parser`, type, increment, this );
167
- console.error( `parser`, this.start, this.offset );
168
- throw e;
169
- }
170
- }
171
- flags( n ) {
172
- if ( n === 8 || n === 16 || n === 32 || n === 64 ) {
173
- return this[ `uint${ n }` ]
174
- .toString( 2 )
175
- .padStart( n, 0 )
176
- .split( `` )
177
- .map( ( v ) => v === '1' );
178
- }
179
- console.error(
180
- `Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long`
181
- );
182
- console.trace();
183
- }
184
- get tag() {
185
- const t = this.uint32;
186
- return asText( [
187
- ( t >> 24 ) & 255,
188
- ( t >> 16 ) & 255,
189
- ( t >> 8 ) & 255,
190
- t & 255,
191
- ] );
192
- }
193
- get fixed() {
194
- let major = this.int16;
195
- let minor = Math.round( ( 1e3 * this.uint16 ) / 65356 );
196
- return major + minor / 1e3;
197
- }
198
- get legacyFixed() {
199
- let major = this.uint16;
200
- let minor = this.uint16.toString( 16 ).padStart( 4, 0 );
201
- return parseFloat( `${ major }.${ minor }` );
202
- }
203
- get uint24() {
204
- return ( this.uint8 << 16 ) + ( this.uint8 << 8 ) + this.uint8;
205
- }
206
- get uint128() {
207
- let value = 0;
208
- for ( let i = 0; i < 5; i++ ) {
209
- let byte = this.uint8;
210
- value = value * 128 + ( byte & 127 );
211
- if ( byte < 128 ) break;
212
- }
213
- return value;
214
- }
215
- get longdatetime() {
216
- return new Date( startDate + 1e3 * parseInt( this.int64.toString() ) );
217
- }
218
- get fword() {
219
- return this.int16;
220
- }
221
- get ufword() {
222
- return this.uint16;
223
- }
224
- get Offset16() {
225
- return this.uint16;
226
- }
227
- get Offset32() {
228
- return this.uint32;
229
- }
230
- get F2DOT14() {
231
- const bits = p.uint16;
232
- const integer = [ 0, 1, -2, -1 ][ bits >> 14 ];
233
- const fraction = bits & 16383;
234
- return integer + fraction / 16384;
235
- }
236
- verifyLength() {
237
- if ( this.offset != this.length ) {
238
- console.error(
239
- `unexpected parsed table size (${ this.offset }) for "${ this.name }" (expected ${ this.length })`
240
- );
241
- }
242
- }
243
- readBytes( n = 0, position = 0, bits = 8, signed = false ) {
244
- n = n || this.length;
245
- if ( n === 0 ) return [];
246
- if ( position ) this.currentPosition = position;
247
- const fn = `${ signed ? `` : `u` }int${ bits }`,
248
- slice = [];
249
- while ( n-- ) slice.push( this[ fn ] );
250
- return slice;
251
- }
252
- }
253
- class ParsedData {
254
- constructor( parser ) {
255
- const pGetter = { enumerable: false, get: () => parser };
256
- Object.defineProperty( this, `parser`, pGetter );
257
- const start = parser.currentPosition;
258
- const startGetter = { enumerable: false, get: () => start };
259
- Object.defineProperty( this, `start`, startGetter );
260
- }
261
- load( struct ) {
262
- Object.keys( struct ).forEach( ( p ) => {
263
- let props = Object.getOwnPropertyDescriptor( struct, p );
264
- if ( props.get ) {
265
- this[ p ] = props.get.bind( this );
266
- } else if ( props.value !== undefined ) {
267
- this[ p ] = props.value;
268
- }
269
- } );
270
- if ( this.parser.length ) {
271
- this.parser.verifyLength();
272
- }
273
- }
274
- }
275
- class SimpleTable extends ParsedData {
276
- constructor( dict, dataview, name ) {
277
- const { parser: parser, start: start } = super(
278
- new Parser( dict, dataview, name )
279
- );
280
- const pGetter = { enumerable: false, get: () => parser };
281
- Object.defineProperty( this, `p`, pGetter );
282
- const startGetter = { enumerable: false, get: () => start };
283
- Object.defineProperty( this, `tableStart`, startGetter );
284
- }
285
- }
286
- function lazy$1( object, property, getter ) {
287
- let val;
288
- Object.defineProperty( object, property, {
289
- get: () => {
290
- if ( val ) return val;
291
- val = getter();
292
- return val;
293
- },
294
- enumerable: true,
295
- } );
296
- }
297
- class SFNT extends SimpleTable {
298
- constructor( font, dataview, createTable ) {
299
- const { p: p } = super( { offset: 0, length: 12 }, dataview, `sfnt` );
300
- this.version = p.uint32;
301
- this.numTables = p.uint16;
302
- this.searchRange = p.uint16;
303
- this.entrySelector = p.uint16;
304
- this.rangeShift = p.uint16;
305
- p.verifyLength();
306
- this.directory = [ ...new Array( this.numTables ) ].map(
307
- ( _ ) => new TableRecord( p )
308
- );
309
- this.tables = {};
310
- this.directory.forEach( ( entry ) => {
311
- const getter = () =>
312
- createTable(
313
- this.tables,
314
- {
315
- tag: entry.tag,
316
- offset: entry.offset,
317
- length: entry.length,
318
- },
319
- dataview
320
- );
321
- lazy$1( this.tables, entry.tag.trim(), getter );
322
- } );
323
- }
324
- }
325
- class TableRecord {
326
- constructor( p ) {
327
- this.tag = p.tag;
328
- this.checksum = p.uint32;
329
- this.offset = p.uint32;
330
- this.length = p.uint32;
331
- }
332
- }
333
- const gzipDecode = GzipDecode.inflate || undefined;
334
- let nativeGzipDecode = undefined;
335
- // if ( ! gzipDecode ) {
336
- // import( 'zlib' ).then( ( zlib ) => {
337
- // nativeGzipDecode = ( buffer ) => zlib.unzipSync( buffer );
338
- // } );
339
- // }
340
- class WOFF$1 extends SimpleTable {
341
- constructor( font, dataview, createTable ) {
342
- const { p: p } = super( { offset: 0, length: 44 }, dataview, `woff` );
343
- this.signature = p.tag;
344
- this.flavor = p.uint32;
345
- this.length = p.uint32;
346
- this.numTables = p.uint16;
347
- p.uint16;
348
- this.totalSfntSize = p.uint32;
349
- this.majorVersion = p.uint16;
350
- this.minorVersion = p.uint16;
351
- this.metaOffset = p.uint32;
352
- this.metaLength = p.uint32;
353
- this.metaOrigLength = p.uint32;
354
- this.privOffset = p.uint32;
355
- this.privLength = p.uint32;
356
- p.verifyLength();
357
- this.directory = [ ...new Array( this.numTables ) ].map(
358
- ( _ ) => new WoffTableDirectoryEntry( p )
359
- );
360
- buildWoffLazyLookups( this, dataview, createTable );
361
- }
362
- }
363
- class WoffTableDirectoryEntry {
364
- constructor( p ) {
365
- this.tag = p.tag;
366
- this.offset = p.uint32;
367
- this.compLength = p.uint32;
368
- this.origLength = p.uint32;
369
- this.origChecksum = p.uint32;
370
- }
371
- }
372
- function buildWoffLazyLookups( woff, dataview, createTable ) {
373
- woff.tables = {};
374
- woff.directory.forEach( ( entry ) => {
375
- lazy$1( woff.tables, entry.tag.trim(), () => {
376
- let offset = 0;
377
- let view = dataview;
378
- if ( entry.compLength !== entry.origLength ) {
379
- const data = dataview.buffer.slice(
380
- entry.offset,
381
- entry.offset + entry.compLength
382
- );
383
- let unpacked;
384
- if ( gzipDecode ) {
385
- unpacked = gzipDecode( new Uint8Array( data ) );
386
- } else if ( nativeGzipDecode ) {
387
- unpacked = nativeGzipDecode( new Uint8Array( data ) );
388
- } else {
389
- const msg = `no brotli decoder available to decode WOFF2 font`;
390
- if ( font.onerror ) font.onerror( msg );
391
- throw new Error( msg );
392
- }
393
- view = new DataView( unpacked.buffer );
394
- } else {
395
- offset = entry.offset;
396
- }
397
- return createTable(
398
- woff.tables,
399
- { tag: entry.tag, offset: offset, length: entry.origLength },
400
- view
401
- );
402
- } );
403
- } );
404
- }
405
- const brotliDecode = unbrotli;
406
- let nativeBrotliDecode = undefined;
407
- // if ( ! brotliDecode ) {
408
- // import( 'zlib' ).then( ( zlib ) => {
409
- // nativeBrotliDecode = ( buffer ) => zlib.brotliDecompressSync( buffer );
410
- // } );
411
- // }
412
- class WOFF2$1 extends SimpleTable {
413
- constructor( font, dataview, createTable ) {
414
- const { p: p } = super( { offset: 0, length: 48 }, dataview, `woff2` );
415
- this.signature = p.tag;
416
- this.flavor = p.uint32;
417
- this.length = p.uint32;
418
- this.numTables = p.uint16;
419
- p.uint16;
420
- this.totalSfntSize = p.uint32;
421
- this.totalCompressedSize = p.uint32;
422
- this.majorVersion = p.uint16;
423
- this.minorVersion = p.uint16;
424
- this.metaOffset = p.uint32;
425
- this.metaLength = p.uint32;
426
- this.metaOrigLength = p.uint32;
427
- this.privOffset = p.uint32;
428
- this.privLength = p.uint32;
429
- p.verifyLength();
430
- this.directory = [ ...new Array( this.numTables ) ].map(
431
- ( _ ) => new Woff2TableDirectoryEntry( p )
432
- );
433
- let dictOffset = p.currentPosition;
434
- this.directory[ 0 ].offset = 0;
435
- this.directory.forEach( ( e, i ) => {
436
- let next = this.directory[ i + 1 ];
437
- if ( next ) {
438
- next.offset =
439
- e.offset +
440
- ( e.transformLength !== undefined
441
- ? e.transformLength
442
- : e.origLength );
443
- }
444
- } );
445
- let decoded;
446
- let buffer = dataview.buffer.slice( dictOffset );
447
- if ( brotliDecode ) {
448
- decoded = brotliDecode( new Uint8Array( buffer ) );
449
- } else if ( nativeBrotliDecode ) {
450
- decoded = new Uint8Array( nativeBrotliDecode( buffer ) );
451
- } else {
452
- const msg = `no brotli decoder available to decode WOFF2 font`;
453
- if ( font.onerror ) font.onerror( msg );
454
- throw new Error( msg );
455
- }
456
- buildWoff2LazyLookups( this, decoded, createTable );
457
- }
458
- }
459
- class Woff2TableDirectoryEntry {
460
- constructor( p ) {
461
- this.flags = p.uint8;
462
- const tagNumber = ( this.tagNumber = this.flags & 63 );
463
- if ( tagNumber === 63 ) {
464
- this.tag = p.tag;
465
- } else {
466
- this.tag = getWOFF2Tag( tagNumber );
467
- }
468
- const transformVersion = ( this.transformVersion =
469
- ( this.flags & 192 ) >> 6 );
470
- let hasTransforms = transformVersion !== 0;
471
- if ( this.tag === `glyf` || this.tag === `loca` ) {
472
- hasTransforms = this.transformVersion !== 3;
473
- }
474
- this.origLength = p.uint128;
475
- if ( hasTransforms ) {
476
- this.transformLength = p.uint128;
477
- }
478
- }
479
- }
480
- function buildWoff2LazyLookups( woff2, decoded, createTable ) {
481
- woff2.tables = {};
482
- woff2.directory.forEach( ( entry ) => {
483
- lazy$1( woff2.tables, entry.tag.trim(), () => {
484
- const start = entry.offset;
485
- const end =
486
- start +
487
- ( entry.transformLength
488
- ? entry.transformLength
489
- : entry.origLength );
490
- const data = new DataView( decoded.slice( start, end ).buffer );
491
- try {
492
- return createTable(
493
- woff2.tables,
494
- { tag: entry.tag, offset: 0, length: entry.origLength },
495
- data
496
- );
497
- } catch ( e ) {
498
- console.error( e );
499
- }
500
- } );
501
- } );
502
- }
503
- function getWOFF2Tag( flag ) {
504
- return [
505
- `cmap`,
506
- `head`,
507
- `hhea`,
508
- `hmtx`,
509
- `maxp`,
510
- `name`,
511
- `OS/2`,
512
- `post`,
513
- `cvt `,
514
- `fpgm`,
515
- `glyf`,
516
- `loca`,
517
- `prep`,
518
- `CFF `,
519
- `VORG`,
520
- `EBDT`,
521
- `EBLC`,
522
- `gasp`,
523
- `hdmx`,
524
- `kern`,
525
- `LTSH`,
526
- `PCLT`,
527
- `VDMX`,
528
- `vhea`,
529
- `vmtx`,
530
- `BASE`,
531
- `GDEF`,
532
- `GPOS`,
533
- `GSUB`,
534
- `EBSC`,
535
- `JSTF`,
536
- `MATH`,
537
- `CBDT`,
538
- `CBLC`,
539
- `COLR`,
540
- `CPAL`,
541
- `SVG `,
542
- `sbix`,
543
- `acnt`,
544
- `avar`,
545
- `bdat`,
546
- `bloc`,
547
- `bsln`,
548
- `cvar`,
549
- `fdsc`,
550
- `feat`,
551
- `fmtx`,
552
- `fvar`,
553
- `gvar`,
554
- `hsty`,
555
- `just`,
556
- `lcar`,
557
- `mort`,
558
- `morx`,
559
- `opbd`,
560
- `prop`,
561
- `trak`,
562
- `Zapf`,
563
- `Silf`,
564
- `Glat`,
565
- `Gloc`,
566
- `Feat`,
567
- `Sill`,
568
- ][ flag & 63 ];
569
- }
570
- const tableClasses = {};
571
- let tableClassesLoaded = false;
572
- Promise.all( [
573
- Promise.resolve().then( function () {
574
- return cmap$1;
575
- } ),
576
- Promise.resolve().then( function () {
577
- return head$1;
578
- } ),
579
- Promise.resolve().then( function () {
580
- return hhea$1;
581
- } ),
582
- Promise.resolve().then( function () {
583
- return hmtx$1;
584
- } ),
585
- Promise.resolve().then( function () {
586
- return maxp$1;
587
- } ),
588
- Promise.resolve().then( function () {
589
- return name$1;
590
- } ),
591
- Promise.resolve().then( function () {
592
- return OS2$1;
593
- } ),
594
- Promise.resolve().then( function () {
595
- return post$1;
596
- } ),
597
- Promise.resolve().then( function () {
598
- return BASE$1;
599
- } ),
600
- Promise.resolve().then( function () {
601
- return GDEF$1;
602
- } ),
603
- Promise.resolve().then( function () {
604
- return GSUB$1;
605
- } ),
606
- Promise.resolve().then( function () {
607
- return GPOS$1;
608
- } ),
609
- Promise.resolve().then( function () {
610
- return SVG$1;
611
- } ),
612
- Promise.resolve().then( function () {
613
- return fvar$1;
614
- } ),
615
- Promise.resolve().then( function () {
616
- return cvt$1;
617
- } ),
618
- Promise.resolve().then( function () {
619
- return fpgm$1;
620
- } ),
621
- Promise.resolve().then( function () {
622
- return gasp$1;
623
- } ),
624
- Promise.resolve().then( function () {
625
- return glyf$1;
626
- } ),
627
- Promise.resolve().then( function () {
628
- return loca$1;
629
- } ),
630
- Promise.resolve().then( function () {
631
- return prep$1;
632
- } ),
633
- Promise.resolve().then( function () {
634
- return CFF$1;
635
- } ),
636
- Promise.resolve().then( function () {
637
- return CFF2$1;
638
- } ),
639
- Promise.resolve().then( function () {
640
- return VORG$1;
641
- } ),
642
- Promise.resolve().then( function () {
643
- return EBLC$1;
644
- } ),
645
- Promise.resolve().then( function () {
646
- return EBDT$1;
647
- } ),
648
- Promise.resolve().then( function () {
649
- return EBSC$1;
650
- } ),
651
- Promise.resolve().then( function () {
652
- return CBLC$1;
653
- } ),
654
- Promise.resolve().then( function () {
655
- return CBDT$1;
656
- } ),
657
- Promise.resolve().then( function () {
658
- return sbix$1;
659
- } ),
660
- Promise.resolve().then( function () {
661
- return COLR$1;
662
- } ),
663
- Promise.resolve().then( function () {
664
- return CPAL$1;
665
- } ),
666
- Promise.resolve().then( function () {
667
- return DSIG$1;
668
- } ),
669
- Promise.resolve().then( function () {
670
- return hdmx$1;
671
- } ),
672
- Promise.resolve().then( function () {
673
- return kern$1;
674
- } ),
675
- Promise.resolve().then( function () {
676
- return LTSH$1;
677
- } ),
678
- Promise.resolve().then( function () {
679
- return MERG$1;
680
- } ),
681
- Promise.resolve().then( function () {
682
- return meta$1;
683
- } ),
684
- Promise.resolve().then( function () {
685
- return PCLT$1;
686
- } ),
687
- Promise.resolve().then( function () {
688
- return VDMX$1;
689
- } ),
690
- Promise.resolve().then( function () {
691
- return vhea$1;
692
- } ),
693
- Promise.resolve().then( function () {
694
- return vmtx$1;
695
- } ),
696
- ] ).then( ( data ) => {
697
- data.forEach( ( e ) => {
698
- let name = Object.keys( e )[ 0 ];
699
- tableClasses[ name ] = e[ name ];
700
- } );
701
- tableClassesLoaded = true;
702
- } );
703
- function createTable( tables, dict, dataview ) {
704
- let name = dict.tag.replace( /[^\w\d]/g, `` );
705
- let Type = tableClasses[ name ];
706
- if ( Type ) return new Type( dict, dataview, tables );
707
- console.warn(
708
- `lib-font has no definition for ${ name }. The table was skipped.`
709
- );
710
- return {};
711
- }
712
- function loadTableClasses() {
713
- let count = 0;
714
- function checkLoaded( resolve, reject ) {
715
- if ( ! tableClassesLoaded ) {
716
- if ( count > 10 ) {
717
- return reject( new Error( `loading took too long` ) );
718
- }
719
- count++;
720
- return setTimeout( () => checkLoaded( resolve ), 250 );
721
- }
722
- resolve( createTable );
723
- }
724
- return new Promise( ( resolve, reject ) => checkLoaded( resolve ) );
725
- }
726
- function getFontCSSFormat( path, errorOnStyle ) {
727
- let pos = path.lastIndexOf( `.` );
728
- let ext = ( path.substring( pos + 1 ) || `` ).toLowerCase();
729
- let format = {
730
- ttf: `truetype`,
731
- otf: `opentype`,
732
- woff: `woff`,
733
- woff2: `woff2`,
734
- }[ ext ];
735
- if ( format ) return format;
736
- let msg = {
737
- eot: `The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.`,
738
- svg: `The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.`,
739
- fon: `The .fon format is not supported: this is an ancient Windows bitmap font format.`,
740
- ttc: `Based on the current CSS specification, font collections are not (yet?) supported.`,
741
- }[ ext ];
742
- if ( ! msg ) msg = `${ path } is not a known webfont format.`;
743
- if ( errorOnStyle ) {
744
- throw new Error( msg );
745
- } else {
746
- console.warn( `Could not load font: ${ msg }` );
747
- }
748
- }
749
- async function setupFontFace( name, url, options = {} ) {
750
- if ( ! globalThis.document ) return;
751
- let format = getFontCSSFormat( url, options.errorOnStyle );
752
- if ( ! format ) return;
753
- let style = document.createElement( `style` );
754
- style.className = `injected-by-Font-js`;
755
- let rules = [];
756
- if ( options.styleRules ) {
757
- rules = Object.entries( options.styleRules ).map(
758
- ( [ key, value ] ) => `${ key }: ${ value };`
759
- );
760
- }
761
- style.textContent = `\n@font-face {\n font-family: "${ name }";\n ${ rules.join(
762
- `\n\t`
763
- ) }\n src: url("${ url }") format("${ format }");\n}`;
764
- globalThis.document.head.appendChild( style );
765
- return style;
766
- }
767
- const TTF = [ 0, 1, 0, 0 ];
768
- const OTF = [ 79, 84, 84, 79 ];
769
- const WOFF = [ 119, 79, 70, 70 ];
770
- const WOFF2 = [ 119, 79, 70, 50 ];
771
- function match( ar1, ar2 ) {
772
- if ( ar1.length !== ar2.length ) return;
773
- for ( let i = 0; i < ar1.length; i++ ) {
774
- if ( ar1[ i ] !== ar2[ i ] ) return;
775
- }
776
- return true;
777
- }
778
- function validFontFormat( dataview ) {
779
- const LEAD_BYTES = [
780
- dataview.getUint8( 0 ),
781
- dataview.getUint8( 1 ),
782
- dataview.getUint8( 2 ),
783
- dataview.getUint8( 3 ),
784
- ];
785
- if ( match( LEAD_BYTES, TTF ) || match( LEAD_BYTES, OTF ) ) return `SFNT`;
786
- if ( match( LEAD_BYTES, WOFF ) ) return `WOFF`;
787
- if ( match( LEAD_BYTES, WOFF2 ) ) return `WOFF2`;
788
- }
789
- function checkFetchResponseStatus( response ) {
790
- if ( ! response.ok ) {
791
- throw new Error(
792
- `HTTP ${ response.status } - ${ response.statusText }`
793
- );
794
- }
795
- return response;
796
- }
797
- class Font extends EventManager {
798
- constructor( name, options = {} ) {
799
- super();
800
- this.name = name;
801
- this.options = options;
802
- this.metrics = false;
803
- }
804
- get src() {
805
- return this.__src;
806
- }
807
- set src( src ) {
808
- this.__src = src;
809
- ( async () => {
810
- if ( globalThis.document && ! this.options.skipStyleSheet ) {
811
- await setupFontFace( this.name, src, this.options );
812
- }
813
- this.loadFont( src );
814
- } )();
815
- }
816
- async loadFont( url, filename ) {
817
- fetch( url )
818
- .then(
819
- ( response ) =>
820
- checkFetchResponseStatus( response ) &&
821
- response.arrayBuffer()
822
- )
823
- .then( ( buffer ) =>
824
- this.fromDataBuffer( buffer, filename || url )
825
- )
826
- .catch( ( err ) => {
827
- const evt = new Event(
828
- `error`,
829
- err,
830
- `Failed to load font at ${ filename || url }`
831
- );
832
- this.dispatch( evt );
833
- if ( this.onerror ) this.onerror( evt );
834
- } );
835
- }
836
- async fromDataBuffer( buffer, filenameOrUrL ) {
837
- this.fontData = new DataView( buffer );
838
- let type = validFontFormat( this.fontData );
839
- if ( ! type ) {
840
- throw new Error(
841
- `${ filenameOrUrL } is either an unsupported font format, or not a font at all.`
842
- );
843
- }
844
- await this.parseBasicData( type );
845
- const evt = new Event( 'load', { font: this } );
846
- this.dispatch( evt );
847
- if ( this.onload ) this.onload( evt );
848
- }
849
- async parseBasicData( type ) {
850
- return loadTableClasses().then( ( createTable ) => {
851
- if ( type === `SFNT` ) {
852
- this.opentype = new SFNT( this, this.fontData, createTable );
853
- }
854
- if ( type === `WOFF` ) {
855
- this.opentype = new WOFF$1( this, this.fontData, createTable );
856
- }
857
- if ( type === `WOFF2` ) {
858
- this.opentype = new WOFF2$1( this, this.fontData, createTable );
859
- }
860
- return this.opentype;
861
- } );
862
- }
863
- getGlyphId( char ) {
864
- return this.opentype.tables.cmap.getGlyphId( char );
865
- }
866
- reverse( glyphid ) {
867
- return this.opentype.tables.cmap.reverse( glyphid );
868
- }
869
- supports( char ) {
870
- return this.getGlyphId( char ) !== 0;
871
- }
872
- supportsVariation( variation ) {
873
- return (
874
- this.opentype.tables.cmap.supportsVariation( variation ) !== false
875
- );
876
- }
877
- measureText( text, size = 16 ) {
878
- if ( this.__unloaded )
879
- throw new Error(
880
- 'Cannot measure text: font was unloaded. Please reload before calling measureText()'
881
- );
882
- let d = document.createElement( 'div' );
883
- d.textContent = text;
884
- d.style.fontFamily = this.name;
885
- d.style.fontSize = `${ size }px`;
886
- d.style.color = `transparent`;
887
- d.style.background = `transparent`;
888
- d.style.top = `0`;
889
- d.style.left = `0`;
890
- d.style.position = `absolute`;
891
- document.body.appendChild( d );
892
- let bbox = d.getBoundingClientRect();
893
- document.body.removeChild( d );
894
- const OS2 = this.opentype.tables[ 'OS/2' ];
895
- bbox.fontSize = size;
896
- bbox.ascender = OS2.sTypoAscender;
897
- bbox.descender = OS2.sTypoDescender;
898
- return bbox;
899
- }
900
- unload() {
901
- if ( this.styleElement.parentNode ) {
902
- this.styleElement.parentNode.removeElement( this.styleElement );
903
- const evt = new Event( 'unload', { font: this } );
904
- this.dispatch( evt );
905
- if ( this.onunload ) this.onunload( evt );
906
- }
907
- this._unloaded = true;
908
- }
909
- load() {
910
- if ( this.__unloaded ) {
911
- delete this.__unloaded;
912
- document.head.appendChild( this.styleElement );
913
- const evt = new Event( 'load', { font: this } );
914
- this.dispatch( evt );
915
- if ( this.onload ) this.onload( evt );
916
- }
917
- }
918
- }
919
- globalThis.Font = Font;
920
- class Subtable extends ParsedData {
921
- constructor( p, plaformID, encodingID ) {
922
- super( p );
923
- this.plaformID = plaformID;
924
- this.encodingID = encodingID;
925
- }
926
- }
927
- class Format0 extends Subtable {
928
- constructor( p, platformID, encodingID ) {
929
- super( p, platformID, encodingID );
930
- this.format = 0;
931
- this.length = p.uint16;
932
- this.language = p.uint16;
933
- this.glyphIdArray = [ ...new Array( 256 ) ].map( ( _ ) => p.uint8 );
934
- }
935
- supports( charCode ) {
936
- if ( charCode.charCodeAt ) {
937
- charCode = -1;
938
- console.warn(
939
- `supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.`
940
- );
941
- }
942
- return 0 <= charCode && charCode <= 255;
943
- }
944
- reverse( glyphID ) {
945
- console.warn( `reverse not implemented for cmap subtable format 0` );
946
- return {};
947
- }
948
- getSupportedCharCodes() {
949
- return [ { start: 1, end: 256 } ];
950
- }
951
- }
952
- class Format2 extends Subtable {
953
- constructor( p, platformID, encodingID ) {
954
- super( p, platformID, encodingID );
955
- this.format = 2;
956
- this.length = p.uint16;
957
- this.language = p.uint16;
958
- this.subHeaderKeys = [ ...new Array( 256 ) ].map( ( _ ) => p.uint16 );
959
- const subHeaderCount = Math.max( ...this.subHeaderKeys );
960
- const subHeaderOffset = p.currentPosition;
961
- lazy$1( this, `subHeaders`, () => {
962
- p.currentPosition = subHeaderOffset;
963
- return [ ...new Array( subHeaderCount ) ].map(
964
- ( _ ) => new SubHeader( p )
965
- );
966
- } );
967
- const glyphIndexOffset = subHeaderOffset + subHeaderCount * 8;
968
- lazy$1( this, `glyphIndexArray`, () => {
969
- p.currentPosition = glyphIndexOffset;
970
- return [ ...new Array( subHeaderCount ) ].map( ( _ ) => p.uint16 );
971
- } );
972
- }
973
- supports( charCode ) {
974
- if ( charCode.charCodeAt ) {
975
- charCode = -1;
976
- console.warn(
977
- `supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented.`
978
- );
979
- }
980
- const low = charCode && 255;
981
- const high = charCode && 65280;
982
- const subHeaderKey = this.subHeaders[ high ];
983
- const subheader = this.subHeaders[ subHeaderKey ];
984
- const first = subheader.firstCode;
985
- const last = first + subheader.entryCount;
986
- return first <= low && low <= last;
987
- }
988
- reverse( glyphID ) {
989
- console.warn( `reverse not implemented for cmap subtable format 2` );
990
- return {};
991
- }
992
- getSupportedCharCodes( preservePropNames = false ) {
993
- if ( preservePropNames ) {
994
- return this.subHeaders.map( ( h ) => ( {
995
- firstCode: h.firstCode,
996
- lastCode: h.lastCode,
997
- } ) );
998
- }
999
- return this.subHeaders.map( ( h ) => ( {
1000
- start: h.firstCode,
1001
- end: h.lastCode,
1002
- } ) );
1003
- }
1004
- }
1005
- class SubHeader {
1006
- constructor( p ) {
1007
- this.firstCode = p.uint16;
1008
- this.entryCount = p.uint16;
1009
- this.lastCode = this.first + this.entryCount;
1010
- this.idDelta = p.int16;
1011
- this.idRangeOffset = p.uint16;
1012
- }
1013
- }
1014
- class Format4 extends Subtable {
1015
- constructor( p, platformID, encodingID ) {
1016
- super( p, platformID, encodingID );
1017
- this.format = 4;
1018
- this.length = p.uint16;
1019
- this.language = p.uint16;
1020
- this.segCountX2 = p.uint16;
1021
- this.segCount = this.segCountX2 / 2;
1022
- this.searchRange = p.uint16;
1023
- this.entrySelector = p.uint16;
1024
- this.rangeShift = p.uint16;
1025
- const endCodePosition = p.currentPosition;
1026
- lazy$1( this, `endCode`, () =>
1027
- p.readBytes( this.segCount, endCodePosition, 16 )
1028
- );
1029
- const startCodePosition = endCodePosition + 2 + this.segCountX2;
1030
- lazy$1( this, `startCode`, () =>
1031
- p.readBytes( this.segCount, startCodePosition, 16 )
1032
- );
1033
- const idDeltaPosition = startCodePosition + this.segCountX2;
1034
- lazy$1( this, `idDelta`, () =>
1035
- p.readBytes( this.segCount, idDeltaPosition, 16, true )
1036
- );
1037
- const idRangePosition = idDeltaPosition + this.segCountX2;
1038
- lazy$1( this, `idRangeOffset`, () =>
1039
- p.readBytes( this.segCount, idRangePosition, 16 )
1040
- );
1041
- const glyphIdArrayPosition = idRangePosition + this.segCountX2;
1042
- const glyphIdArrayLength =
1043
- this.length - ( glyphIdArrayPosition - this.tableStart );
1044
- lazy$1( this, `glyphIdArray`, () =>
1045
- p.readBytes( glyphIdArrayLength, glyphIdArrayPosition, 16 )
1046
- );
1047
- lazy$1( this, `segments`, () =>
1048
- this.buildSegments( idRangePosition, glyphIdArrayPosition, p )
1049
- );
1050
- }
1051
- buildSegments( idRangePosition, glyphIdArrayPosition, p ) {
1052
- const build = ( _, i ) => {
1053
- let startCode = this.startCode[ i ],
1054
- endCode = this.endCode[ i ],
1055
- idDelta = this.idDelta[ i ],
1056
- idRangeOffset = this.idRangeOffset[ i ],
1057
- idRangeOffsetPointer = idRangePosition + 2 * i,
1058
- glyphIDs = [];
1059
- if ( idRangeOffset === 0 ) {
1060
- for (
1061
- let i = startCode + idDelta, e = endCode + idDelta;
1062
- i <= e;
1063
- i++
1064
- ) {
1065
- glyphIDs.push( i );
1066
- }
1067
- } else {
1068
- for ( let i = 0, e = endCode - startCode; i <= e; i++ ) {
1069
- p.currentPosition =
1070
- idRangeOffsetPointer + idRangeOffset + i * 2;
1071
- glyphIDs.push( p.uint16 );
1072
- }
1073
- }
1074
- return {
1075
- startCode: startCode,
1076
- endCode: endCode,
1077
- idDelta: idDelta,
1078
- idRangeOffset: idRangeOffset,
1079
- glyphIDs: glyphIDs,
1080
- };
1081
- };
1082
- return [ ...new Array( this.segCount ) ].map( build );
1083
- }
1084
- reverse( glyphID ) {
1085
- let s = this.segments.find( ( v ) => v.glyphIDs.includes( glyphID ) );
1086
- if ( ! s ) return {};
1087
- const code = s.startCode + s.glyphIDs.indexOf( glyphID );
1088
- return { code: code, unicode: String.fromCodePoint( code ) };
1089
- }
1090
- getGlyphId( charCode ) {
1091
- if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
1092
- if ( 55296 <= charCode && charCode <= 57343 ) return 0;
1093
- if ( ( charCode & 65534 ) === 65534 || ( charCode & 65535 ) === 65535 )
1094
- return 0;
1095
- let segment = this.segments.find(
1096
- ( s ) => s.startCode <= charCode && charCode <= s.endCode
1097
- );
1098
- if ( ! segment ) return 0;
1099
- return segment.glyphIDs[ charCode - segment.startCode ];
1100
- }
1101
- supports( charCode ) {
1102
- return this.getGlyphId( charCode ) !== 0;
1103
- }
1104
- getSupportedCharCodes( preservePropNames = false ) {
1105
- if ( preservePropNames ) return this.segments;
1106
- return this.segments.map( ( v ) => ( {
1107
- start: v.startCode,
1108
- end: v.endCode,
1109
- } ) );
1110
- }
1111
- }
1112
- class Format6 extends Subtable {
1113
- constructor( p, platformID, encodingID ) {
1114
- super( p, platformID, encodingID );
1115
- this.format = 6;
1116
- this.length = p.uint16;
1117
- this.language = p.uint16;
1118
- this.firstCode = p.uint16;
1119
- this.entryCount = p.uint16;
1120
- this.lastCode = this.firstCode + this.entryCount - 1;
1121
- const getter = () =>
1122
- [ ...new Array( this.entryCount ) ].map( ( _ ) => p.uint16 );
1123
- lazy$1( this, `glyphIdArray`, getter );
1124
- }
1125
- supports( charCode ) {
1126
- if ( charCode.charCodeAt ) {
1127
- charCode = -1;
1128
- console.warn(
1129
- `supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.`
1130
- );
1131
- }
1132
- if ( charCode < this.firstCode ) return {};
1133
- if ( charCode > this.firstCode + this.entryCount ) return {};
1134
- const code = charCode - this.firstCode;
1135
- return { code: code, unicode: String.fromCodePoint( code ) };
1136
- }
1137
- reverse( glyphID ) {
1138
- let pos = this.glyphIdArray.indexOf( glyphID );
1139
- if ( pos > -1 ) return this.firstCode + pos;
1140
- }
1141
- getSupportedCharCodes( preservePropNames = false ) {
1142
- if ( preservePropNames ) {
1143
- return [ { firstCode: this.firstCode, lastCode: this.lastCode } ];
1144
- }
1145
- return [ { start: this.firstCode, end: this.lastCode } ];
1146
- }
1147
- }
1148
- class Format8 extends Subtable {
1149
- constructor( p, platformID, encodingID ) {
1150
- super( p, platformID, encodingID );
1151
- this.format = 8;
1152
- p.uint16;
1153
- this.length = p.uint32;
1154
- this.language = p.uint32;
1155
- this.is32 = [ ...new Array( 8192 ) ].map( ( _ ) => p.uint8 );
1156
- this.numGroups = p.uint32;
1157
- const getter = () =>
1158
- [ ...new Array( this.numGroups ) ].map(
1159
- ( _ ) => new SequentialMapGroup$1( p )
1160
- );
1161
- lazy$1( this, `groups`, getter );
1162
- }
1163
- supports( charCode ) {
1164
- if ( charCode.charCodeAt ) {
1165
- charCode = -1;
1166
- console.warn(
1167
- `supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.`
1168
- );
1169
- }
1170
- return (
1171
- this.groups.findIndex(
1172
- ( s ) =>
1173
- s.startcharCode <= charCode && charCode <= s.endcharCode
1174
- ) !== -1
1175
- );
1176
- }
1177
- reverse( glyphID ) {
1178
- console.warn( `reverse not implemented for cmap subtable format 8` );
1179
- return {};
1180
- }
1181
- getSupportedCharCodes( preservePropNames = false ) {
1182
- if ( preservePropNames ) return this.groups;
1183
- return this.groups.map( ( v ) => ( {
1184
- start: v.startcharCode,
1185
- end: v.endcharCode,
1186
- } ) );
1187
- }
1188
- }
1189
- class SequentialMapGroup$1 {
1190
- constructor( p ) {
1191
- this.startcharCode = p.uint32;
1192
- this.endcharCode = p.uint32;
1193
- this.startGlyphID = p.uint32;
1194
- }
1195
- }
1196
- class Format10 extends Subtable {
1197
- constructor( p, platformID, encodingID ) {
1198
- super( p, platformID, encodingID );
1199
- this.format = 10;
1200
- p.uint16;
1201
- this.length = p.uint32;
1202
- this.language = p.uint32;
1203
- this.startCharCode = p.uint32;
1204
- this.numChars = p.uint32;
1205
- this.endCharCode = this.startCharCode + this.numChars;
1206
- const getter = () =>
1207
- [ ...new Array( this.numChars ) ].map( ( _ ) => p.uint16 );
1208
- lazy$1( this, `glyphs`, getter );
1209
- }
1210
- supports( charCode ) {
1211
- if ( charCode.charCodeAt ) {
1212
- charCode = -1;
1213
- console.warn(
1214
- `supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.`
1215
- );
1216
- }
1217
- if ( charCode < this.startCharCode ) return false;
1218
- if ( charCode > this.startCharCode + this.numChars ) return false;
1219
- return charCode - this.startCharCode;
1220
- }
1221
- reverse( glyphID ) {
1222
- console.warn( `reverse not implemented for cmap subtable format 10` );
1223
- return {};
1224
- }
1225
- getSupportedCharCodes( preservePropNames = false ) {
1226
- if ( preservePropNames ) {
1227
- return [
1228
- {
1229
- startCharCode: this.startCharCode,
1230
- endCharCode: this.endCharCode,
1231
- },
1232
- ];
1233
- }
1234
- return [ { start: this.startCharCode, end: this.endCharCode } ];
1235
- }
1236
- }
1237
- class Format12 extends Subtable {
1238
- constructor( p, platformID, encodingID ) {
1239
- super( p, platformID, encodingID );
1240
- this.format = 12;
1241
- p.uint16;
1242
- this.length = p.uint32;
1243
- this.language = p.uint32;
1244
- this.numGroups = p.uint32;
1245
- const getter = () =>
1246
- [ ...new Array( this.numGroups ) ].map(
1247
- ( _ ) => new SequentialMapGroup( p )
1248
- );
1249
- lazy$1( this, `groups`, getter );
1250
- }
1251
- supports( charCode ) {
1252
- if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
1253
- if ( 55296 <= charCode && charCode <= 57343 ) return 0;
1254
- if ( ( charCode & 65534 ) === 65534 || ( charCode & 65535 ) === 65535 )
1255
- return 0;
1256
- return (
1257
- this.groups.findIndex(
1258
- ( s ) =>
1259
- s.startCharCode <= charCode && charCode <= s.endCharCode
1260
- ) !== -1
1261
- );
1262
- }
1263
- reverse( glyphID ) {
1264
- for ( let group of this.groups ) {
1265
- let start = group.startGlyphID;
1266
- if ( start > glyphID ) continue;
1267
- if ( start === glyphID ) return group.startCharCode;
1268
- let end = start + ( group.endCharCode - group.startCharCode );
1269
- if ( end < glyphID ) continue;
1270
- const code = group.startCharCode + ( glyphID - start );
1271
- return { code: code, unicode: String.fromCodePoint( code ) };
1272
- }
1273
- return {};
1274
- }
1275
- getSupportedCharCodes( preservePropNames = false ) {
1276
- if ( preservePropNames ) return this.groups;
1277
- return this.groups.map( ( v ) => ( {
1278
- start: v.startCharCode,
1279
- end: v.endCharCode,
1280
- } ) );
1281
- }
1282
- }
1283
- class SequentialMapGroup {
1284
- constructor( p ) {
1285
- this.startCharCode = p.uint32;
1286
- this.endCharCode = p.uint32;
1287
- this.startGlyphID = p.uint32;
1288
- }
1289
- }
1290
- class Format13 extends Subtable {
1291
- constructor( p, platformID, encodingID ) {
1292
- super( p, platformID, encodingID );
1293
- this.format = 13;
1294
- p.uint16;
1295
- this.length = p.uint32;
1296
- this.language = p.uint32;
1297
- this.numGroups = p.uint32;
1298
- const getter = [ ...new Array( this.numGroups ) ].map(
1299
- ( _ ) => new ConstantMapGroup( p )
1300
- );
1301
- lazy$1( this, `groups`, getter );
1302
- }
1303
- supports( charCode ) {
1304
- if ( charCode.charCodeAt ) charCode = charCode.charCodeAt( 0 );
1305
- return (
1306
- this.groups.findIndex(
1307
- ( s ) =>
1308
- s.startCharCode <= charCode && charCode <= s.endCharCode
1309
- ) !== -1
1310
- );
1311
- }
1312
- reverse( glyphID ) {
1313
- console.warn( `reverse not implemented for cmap subtable format 13` );
1314
- return {};
1315
- }
1316
- getSupportedCharCodes( preservePropNames = false ) {
1317
- if ( preservePropNames ) return this.groups;
1318
- return this.groups.map( ( v ) => ( {
1319
- start: v.startCharCode,
1320
- end: v.endCharCode,
1321
- } ) );
1322
- }
1323
- }
1324
- class ConstantMapGroup {
1325
- constructor( p ) {
1326
- this.startCharCode = p.uint32;
1327
- this.endCharCode = p.uint32;
1328
- this.glyphID = p.uint32;
1329
- }
1330
- }
1331
- class Format14 extends Subtable {
1332
- constructor( p, platformID, encodingID ) {
1333
- super( p, platformID, encodingID );
1334
- this.subTableStart = p.currentPosition;
1335
- this.format = 14;
1336
- this.length = p.uint32;
1337
- this.numVarSelectorRecords = p.uint32;
1338
- lazy$1( this, `varSelectors`, () =>
1339
- [ ...new Array( this.numVarSelectorRecords ) ].map(
1340
- ( _ ) => new VariationSelector( p )
1341
- )
1342
- );
1343
- }
1344
- supports() {
1345
- console.warn( `supports not implemented for cmap subtable format 14` );
1346
- return 0;
1347
- }
1348
- getSupportedCharCodes() {
1349
- console.warn(
1350
- `getSupportedCharCodes not implemented for cmap subtable format 14`
1351
- );
1352
- return [];
1353
- }
1354
- reverse( glyphID ) {
1355
- console.warn( `reverse not implemented for cmap subtable format 14` );
1356
- return {};
1357
- }
1358
- supportsVariation( variation ) {
1359
- let v = this.varSelector.find(
1360
- ( uvs ) => uvs.varSelector === variation
1361
- );
1362
- return v ? v : false;
1363
- }
1364
- getSupportedVariations() {
1365
- return this.varSelectors.map( ( v ) => v.varSelector );
1366
- }
1367
- }
1368
- class VariationSelector {
1369
- constructor( p ) {
1370
- this.varSelector = p.uint24;
1371
- this.defaultUVSOffset = p.Offset32;
1372
- this.nonDefaultUVSOffset = p.Offset32;
1373
- }
1374
- }
1375
- function createSubTable( parser, platformID, encodingID ) {
1376
- const format = parser.uint16;
1377
- if ( format === 0 ) return new Format0( parser, platformID, encodingID );
1378
- if ( format === 2 ) return new Format2( parser, platformID, encodingID );
1379
- if ( format === 4 ) return new Format4( parser, platformID, encodingID );
1380
- if ( format === 6 ) return new Format6( parser, platformID, encodingID );
1381
- if ( format === 8 ) return new Format8( parser, platformID, encodingID );
1382
- if ( format === 10 ) return new Format10( parser, platformID, encodingID );
1383
- if ( format === 12 ) return new Format12( parser, platformID, encodingID );
1384
- if ( format === 13 ) return new Format13( parser, platformID, encodingID );
1385
- if ( format === 14 ) return new Format14( parser, platformID, encodingID );
1386
- return {};
1387
- }
1388
- class cmap extends SimpleTable {
1389
- constructor( dict, dataview ) {
1390
- const { p: p } = super( dict, dataview );
1391
- this.version = p.uint16;
1392
- this.numTables = p.uint16;
1393
- this.encodingRecords = [ ...new Array( this.numTables ) ].map(
1394
- ( _ ) => new EncodingRecord( p, this.tableStart )
1395
- );
1396
- }
1397
- getSubTable( tableID ) {
1398
- return this.encodingRecords[ tableID ].table;
1399
- }
1400
- getSupportedEncodings() {
1401
- return this.encodingRecords.map( ( r ) => ( {
1402
- platformID: r.platformID,
1403
- encodingId: r.encodingID,
1404
- } ) );
1405
- }
1406
- getSupportedCharCodes( platformID, encodingID ) {
1407
- const recordID = this.encodingRecords.findIndex(
1408
- ( r ) => r.platformID === platformID && r.encodingID === encodingID
1409
- );
1410
- if ( recordID === -1 ) return false;
1411
- const subtable = this.getSubTable( recordID );
1412
- return subtable.getSupportedCharCodes();
1413
- }
1414
- reverse( glyphid ) {
1415
- for ( let i = 0; i < this.numTables; i++ ) {
1416
- let code = this.getSubTable( i ).reverse( glyphid );
1417
- if ( code ) return code;
1418
- }
1419
- }
1420
- getGlyphId( char ) {
1421
- let last = 0;
1422
- this.encodingRecords.some( ( _, tableID ) => {
1423
- let t = this.getSubTable( tableID );
1424
- if ( ! t.getGlyphId ) return false;
1425
- last = t.getGlyphId( char );
1426
- return last !== 0;
1427
- } );
1428
- return last;
1429
- }
1430
- supports( char ) {
1431
- return this.encodingRecords.some( ( _, tableID ) => {
1432
- const t = this.getSubTable( tableID );
1433
- return t.supports && t.supports( char ) !== false;
1434
- } );
1435
- }
1436
- supportsVariation( variation ) {
1437
- return this.encodingRecords.some( ( _, tableID ) => {
1438
- const t = this.getSubTable( tableID );
1439
- return (
1440
- t.supportsVariation &&
1441
- t.supportsVariation( variation ) !== false
1442
- );
1443
- } );
1444
- }
1445
- }
1446
- class EncodingRecord {
1447
- constructor( p, tableStart ) {
1448
- const platformID = ( this.platformID = p.uint16 );
1449
- const encodingID = ( this.encodingID = p.uint16 );
1450
- const offset = ( this.offset = p.Offset32 );
1451
- lazy$1( this, `table`, () => {
1452
- p.currentPosition = tableStart + offset;
1453
- return createSubTable( p, platformID, encodingID );
1454
- } );
1455
- }
1456
- }
1457
- var cmap$1 = Object.freeze( { __proto__: null, cmap: cmap } );
1458
- class head extends SimpleTable {
1459
- constructor( dict, dataview ) {
1460
- const { p: p } = super( dict, dataview );
1461
- this.load( {
1462
- majorVersion: p.uint16,
1463
- minorVersion: p.uint16,
1464
- fontRevision: p.fixed,
1465
- checkSumAdjustment: p.uint32,
1466
- magicNumber: p.uint32,
1467
- flags: p.flags( 16 ),
1468
- unitsPerEm: p.uint16,
1469
- created: p.longdatetime,
1470
- modified: p.longdatetime,
1471
- xMin: p.int16,
1472
- yMin: p.int16,
1473
- xMax: p.int16,
1474
- yMax: p.int16,
1475
- macStyle: p.flags( 16 ),
1476
- lowestRecPPEM: p.uint16,
1477
- fontDirectionHint: p.uint16,
1478
- indexToLocFormat: p.uint16,
1479
- glyphDataFormat: p.uint16,
1480
- } );
1481
- }
1482
- }
1483
- var head$1 = Object.freeze( { __proto__: null, head: head } );
1484
- class hhea extends SimpleTable {
1485
- constructor( dict, dataview ) {
1486
- const { p: p } = super( dict, dataview );
1487
- this.majorVersion = p.uint16;
1488
- this.minorVersion = p.uint16;
1489
- this.ascender = p.fword;
1490
- this.descender = p.fword;
1491
- this.lineGap = p.fword;
1492
- this.advanceWidthMax = p.ufword;
1493
- this.minLeftSideBearing = p.fword;
1494
- this.minRightSideBearing = p.fword;
1495
- this.xMaxExtent = p.fword;
1496
- this.caretSlopeRise = p.int16;
1497
- this.caretSlopeRun = p.int16;
1498
- this.caretOffset = p.int16;
1499
- p.int16;
1500
- p.int16;
1501
- p.int16;
1502
- p.int16;
1503
- this.metricDataFormat = p.int16;
1504
- this.numberOfHMetrics = p.uint16;
1505
- p.verifyLength();
1506
- }
1507
- }
1508
- var hhea$1 = Object.freeze( { __proto__: null, hhea: hhea } );
1509
- class hmtx extends SimpleTable {
1510
- constructor( dict, dataview, tables ) {
1511
- const { p: p } = super( dict, dataview );
1512
- const numberOfHMetrics = tables.hhea.numberOfHMetrics;
1513
- const numGlyphs = tables.maxp.numGlyphs;
1514
- const metricsStart = p.currentPosition;
1515
- lazy$1( this, `hMetrics`, () => {
1516
- p.currentPosition = metricsStart;
1517
- return [ ...new Array( numberOfHMetrics ) ].map(
1518
- ( _ ) => new LongHorMetric( p.uint16, p.int16 )
1519
- );
1520
- } );
1521
- if ( numberOfHMetrics < numGlyphs ) {
1522
- const lsbStart = metricsStart + numberOfHMetrics * 4;
1523
- lazy$1( this, `leftSideBearings`, () => {
1524
- p.currentPosition = lsbStart;
1525
- return [ ...new Array( numGlyphs - numberOfHMetrics ) ].map(
1526
- ( _ ) => p.int16
1527
- );
1528
- } );
1529
- }
1530
- }
1531
- }
1532
- class LongHorMetric {
1533
- constructor( w, b ) {
1534
- this.advanceWidth = w;
1535
- this.lsb = b;
1536
- }
1537
- }
1538
- var hmtx$1 = Object.freeze( { __proto__: null, hmtx: hmtx } );
1539
- class maxp extends SimpleTable {
1540
- constructor( dict, dataview ) {
1541
- const { p: p } = super( dict, dataview );
1542
- this.version = p.legacyFixed;
1543
- this.numGlyphs = p.uint16;
1544
- if ( this.version === 1 ) {
1545
- this.maxPoints = p.uint16;
1546
- this.maxContours = p.uint16;
1547
- this.maxCompositePoints = p.uint16;
1548
- this.maxCompositeContours = p.uint16;
1549
- this.maxZones = p.uint16;
1550
- this.maxTwilightPoints = p.uint16;
1551
- this.maxStorage = p.uint16;
1552
- this.maxFunctionDefs = p.uint16;
1553
- this.maxInstructionDefs = p.uint16;
1554
- this.maxStackElements = p.uint16;
1555
- this.maxSizeOfInstructions = p.uint16;
1556
- this.maxComponentElements = p.uint16;
1557
- this.maxComponentDepth = p.uint16;
1558
- }
1559
- p.verifyLength();
1560
- }
1561
- }
1562
- var maxp$1 = Object.freeze( { __proto__: null, maxp: maxp } );
1563
- class name extends SimpleTable {
1564
- constructor( dict, dataview ) {
1565
- const { p: p } = super( dict, dataview );
1566
- this.format = p.uint16;
1567
- this.count = p.uint16;
1568
- this.stringOffset = p.Offset16;
1569
- this.nameRecords = [ ...new Array( this.count ) ].map(
1570
- ( _ ) => new NameRecord( p, this )
1571
- );
1572
- if ( this.format === 1 ) {
1573
- this.langTagCount = p.uint16;
1574
- this.langTagRecords = [ ...new Array( this.langTagCount ) ].map(
1575
- ( _ ) => new LangTagRecord( p.uint16, p.Offset16 )
1576
- );
1577
- }
1578
- this.stringStart = this.tableStart + this.stringOffset;
1579
- }
1580
- get( nameID ) {
1581
- let record = this.nameRecords.find(
1582
- ( record ) => record.nameID === nameID
1583
- );
1584
- if ( record ) return record.string;
1585
- }
1586
- }
1587
- class LangTagRecord {
1588
- constructor( length, offset ) {
1589
- this.length = length;
1590
- this.offset = offset;
1591
- }
1592
- }
1593
- class NameRecord {
1594
- constructor( p, nameTable ) {
1595
- this.platformID = p.uint16;
1596
- this.encodingID = p.uint16;
1597
- this.languageID = p.uint16;
1598
- this.nameID = p.uint16;
1599
- this.length = p.uint16;
1600
- this.offset = p.Offset16;
1601
- lazy$1( this, `string`, () => {
1602
- p.currentPosition = nameTable.stringStart + this.offset;
1603
- return decodeString( p, this );
1604
- } );
1605
- }
1606
- }
1607
- function decodeString( p, record ) {
1608
- const { platformID: platformID, length: length } = record;
1609
- if ( length === 0 ) return ``;
1610
- if ( platformID === 0 || platformID === 3 ) {
1611
- const str = [];
1612
- for ( let i = 0, e = length / 2; i < e; i++ )
1613
- str[ i ] = String.fromCharCode( p.uint16 );
1614
- return str.join( `` );
1615
- }
1616
- const bytes = p.readBytes( length );
1617
- const str = [];
1618
- bytes.forEach( function ( b, i ) {
1619
- str[ i ] = String.fromCharCode( b );
1620
- } );
1621
- return str.join( `` );
1622
- }
1623
- var name$1 = Object.freeze( { __proto__: null, name: name } );
1624
- class OS2 extends SimpleTable {
1625
- constructor( dict, dataview ) {
1626
- const { p: p } = super( dict, dataview );
1627
- this.version = p.uint16;
1628
- this.xAvgCharWidth = p.int16;
1629
- this.usWeightClass = p.uint16;
1630
- this.usWidthClass = p.uint16;
1631
- this.fsType = p.uint16;
1632
- this.ySubscriptXSize = p.int16;
1633
- this.ySubscriptYSize = p.int16;
1634
- this.ySubscriptXOffset = p.int16;
1635
- this.ySubscriptYOffset = p.int16;
1636
- this.ySuperscriptXSize = p.int16;
1637
- this.ySuperscriptYSize = p.int16;
1638
- this.ySuperscriptXOffset = p.int16;
1639
- this.ySuperscriptYOffset = p.int16;
1640
- this.yStrikeoutSize = p.int16;
1641
- this.yStrikeoutPosition = p.int16;
1642
- this.sFamilyClass = p.int16;
1643
- this.panose = [ ...new Array( 10 ) ].map( ( _ ) => p.uint8 );
1644
- this.ulUnicodeRange1 = p.flags( 32 );
1645
- this.ulUnicodeRange2 = p.flags( 32 );
1646
- this.ulUnicodeRange3 = p.flags( 32 );
1647
- this.ulUnicodeRange4 = p.flags( 32 );
1648
- this.achVendID = p.tag;
1649
- this.fsSelection = p.uint16;
1650
- this.usFirstCharIndex = p.uint16;
1651
- this.usLastCharIndex = p.uint16;
1652
- this.sTypoAscender = p.int16;
1653
- this.sTypoDescender = p.int16;
1654
- this.sTypoLineGap = p.int16;
1655
- this.usWinAscent = p.uint16;
1656
- this.usWinDescent = p.uint16;
1657
- if ( this.version === 0 ) return p.verifyLength();
1658
- this.ulCodePageRange1 = p.flags( 32 );
1659
- this.ulCodePageRange2 = p.flags( 32 );
1660
- if ( this.version === 1 ) return p.verifyLength();
1661
- this.sxHeight = p.int16;
1662
- this.sCapHeight = p.int16;
1663
- this.usDefaultChar = p.uint16;
1664
- this.usBreakChar = p.uint16;
1665
- this.usMaxContext = p.uint16;
1666
- if ( this.version <= 4 ) return p.verifyLength();
1667
- this.usLowerOpticalPointSize = p.uint16;
1668
- this.usUpperOpticalPointSize = p.uint16;
1669
- if ( this.version === 5 ) return p.verifyLength();
1670
- }
1671
- }
1672
- var OS2$1 = Object.freeze( { __proto__: null, OS2: OS2 } );
1673
- class post extends SimpleTable {
1674
- constructor( dict, dataview ) {
1675
- const { p: p } = super( dict, dataview );
1676
- this.version = p.legacyFixed;
1677
- this.italicAngle = p.fixed;
1678
- this.underlinePosition = p.fword;
1679
- this.underlineThickness = p.fword;
1680
- this.isFixedPitch = p.uint32;
1681
- this.minMemType42 = p.uint32;
1682
- this.maxMemType42 = p.uint32;
1683
- this.minMemType1 = p.uint32;
1684
- this.maxMemType1 = p.uint32;
1685
- if ( this.version === 1 || this.version === 3 ) return p.verifyLength();
1686
- this.numGlyphs = p.uint16;
1687
- if ( this.version === 2 ) {
1688
- this.glyphNameIndex = [ ...new Array( this.numGlyphs ) ].map(
1689
- ( _ ) => p.uint16
1690
- );
1691
- this.namesOffset = p.currentPosition;
1692
- this.glyphNameOffsets = [ 1 ];
1693
- for ( let i = 0; i < this.numGlyphs; i++ ) {
1694
- let index = this.glyphNameIndex[ i ];
1695
- if ( index < macStrings.length ) {
1696
- this.glyphNameOffsets.push( this.glyphNameOffsets[ i ] );
1697
- continue;
1698
- }
1699
- let bytelength = p.int8;
1700
- p.skip( bytelength );
1701
- this.glyphNameOffsets.push(
1702
- this.glyphNameOffsets[ i ] + bytelength + 1
1703
- );
1704
- }
1705
- }
1706
- if ( this.version === 2.5 ) {
1707
- this.offset = [ ...new Array( this.numGlyphs ) ].map(
1708
- ( _ ) => p.int8
1709
- );
1710
- }
1711
- }
1712
- getGlyphName( glyphid ) {
1713
- if ( this.version !== 2 ) {
1714
- console.warn(
1715
- `post table version ${ this.version } does not support glyph name lookups`
1716
- );
1717
- return ``;
1718
- }
1719
- let index = this.glyphNameIndex[ glyphid ];
1720
- if ( index < 258 ) return macStrings[ index ];
1721
- let offset = this.glyphNameOffsets[ glyphid ];
1722
- let next = this.glyphNameOffsets[ glyphid + 1 ];
1723
- let len = next - offset - 1;
1724
- if ( len === 0 ) return `.notdef.`;
1725
- this.parser.currentPosition = this.namesOffset + offset;
1726
- const data = this.parser.readBytes(
1727
- len,
1728
- this.namesOffset + offset,
1729
- 8,
1730
- true
1731
- );
1732
- return data.map( ( b ) => String.fromCharCode( b ) ).join( `` );
1733
- }
1734
- }
1735
- const macStrings = [
1736
- `.notdef`,
1737
- `.null`,
1738
- `nonmarkingreturn`,
1739
- `space`,
1740
- `exclam`,
1741
- `quotedbl`,
1742
- `numbersign`,
1743
- `dollar`,
1744
- `percent`,
1745
- `ampersand`,
1746
- `quotesingle`,
1747
- `parenleft`,
1748
- `parenright`,
1749
- `asterisk`,
1750
- `plus`,
1751
- `comma`,
1752
- `hyphen`,
1753
- `period`,
1754
- `slash`,
1755
- `zero`,
1756
- `one`,
1757
- `two`,
1758
- `three`,
1759
- `four`,
1760
- `five`,
1761
- `six`,
1762
- `seven`,
1763
- `eight`,
1764
- `nine`,
1765
- `colon`,
1766
- `semicolon`,
1767
- `less`,
1768
- `equal`,
1769
- `greater`,
1770
- `question`,
1771
- `at`,
1772
- `A`,
1773
- `B`,
1774
- `C`,
1775
- `D`,
1776
- `E`,
1777
- `F`,
1778
- `G`,
1779
- `H`,
1780
- `I`,
1781
- `J`,
1782
- `K`,
1783
- `L`,
1784
- `M`,
1785
- `N`,
1786
- `O`,
1787
- `P`,
1788
- `Q`,
1789
- `R`,
1790
- `S`,
1791
- `T`,
1792
- `U`,
1793
- `V`,
1794
- `W`,
1795
- `X`,
1796
- `Y`,
1797
- `Z`,
1798
- `bracketleft`,
1799
- `backslash`,
1800
- `bracketright`,
1801
- `asciicircum`,
1802
- `underscore`,
1803
- `grave`,
1804
- `a`,
1805
- `b`,
1806
- `c`,
1807
- `d`,
1808
- `e`,
1809
- `f`,
1810
- `g`,
1811
- `h`,
1812
- `i`,
1813
- `j`,
1814
- `k`,
1815
- `l`,
1816
- `m`,
1817
- `n`,
1818
- `o`,
1819
- `p`,
1820
- `q`,
1821
- `r`,
1822
- `s`,
1823
- `t`,
1824
- `u`,
1825
- `v`,
1826
- `w`,
1827
- `x`,
1828
- `y`,
1829
- `z`,
1830
- `braceleft`,
1831
- `bar`,
1832
- `braceright`,
1833
- `asciitilde`,
1834
- `Adieresis`,
1835
- `Aring`,
1836
- `Ccedilla`,
1837
- `Eacute`,
1838
- `Ntilde`,
1839
- `Odieresis`,
1840
- `Udieresis`,
1841
- `aacute`,
1842
- `agrave`,
1843
- `acircumflex`,
1844
- `adieresis`,
1845
- `atilde`,
1846
- `aring`,
1847
- `ccedilla`,
1848
- `eacute`,
1849
- `egrave`,
1850
- `ecircumflex`,
1851
- `edieresis`,
1852
- `iacute`,
1853
- `igrave`,
1854
- `icircumflex`,
1855
- `idieresis`,
1856
- `ntilde`,
1857
- `oacute`,
1858
- `ograve`,
1859
- `ocircumflex`,
1860
- `odieresis`,
1861
- `otilde`,
1862
- `uacute`,
1863
- `ugrave`,
1864
- `ucircumflex`,
1865
- `udieresis`,
1866
- `dagger`,
1867
- `degree`,
1868
- `cent`,
1869
- `sterling`,
1870
- `section`,
1871
- `bullet`,
1872
- `paragraph`,
1873
- `germandbls`,
1874
- `registered`,
1875
- `copyright`,
1876
- `trademark`,
1877
- `acute`,
1878
- `dieresis`,
1879
- `notequal`,
1880
- `AE`,
1881
- `Oslash`,
1882
- `infinity`,
1883
- `plusminus`,
1884
- `lessequal`,
1885
- `greaterequal`,
1886
- `yen`,
1887
- `mu`,
1888
- `partialdiff`,
1889
- `summation`,
1890
- `product`,
1891
- `pi`,
1892
- `integral`,
1893
- `ordfeminine`,
1894
- `ordmasculine`,
1895
- `Omega`,
1896
- `ae`,
1897
- `oslash`,
1898
- `questiondown`,
1899
- `exclamdown`,
1900
- `logicalnot`,
1901
- `radical`,
1902
- `florin`,
1903
- `approxequal`,
1904
- `Delta`,
1905
- `guillemotleft`,
1906
- `guillemotright`,
1907
- `ellipsis`,
1908
- `nonbreakingspace`,
1909
- `Agrave`,
1910
- `Atilde`,
1911
- `Otilde`,
1912
- `OE`,
1913
- `oe`,
1914
- `endash`,
1915
- `emdash`,
1916
- `quotedblleft`,
1917
- `quotedblright`,
1918
- `quoteleft`,
1919
- `quoteright`,
1920
- `divide`,
1921
- `lozenge`,
1922
- `ydieresis`,
1923
- `Ydieresis`,
1924
- `fraction`,
1925
- `currency`,
1926
- `guilsinglleft`,
1927
- `guilsinglright`,
1928
- `fi`,
1929
- `fl`,
1930
- `daggerdbl`,
1931
- `periodcentered`,
1932
- `quotesinglbase`,
1933
- `quotedblbase`,
1934
- `perthousand`,
1935
- `Acircumflex`,
1936
- `Ecircumflex`,
1937
- `Aacute`,
1938
- `Edieresis`,
1939
- `Egrave`,
1940
- `Iacute`,
1941
- `Icircumflex`,
1942
- `Idieresis`,
1943
- `Igrave`,
1944
- `Oacute`,
1945
- `Ocircumflex`,
1946
- `apple`,
1947
- `Ograve`,
1948
- `Uacute`,
1949
- `Ucircumflex`,
1950
- `Ugrave`,
1951
- `dotlessi`,
1952
- `circumflex`,
1953
- `tilde`,
1954
- `macron`,
1955
- `breve`,
1956
- `dotaccent`,
1957
- `ring`,
1958
- `cedilla`,
1959
- `hungarumlaut`,
1960
- `ogonek`,
1961
- `caron`,
1962
- `Lslash`,
1963
- `lslash`,
1964
- `Scaron`,
1965
- `scaron`,
1966
- `Zcaron`,
1967
- `zcaron`,
1968
- `brokenbar`,
1969
- `Eth`,
1970
- `eth`,
1971
- `Yacute`,
1972
- `yacute`,
1973
- `Thorn`,
1974
- `thorn`,
1975
- `minus`,
1976
- `multiply`,
1977
- `onesuperior`,
1978
- `twosuperior`,
1979
- `threesuperior`,
1980
- `onehalf`,
1981
- `onequarter`,
1982
- `threequarters`,
1983
- `franc`,
1984
- `Gbreve`,
1985
- `gbreve`,
1986
- `Idotaccent`,
1987
- `Scedilla`,
1988
- `scedilla`,
1989
- `Cacute`,
1990
- `cacute`,
1991
- `Ccaron`,
1992
- `ccaron`,
1993
- `dcroat`,
1994
- ];
1995
- var post$1 = Object.freeze( { __proto__: null, post: post } );
1996
- class BASE extends SimpleTable {
1997
- constructor( dict, dataview ) {
1998
- const { p: p } = super( dict, dataview );
1999
- this.majorVersion = p.uint16;
2000
- this.minorVersion = p.uint16;
2001
- this.horizAxisOffset = p.Offset16;
2002
- this.vertAxisOffset = p.Offset16;
2003
- lazy$1(
2004
- this,
2005
- `horizAxis`,
2006
- () =>
2007
- new AxisTable(
2008
- { offset: dict.offset + this.horizAxisOffset },
2009
- dataview
2010
- )
2011
- );
2012
- lazy$1(
2013
- this,
2014
- `vertAxis`,
2015
- () =>
2016
- new AxisTable(
2017
- { offset: dict.offset + this.vertAxisOffset },
2018
- dataview
2019
- )
2020
- );
2021
- if ( this.majorVersion === 1 && this.minorVersion === 1 ) {
2022
- this.itemVarStoreOffset = p.Offset32;
2023
- lazy$1(
2024
- this,
2025
- `itemVarStore`,
2026
- () =>
2027
- new AxisTable(
2028
- { offset: dict.offset + this.itemVarStoreOffset },
2029
- dataview
2030
- )
2031
- );
2032
- }
2033
- }
2034
- }
2035
- class AxisTable extends SimpleTable {
2036
- constructor( dict, dataview ) {
2037
- const { p: p } = super( dict, dataview, `AxisTable` );
2038
- this.baseTagListOffset = p.Offset16;
2039
- this.baseScriptListOffset = p.Offset16;
2040
- lazy$1(
2041
- this,
2042
- `baseTagList`,
2043
- () =>
2044
- new BaseTagListTable(
2045
- { offset: dict.offset + this.baseTagListOffset },
2046
- dataview
2047
- )
2048
- );
2049
- lazy$1(
2050
- this,
2051
- `baseScriptList`,
2052
- () =>
2053
- new BaseScriptListTable(
2054
- { offset: dict.offset + this.baseScriptListOffset },
2055
- dataview
2056
- )
2057
- );
2058
- }
2059
- }
2060
- class BaseTagListTable extends SimpleTable {
2061
- constructor( dict, dataview ) {
2062
- const { p: p } = super( dict, dataview, `BaseTagListTable` );
2063
- this.baseTagCount = p.uint16;
2064
- this.baselineTags = [ ...new Array( this.baseTagCount ) ].map(
2065
- ( _ ) => p.tag
2066
- );
2067
- }
2068
- }
2069
- class BaseScriptListTable extends SimpleTable {
2070
- constructor( dict, dataview ) {
2071
- const { p: p } = super( dict, dataview, `BaseScriptListTable` );
2072
- this.baseScriptCount = p.uint16;
2073
- const recordStart = p.currentPosition;
2074
- lazy$1( this, `baseScriptRecords`, () => {
2075
- p.currentPosition = recordStart;
2076
- return [ ...new Array( this.baseScriptCount ) ].map(
2077
- ( _ ) => new BaseScriptRecord( this.start, p )
2078
- );
2079
- } );
2080
- }
2081
- }
2082
- class BaseScriptRecord {
2083
- constructor( baseScriptListTableStart, p ) {
2084
- this.baseScriptTag = p.tag;
2085
- this.baseScriptOffset = p.Offset16;
2086
- lazy$1( this, `baseScriptTable`, () => {
2087
- p.currentPosition =
2088
- baseScriptListTableStart + this.baseScriptOffset;
2089
- return new BaseScriptTable( p );
2090
- } );
2091
- }
2092
- }
2093
- class BaseScriptTable {
2094
- constructor( p ) {
2095
- this.start = p.currentPosition;
2096
- this.baseValuesOffset = p.Offset16;
2097
- this.defaultMinMaxOffset = p.Offset16;
2098
- this.baseLangSysCount = p.uint16;
2099
- this.baseLangSysRecords = [ ...new Array( this.baseLangSysCount ) ].map(
2100
- ( _ ) => new BaseLangSysRecord( this.start, p )
2101
- );
2102
- lazy$1( this, `baseValues`, () => {
2103
- p.currentPosition = this.start + this.baseValuesOffset;
2104
- return new BaseValuesTable( p );
2105
- } );
2106
- lazy$1( this, `defaultMinMax`, () => {
2107
- p.currentPosition = this.start + this.defaultMinMaxOffset;
2108
- return new MinMaxTable( p );
2109
- } );
2110
- }
2111
- }
2112
- class BaseLangSysRecord {
2113
- constructor( baseScriptTableStart, p ) {
2114
- this.baseLangSysTag = p.tag;
2115
- this.minMaxOffset = p.Offset16;
2116
- lazy$1( this, `minMax`, () => {
2117
- p.currentPosition = baseScriptTableStart + this.minMaxOffset;
2118
- return new MinMaxTable( p );
2119
- } );
2120
- }
2121
- }
2122
- class BaseValuesTable {
2123
- constructor( p ) {
2124
- this.parser = p;
2125
- this.start = p.currentPosition;
2126
- this.defaultBaselineIndex = p.uint16;
2127
- this.baseCoordCount = p.uint16;
2128
- this.baseCoords = [ ...new Array( this.baseCoordCount ) ].map(
2129
- ( _ ) => p.Offset16
2130
- );
2131
- }
2132
- getTable( id ) {
2133
- this.parser.currentPosition = this.start + this.baseCoords[ id ];
2134
- return new BaseCoordTable( this.parser );
2135
- }
2136
- }
2137
- class MinMaxTable {
2138
- constructor( p ) {
2139
- this.minCoord = p.Offset16;
2140
- this.maxCoord = p.Offset16;
2141
- this.featMinMaxCount = p.uint16;
2142
- const recordStart = p.currentPosition;
2143
- lazy$1( this, `featMinMaxRecords`, () => {
2144
- p.currentPosition = recordStart;
2145
- return [ ...new Array( this.featMinMaxCount ) ].map(
2146
- ( _ ) => new FeatMinMaxRecord( p )
2147
- );
2148
- } );
2149
- }
2150
- }
2151
- class FeatMinMaxRecord {
2152
- constructor( p ) {
2153
- this.featureTableTag = p.tag;
2154
- this.minCoord = p.Offset16;
2155
- this.maxCoord = p.Offset16;
2156
- }
2157
- }
2158
- class BaseCoordTable {
2159
- constructor( p ) {
2160
- this.baseCoordFormat = p.uint16;
2161
- this.coordinate = p.int16;
2162
- if ( this.baseCoordFormat === 2 ) {
2163
- this.referenceGlyph = p.uint16;
2164
- this.baseCoordPoint = p.uint16;
2165
- }
2166
- if ( this.baseCoordFormat === 3 ) {
2167
- this.deviceTable = p.Offset16;
2168
- }
2169
- }
2170
- }
2171
- var BASE$1 = Object.freeze( { __proto__: null, BASE: BASE } );
2172
- class ClassDefinition {
2173
- constructor( p ) {
2174
- this.classFormat = p.uint16;
2175
- if ( this.classFormat === 1 ) {
2176
- this.startGlyphID = p.uint16;
2177
- this.glyphCount = p.uint16;
2178
- this.classValueArray = [ ...new Array( this.glyphCount ) ].map(
2179
- ( _ ) => p.uint16
2180
- );
2181
- }
2182
- if ( this.classFormat === 2 ) {
2183
- this.classRangeCount = p.uint16;
2184
- this.classRangeRecords = [
2185
- ...new Array( this.classRangeCount ),
2186
- ].map( ( _ ) => new ClassRangeRecord( p ) );
2187
- }
2188
- }
2189
- }
2190
- class ClassRangeRecord {
2191
- constructor( p ) {
2192
- this.startGlyphID = p.uint16;
2193
- this.endGlyphID = p.uint16;
2194
- this.class = p.uint16;
2195
- }
2196
- }
2197
- class CoverageTable extends ParsedData {
2198
- constructor( p ) {
2199
- super( p );
2200
- this.coverageFormat = p.uint16;
2201
- if ( this.coverageFormat === 1 ) {
2202
- this.glyphCount = p.uint16;
2203
- this.glyphArray = [ ...new Array( this.glyphCount ) ].map(
2204
- ( _ ) => p.uint16
2205
- );
2206
- }
2207
- if ( this.coverageFormat === 2 ) {
2208
- this.rangeCount = p.uint16;
2209
- this.rangeRecords = [ ...new Array( this.rangeCount ) ].map(
2210
- ( _ ) => new CoverageRangeRecord( p )
2211
- );
2212
- }
2213
- }
2214
- }
2215
- class CoverageRangeRecord {
2216
- constructor( p ) {
2217
- this.startGlyphID = p.uint16;
2218
- this.endGlyphID = p.uint16;
2219
- this.startCoverageIndex = p.uint16;
2220
- }
2221
- }
2222
- class ItemVariationStoreTable {
2223
- constructor( table, p ) {
2224
- this.table = table;
2225
- this.parser = p;
2226
- this.start = p.currentPosition;
2227
- this.format = p.uint16;
2228
- this.variationRegionListOffset = p.Offset32;
2229
- this.itemVariationDataCount = p.uint16;
2230
- this.itemVariationDataOffsets = [
2231
- ...new Array( this.itemVariationDataCount ),
2232
- ].map( ( _ ) => p.Offset32 );
2233
- }
2234
- }
2235
- class GDEF extends SimpleTable {
2236
- constructor( dict, dataview ) {
2237
- const { p: p } = super( dict, dataview );
2238
- this.majorVersion = p.uint16;
2239
- this.minorVersion = p.uint16;
2240
- this.glyphClassDefOffset = p.Offset16;
2241
- lazy$1( this, `glyphClassDefs`, () => {
2242
- if ( this.glyphClassDefOffset === 0 ) return undefined;
2243
- p.currentPosition = this.tableStart + this.glyphClassDefOffset;
2244
- return new ClassDefinition( p );
2245
- } );
2246
- this.attachListOffset = p.Offset16;
2247
- lazy$1( this, `attachList`, () => {
2248
- if ( this.attachListOffset === 0 ) return undefined;
2249
- p.currentPosition = this.tableStart + this.attachListOffset;
2250
- return new AttachList( p );
2251
- } );
2252
- this.ligCaretListOffset = p.Offset16;
2253
- lazy$1( this, `ligCaretList`, () => {
2254
- if ( this.ligCaretListOffset === 0 ) return undefined;
2255
- p.currentPosition = this.tableStart + this.ligCaretListOffset;
2256
- return new LigCaretList( p );
2257
- } );
2258
- this.markAttachClassDefOffset = p.Offset16;
2259
- lazy$1( this, `markAttachClassDef`, () => {
2260
- if ( this.markAttachClassDefOffset === 0 ) return undefined;
2261
- p.currentPosition = this.tableStart + this.markAttachClassDefOffset;
2262
- return new ClassDefinition( p );
2263
- } );
2264
- if ( this.minorVersion >= 2 ) {
2265
- this.markGlyphSetsDefOffset = p.Offset16;
2266
- lazy$1( this, `markGlyphSetsDef`, () => {
2267
- if ( this.markGlyphSetsDefOffset === 0 ) return undefined;
2268
- p.currentPosition =
2269
- this.tableStart + this.markGlyphSetsDefOffset;
2270
- return new MarkGlyphSetsTable( p );
2271
- } );
2272
- }
2273
- if ( this.minorVersion === 3 ) {
2274
- this.itemVarStoreOffset = p.Offset32;
2275
- lazy$1( this, `itemVarStore`, () => {
2276
- if ( this.itemVarStoreOffset === 0 ) return undefined;
2277
- p.currentPosition = this.tableStart + this.itemVarStoreOffset;
2278
- return new ItemVariationStoreTable( p );
2279
- } );
2280
- }
2281
- }
2282
- }
2283
- class AttachList extends ParsedData {
2284
- constructor( p ) {
2285
- super( p );
2286
- this.coverageOffset = p.Offset16;
2287
- this.glyphCount = p.uint16;
2288
- this.attachPointOffsets = [ ...new Array( this.glyphCount ) ].map(
2289
- ( _ ) => p.Offset16
2290
- );
2291
- }
2292
- getPoint( pointID ) {
2293
- this.parser.currentPosition =
2294
- this.start + this.attachPointOffsets[ pointID ];
2295
- return new AttachPoint( this.parser );
2296
- }
2297
- }
2298
- class AttachPoint {
2299
- constructor( p ) {
2300
- this.pointCount = p.uint16;
2301
- this.pointIndices = [ ...new Array( this.pointCount ) ].map(
2302
- ( _ ) => p.uint16
2303
- );
2304
- }
2305
- }
2306
- class LigCaretList extends ParsedData {
2307
- constructor( p ) {
2308
- super( p );
2309
- this.coverageOffset = p.Offset16;
2310
- lazy$1( this, `coverage`, () => {
2311
- p.currentPosition = this.start + this.coverageOffset;
2312
- return new CoverageTable( p );
2313
- } );
2314
- this.ligGlyphCount = p.uint16;
2315
- this.ligGlyphOffsets = [ ...new Array( this.ligGlyphCount ) ].map(
2316
- ( _ ) => p.Offset16
2317
- );
2318
- }
2319
- getLigGlyph( ligGlyphID ) {
2320
- this.parser.currentPosition =
2321
- this.start + this.ligGlyphOffsets[ ligGlyphID ];
2322
- return new LigGlyph( this.parser );
2323
- }
2324
- }
2325
- class LigGlyph extends ParsedData {
2326
- constructor( p ) {
2327
- super( p );
2328
- this.caretCount = p.uint16;
2329
- this.caretValueOffsets = [ ...new Array( this.caretCount ) ].map(
2330
- ( _ ) => p.Offset16
2331
- );
2332
- }
2333
- getCaretValue( caretID ) {
2334
- this.parser.currentPosition =
2335
- this.start + this.caretValueOffsets[ caretID ];
2336
- return new CaretValue( this.parser );
2337
- }
2338
- }
2339
- class CaretValue {
2340
- constructor( p ) {
2341
- this.caretValueFormat = p.uint16;
2342
- if ( this.caretValueFormat === 1 ) {
2343
- this.coordinate = p.int16;
2344
- }
2345
- if ( this.caretValueFormat === 2 ) {
2346
- this.caretValuePointIndex = p.uint16;
2347
- }
2348
- if ( this.caretValueFormat === 3 ) {
2349
- this.coordinate = p.int16;
2350
- this.deviceOffset = p.Offset16;
2351
- }
2352
- }
2353
- }
2354
- class MarkGlyphSetsTable extends ParsedData {
2355
- constructor( p ) {
2356
- super( p );
2357
- this.markGlyphSetTableFormat = p.uint16;
2358
- this.markGlyphSetCount = p.uint16;
2359
- this.coverageOffsets = [ ...new Array( this.markGlyphSetCount ) ].map(
2360
- ( _ ) => p.Offset32
2361
- );
2362
- }
2363
- getMarkGlyphSet( markGlyphSetID ) {
2364
- this.parser.currentPosition =
2365
- this.start + this.coverageOffsets[ markGlyphSetID ];
2366
- return new CoverageTable( this.parser );
2367
- }
2368
- }
2369
- var GDEF$1 = Object.freeze( { __proto__: null, GDEF: GDEF } );
2370
- class ScriptList extends ParsedData {
2371
- static EMPTY = { scriptCount: 0, scriptRecords: [] };
2372
- constructor( p ) {
2373
- super( p );
2374
- this.scriptCount = p.uint16;
2375
- this.scriptRecords = [ ...new Array( this.scriptCount ) ].map(
2376
- ( _ ) => new ScriptRecord( p )
2377
- );
2378
- }
2379
- }
2380
- class ScriptRecord {
2381
- constructor( p ) {
2382
- this.scriptTag = p.tag;
2383
- this.scriptOffset = p.Offset16;
2384
- }
2385
- }
2386
- class ScriptTable extends ParsedData {
2387
- constructor( p ) {
2388
- super( p );
2389
- this.defaultLangSys = p.Offset16;
2390
- this.langSysCount = p.uint16;
2391
- this.langSysRecords = [ ...new Array( this.langSysCount ) ].map(
2392
- ( _ ) => new LangSysRecord( p )
2393
- );
2394
- }
2395
- }
2396
- class LangSysRecord {
2397
- constructor( p ) {
2398
- this.langSysTag = p.tag;
2399
- this.langSysOffset = p.Offset16;
2400
- }
2401
- }
2402
- class LangSysTable {
2403
- constructor( p ) {
2404
- this.lookupOrder = p.Offset16;
2405
- this.requiredFeatureIndex = p.uint16;
2406
- this.featureIndexCount = p.uint16;
2407
- this.featureIndices = [ ...new Array( this.featureIndexCount ) ].map(
2408
- ( _ ) => p.uint16
2409
- );
2410
- }
2411
- }
2412
- class FeatureList extends ParsedData {
2413
- static EMPTY = { featureCount: 0, featureRecords: [] };
2414
- constructor( p ) {
2415
- super( p );
2416
- this.featureCount = p.uint16;
2417
- this.featureRecords = [ ...new Array( this.featureCount ) ].map(
2418
- ( _ ) => new FeatureRecord( p )
2419
- );
2420
- }
2421
- }
2422
- class FeatureRecord {
2423
- constructor( p ) {
2424
- this.featureTag = p.tag;
2425
- this.featureOffset = p.Offset16;
2426
- }
2427
- }
2428
- class FeatureTable extends ParsedData {
2429
- constructor( p ) {
2430
- super( p );
2431
- this.featureParams = p.Offset16;
2432
- this.lookupIndexCount = p.uint16;
2433
- this.lookupListIndices = [ ...new Array( this.lookupIndexCount ) ].map(
2434
- ( _ ) => p.uint16
2435
- );
2436
- }
2437
- getFeatureParams() {
2438
- if ( this.featureParams > 0 ) {
2439
- const p = this.parser;
2440
- p.currentPosition = this.start + this.featureParams;
2441
- const tag = this.featureTag;
2442
- if ( tag === `size` ) return new Size( p );
2443
- if ( tag.startsWith( `cc` ) ) return new CharacterVariant( p );
2444
- if ( tag.startsWith( `ss` ) ) return new StylisticSet( p );
2445
- }
2446
- }
2447
- }
2448
- class CharacterVariant {
2449
- constructor( p ) {
2450
- this.format = p.uint16;
2451
- this.featUiLabelNameId = p.uint16;
2452
- this.featUiTooltipTextNameId = p.uint16;
2453
- this.sampleTextNameId = p.uint16;
2454
- this.numNamedParameters = p.uint16;
2455
- this.firstParamUiLabelNameId = p.uint16;
2456
- this.charCount = p.uint16;
2457
- this.character = [ ...new Array( this.charCount ) ].map(
2458
- ( _ ) => p.uint24
2459
- );
2460
- }
2461
- }
2462
- class Size {
2463
- constructor( p ) {
2464
- this.designSize = p.uint16;
2465
- this.subfamilyIdentifier = p.uint16;
2466
- this.subfamilyNameID = p.uint16;
2467
- this.smallEnd = p.uint16;
2468
- this.largeEnd = p.uint16;
2469
- }
2470
- }
2471
- class StylisticSet {
2472
- constructor( p ) {
2473
- this.version = p.uint16;
2474
- this.UINameID = p.uint16;
2475
- }
2476
- }
2477
- function undoCoverageOffsetParsing( instance ) {
2478
- instance.parser.currentPosition -= 2;
2479
- delete instance.coverageOffset;
2480
- delete instance.getCoverageTable;
2481
- }
2482
- class LookupType$1 extends ParsedData {
2483
- constructor( p ) {
2484
- super( p );
2485
- this.substFormat = p.uint16;
2486
- this.coverageOffset = p.Offset16;
2487
- }
2488
- getCoverageTable() {
2489
- let p = this.parser;
2490
- p.currentPosition = this.start + this.coverageOffset;
2491
- return new CoverageTable( p );
2492
- }
2493
- }
2494
- class SubstLookupRecord {
2495
- constructor( p ) {
2496
- this.glyphSequenceIndex = p.uint16;
2497
- this.lookupListIndex = p.uint16;
2498
- }
2499
- }
2500
- class LookupType1$1 extends LookupType$1 {
2501
- constructor( p ) {
2502
- super( p );
2503
- this.deltaGlyphID = p.int16;
2504
- }
2505
- }
2506
- class LookupType2$1 extends LookupType$1 {
2507
- constructor( p ) {
2508
- super( p );
2509
- this.sequenceCount = p.uint16;
2510
- this.sequenceOffsets = [ ...new Array( this.sequenceCount ) ].map(
2511
- ( _ ) => p.Offset16
2512
- );
2513
- }
2514
- getSequence( index ) {
2515
- let p = this.parser;
2516
- p.currentPosition = this.start + this.sequenceOffsets[ index ];
2517
- return new SequenceTable( p );
2518
- }
2519
- }
2520
- class SequenceTable {
2521
- constructor( p ) {
2522
- this.glyphCount = p.uint16;
2523
- this.substituteGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
2524
- ( _ ) => p.uint16
2525
- );
2526
- }
2527
- }
2528
- class LookupType3$1 extends LookupType$1 {
2529
- constructor( p ) {
2530
- super( p );
2531
- this.alternateSetCount = p.uint16;
2532
- this.alternateSetOffsets = [
2533
- ...new Array( this.alternateSetCount ),
2534
- ].map( ( _ ) => p.Offset16 );
2535
- }
2536
- getAlternateSet( index ) {
2537
- let p = this.parser;
2538
- p.currentPosition = this.start + this.alternateSetOffsets[ index ];
2539
- return new AlternateSetTable( p );
2540
- }
2541
- }
2542
- class AlternateSetTable {
2543
- constructor( p ) {
2544
- this.glyphCount = p.uint16;
2545
- this.alternateGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
2546
- ( _ ) => p.uint16
2547
- );
2548
- }
2549
- }
2550
- class LookupType4$1 extends LookupType$1 {
2551
- constructor( p ) {
2552
- super( p );
2553
- this.ligatureSetCount = p.uint16;
2554
- this.ligatureSetOffsets = [ ...new Array( this.ligatureSetCount ) ].map(
2555
- ( _ ) => p.Offset16
2556
- );
2557
- }
2558
- getLigatureSet( index ) {
2559
- let p = this.parser;
2560
- p.currentPosition = this.start + this.ligatureSetOffsets[ index ];
2561
- return new LigatureSetTable( p );
2562
- }
2563
- }
2564
- class LigatureSetTable extends ParsedData {
2565
- constructor( p ) {
2566
- super( p );
2567
- this.ligatureCount = p.uint16;
2568
- this.ligatureOffsets = [ ...new Array( this.ligatureCount ) ].map(
2569
- ( _ ) => p.Offset16
2570
- );
2571
- }
2572
- getLigature( index ) {
2573
- let p = this.parser;
2574
- p.currentPosition = this.start + this.ligatureOffsets[ index ];
2575
- return new LigatureTable( p );
2576
- }
2577
- }
2578
- class LigatureTable {
2579
- constructor( p ) {
2580
- this.ligatureGlyph = p.uint16;
2581
- this.componentCount = p.uint16;
2582
- this.componentGlyphIDs = [
2583
- ...new Array( this.componentCount - 1 ),
2584
- ].map( ( _ ) => p.uint16 );
2585
- }
2586
- }
2587
- class LookupType5$1 extends LookupType$1 {
2588
- constructor( p ) {
2589
- super( p );
2590
- if ( this.substFormat === 1 ) {
2591
- this.subRuleSetCount = p.uint16;
2592
- this.subRuleSetOffsets = [
2593
- ...new Array( this.subRuleSetCount ),
2594
- ].map( ( _ ) => p.Offset16 );
2595
- }
2596
- if ( this.substFormat === 2 ) {
2597
- this.classDefOffset = p.Offset16;
2598
- this.subClassSetCount = p.uint16;
2599
- this.subClassSetOffsets = [
2600
- ...new Array( this.subClassSetCount ),
2601
- ].map( ( _ ) => p.Offset16 );
2602
- }
2603
- if ( this.substFormat === 3 ) {
2604
- undoCoverageOffsetParsing( this );
2605
- this.glyphCount = p.uint16;
2606
- this.substitutionCount = p.uint16;
2607
- this.coverageOffsets = [ ...new Array( this.glyphCount ) ].map(
2608
- ( _ ) => p.Offset16
2609
- );
2610
- this.substLookupRecords = [
2611
- ...new Array( this.substitutionCount ),
2612
- ].map( ( _ ) => new SubstLookupRecord( p ) );
2613
- }
2614
- }
2615
- getSubRuleSet( index ) {
2616
- if ( this.substFormat !== 1 )
2617
- throw new Error(
2618
- `lookup type 5.${ this.substFormat } has no subrule sets.`
2619
- );
2620
- let p = this.parser;
2621
- p.currentPosition = this.start + this.subRuleSetOffsets[ index ];
2622
- return new SubRuleSetTable( p );
2623
- }
2624
- getSubClassSet( index ) {
2625
- if ( this.substFormat !== 2 )
2626
- throw new Error(
2627
- `lookup type 5.${ this.substFormat } has no subclass sets.`
2628
- );
2629
- let p = this.parser;
2630
- p.currentPosition = this.start + this.subClassSetOffsets[ index ];
2631
- return new SubClassSetTable( p );
2632
- }
2633
- getCoverageTable( index ) {
2634
- if ( this.substFormat !== 3 && ! index )
2635
- return super.getCoverageTable();
2636
- if ( ! index )
2637
- throw new Error(
2638
- `lookup type 5.${ this.substFormat } requires an coverage table index.`
2639
- );
2640
- let p = this.parser;
2641
- p.currentPosition = this.start + this.coverageOffsets[ index ];
2642
- return new CoverageTable( p );
2643
- }
2644
- }
2645
- class SubRuleSetTable extends ParsedData {
2646
- constructor( p ) {
2647
- super( p );
2648
- this.subRuleCount = p.uint16;
2649
- this.subRuleOffsets = [ ...new Array( this.subRuleCount ) ].map(
2650
- ( _ ) => p.Offset16
2651
- );
2652
- }
2653
- getSubRule( index ) {
2654
- let p = this.parser;
2655
- p.currentPosition = this.start + this.subRuleOffsets[ index ];
2656
- return new SubRuleTable( p );
2657
- }
2658
- }
2659
- class SubRuleTable {
2660
- constructor( p ) {
2661
- this.glyphCount = p.uint16;
2662
- this.substitutionCount = p.uint16;
2663
- this.inputSequence = [ ...new Array( this.glyphCount - 1 ) ].map(
2664
- ( _ ) => p.uint16
2665
- );
2666
- this.substLookupRecords = [
2667
- ...new Array( this.substitutionCount ),
2668
- ].map( ( _ ) => new SubstLookupRecord( p ) );
2669
- }
2670
- }
2671
- class SubClassSetTable extends ParsedData {
2672
- constructor( p ) {
2673
- super( p );
2674
- this.subClassRuleCount = p.uint16;
2675
- this.subClassRuleOffsets = [
2676
- ...new Array( this.subClassRuleCount ),
2677
- ].map( ( _ ) => p.Offset16 );
2678
- }
2679
- getSubClass( index ) {
2680
- let p = this.parser;
2681
- p.currentPosition = this.start + this.subClassRuleOffsets[ index ];
2682
- return new SubClassRuleTable( p );
2683
- }
2684
- }
2685
- class SubClassRuleTable extends SubRuleTable {
2686
- constructor( p ) {
2687
- super( p );
2688
- }
2689
- }
2690
- class LookupType6$1 extends LookupType$1 {
2691
- constructor( p ) {
2692
- super( p );
2693
- if ( this.substFormat === 1 ) {
2694
- this.chainSubRuleSetCount = p.uint16;
2695
- this.chainSubRuleSetOffsets = [
2696
- ...new Array( this.chainSubRuleSetCount ),
2697
- ].map( ( _ ) => p.Offset16 );
2698
- }
2699
- if ( this.substFormat === 2 ) {
2700
- this.backtrackClassDefOffset = p.Offset16;
2701
- this.inputClassDefOffset = p.Offset16;
2702
- this.lookaheadClassDefOffset = p.Offset16;
2703
- this.chainSubClassSetCount = p.uint16;
2704
- this.chainSubClassSetOffsets = [
2705
- ...new Array( this.chainSubClassSetCount ),
2706
- ].map( ( _ ) => p.Offset16 );
2707
- }
2708
- if ( this.substFormat === 3 ) {
2709
- undoCoverageOffsetParsing( this );
2710
- this.backtrackGlyphCount = p.uint16;
2711
- this.backtrackCoverageOffsets = [
2712
- ...new Array( this.backtrackGlyphCount ),
2713
- ].map( ( _ ) => p.Offset16 );
2714
- this.inputGlyphCount = p.uint16;
2715
- this.inputCoverageOffsets = [
2716
- ...new Array( this.inputGlyphCount ),
2717
- ].map( ( _ ) => p.Offset16 );
2718
- this.lookaheadGlyphCount = p.uint16;
2719
- this.lookaheadCoverageOffsets = [
2720
- ...new Array( this.lookaheadGlyphCount ),
2721
- ].map( ( _ ) => p.Offset16 );
2722
- this.seqLookupCount = p.uint16;
2723
- this.seqLookupRecords = [
2724
- ...new Array( this.substitutionCount ),
2725
- ].map( ( _ ) => new SequenceLookupRecord( p ) );
2726
- }
2727
- }
2728
- getChainSubRuleSet( index ) {
2729
- if ( this.substFormat !== 1 )
2730
- throw new Error(
2731
- `lookup type 6.${ this.substFormat } has no chainsubrule sets.`
2732
- );
2733
- let p = this.parser;
2734
- p.currentPosition = this.start + this.chainSubRuleSetOffsets[ index ];
2735
- return new ChainSubRuleSetTable( p );
2736
- }
2737
- getChainSubClassSet( index ) {
2738
- if ( this.substFormat !== 2 )
2739
- throw new Error(
2740
- `lookup type 6.${ this.substFormat } has no chainsubclass sets.`
2741
- );
2742
- let p = this.parser;
2743
- p.currentPosition = this.start + this.chainSubClassSetOffsets[ index ];
2744
- return new ChainSubClassSetTable( p );
2745
- }
2746
- getCoverageFromOffset( offset ) {
2747
- if ( this.substFormat !== 3 )
2748
- throw new Error(
2749
- `lookup type 6.${ this.substFormat } does not use contextual coverage offsets.`
2750
- );
2751
- let p = this.parser;
2752
- p.currentPosition = this.start + offset;
2753
- return new CoverageTable( p );
2754
- }
2755
- }
2756
- class ChainSubRuleSetTable extends ParsedData {
2757
- constructor( p ) {
2758
- super( p );
2759
- this.chainSubRuleCount = p.uint16;
2760
- this.chainSubRuleOffsets = [
2761
- ...new Array( this.chainSubRuleCount ),
2762
- ].map( ( _ ) => p.Offset16 );
2763
- }
2764
- getSubRule( index ) {
2765
- let p = this.parser;
2766
- p.currentPosition = this.start + this.chainSubRuleOffsets[ index ];
2767
- return new ChainSubRuleTable( p );
2768
- }
2769
- }
2770
- class ChainSubRuleTable {
2771
- constructor( p ) {
2772
- this.backtrackGlyphCount = p.uint16;
2773
- this.backtrackSequence = [
2774
- ...new Array( this.backtrackGlyphCount ),
2775
- ].map( ( _ ) => p.uint16 );
2776
- this.inputGlyphCount = p.uint16;
2777
- this.inputSequence = [ ...new Array( this.inputGlyphCount - 1 ) ].map(
2778
- ( _ ) => p.uint16
2779
- );
2780
- this.lookaheadGlyphCount = p.uint16;
2781
- this.lookAheadSequence = [
2782
- ...new Array( this.lookAheadGlyphCount ),
2783
- ].map( ( _ ) => p.uint16 );
2784
- this.substitutionCount = p.uint16;
2785
- this.substLookupRecords = [ ...new Array( this.SubstCount ) ].map(
2786
- ( _ ) => new SubstLookupRecord( p )
2787
- );
2788
- }
2789
- }
2790
- class ChainSubClassSetTable extends ParsedData {
2791
- constructor( p ) {
2792
- super( p );
2793
- this.chainSubClassRuleCount = p.uint16;
2794
- this.chainSubClassRuleOffsets = [
2795
- ...new Array( this.chainSubClassRuleCount ),
2796
- ].map( ( _ ) => p.Offset16 );
2797
- }
2798
- getSubClass( index ) {
2799
- let p = this.parser;
2800
- p.currentPosition = this.start + this.chainSubRuleOffsets[ index ];
2801
- return new ChainSubClassRuleTable( p );
2802
- }
2803
- }
2804
- class ChainSubClassRuleTable {
2805
- constructor( p ) {
2806
- this.backtrackGlyphCount = p.uint16;
2807
- this.backtrackSequence = [
2808
- ...new Array( this.backtrackGlyphCount ),
2809
- ].map( ( _ ) => p.uint16 );
2810
- this.inputGlyphCount = p.uint16;
2811
- this.inputSequence = [ ...new Array( this.inputGlyphCount - 1 ) ].map(
2812
- ( _ ) => p.uint16
2813
- );
2814
- this.lookaheadGlyphCount = p.uint16;
2815
- this.lookAheadSequence = [
2816
- ...new Array( this.lookAheadGlyphCount ),
2817
- ].map( ( _ ) => p.uint16 );
2818
- this.substitutionCount = p.uint16;
2819
- this.substLookupRecords = [
2820
- ...new Array( this.substitutionCount ),
2821
- ].map( ( _ ) => new SequenceLookupRecord( p ) );
2822
- }
2823
- }
2824
- class SequenceLookupRecord extends ParsedData {
2825
- constructor( p ) {
2826
- super( p );
2827
- this.sequenceIndex = p.uint16;
2828
- this.lookupListIndex = p.uint16;
2829
- }
2830
- }
2831
- class LookupType7$1 extends ParsedData {
2832
- constructor( p ) {
2833
- super( p );
2834
- this.substFormat = p.uint16;
2835
- this.extensionLookupType = p.uint16;
2836
- this.extensionOffset = p.Offset32;
2837
- }
2838
- }
2839
- class LookupType8$1 extends LookupType$1 {
2840
- constructor( p ) {
2841
- super( p );
2842
- this.backtrackGlyphCount = p.uint16;
2843
- this.backtrackCoverageOffsets = [
2844
- ...new Array( this.backtrackGlyphCount ),
2845
- ].map( ( _ ) => p.Offset16 );
2846
- this.lookaheadGlyphCount = p.uint16;
2847
- this.lookaheadCoverageOffsets = [
2848
- new Array( this.lookaheadGlyphCount ),
2849
- ].map( ( _ ) => p.Offset16 );
2850
- this.glyphCount = p.uint16;
2851
- this.substituteGlyphIDs = [ ...new Array( this.glyphCount ) ].map(
2852
- ( _ ) => p.uint16
2853
- );
2854
- }
2855
- }
2856
- var GSUBtables = {
2857
- buildSubtable: function ( type, p ) {
2858
- const subtable = new [
2859
- undefined,
2860
- LookupType1$1,
2861
- LookupType2$1,
2862
- LookupType3$1,
2863
- LookupType4$1,
2864
- LookupType5$1,
2865
- LookupType6$1,
2866
- LookupType7$1,
2867
- LookupType8$1,
2868
- ][ type ]( p );
2869
- subtable.type = type;
2870
- return subtable;
2871
- },
2872
- };
2873
- class LookupType extends ParsedData {
2874
- constructor( p ) {
2875
- super( p );
2876
- }
2877
- }
2878
- class LookupType1 extends LookupType {
2879
- constructor( p ) {
2880
- super( p );
2881
- console.log( `lookup type 1` );
2882
- }
2883
- }
2884
- class LookupType2 extends LookupType {
2885
- constructor( p ) {
2886
- super( p );
2887
- console.log( `lookup type 2` );
2888
- }
2889
- }
2890
- class LookupType3 extends LookupType {
2891
- constructor( p ) {
2892
- super( p );
2893
- console.log( `lookup type 3` );
2894
- }
2895
- }
2896
- class LookupType4 extends LookupType {
2897
- constructor( p ) {
2898
- super( p );
2899
- console.log( `lookup type 4` );
2900
- }
2901
- }
2902
- class LookupType5 extends LookupType {
2903
- constructor( p ) {
2904
- super( p );
2905
- console.log( `lookup type 5` );
2906
- }
2907
- }
2908
- class LookupType6 extends LookupType {
2909
- constructor( p ) {
2910
- super( p );
2911
- console.log( `lookup type 6` );
2912
- }
2913
- }
2914
- class LookupType7 extends LookupType {
2915
- constructor( p ) {
2916
- super( p );
2917
- console.log( `lookup type 7` );
2918
- }
2919
- }
2920
- class LookupType8 extends LookupType {
2921
- constructor( p ) {
2922
- super( p );
2923
- console.log( `lookup type 8` );
2924
- }
2925
- }
2926
- class LookupType9 extends LookupType {
2927
- constructor( p ) {
2928
- super( p );
2929
- console.log( `lookup type 9` );
2930
- }
2931
- }
2932
- var GPOStables = {
2933
- buildSubtable: function ( type, p ) {
2934
- const subtable = new [
2935
- undefined,
2936
- LookupType1,
2937
- LookupType2,
2938
- LookupType3,
2939
- LookupType4,
2940
- LookupType5,
2941
- LookupType6,
2942
- LookupType7,
2943
- LookupType8,
2944
- LookupType9,
2945
- ][ type ]( p );
2946
- subtable.type = type;
2947
- return subtable;
2948
- },
2949
- };
2950
- class LookupList extends ParsedData {
2951
- static EMPTY = { lookupCount: 0, lookups: [] };
2952
- constructor( p ) {
2953
- super( p );
2954
- this.lookupCount = p.uint16;
2955
- this.lookups = [ ...new Array( this.lookupCount ) ].map(
2956
- ( _ ) => p.Offset16
2957
- );
2958
- }
2959
- }
2960
- class LookupTable extends ParsedData {
2961
- constructor( p, type ) {
2962
- super( p );
2963
- this.ctType = type;
2964
- this.lookupType = p.uint16;
2965
- this.lookupFlag = p.uint16;
2966
- this.subTableCount = p.uint16;
2967
- this.subtableOffsets = [ ...new Array( this.subTableCount ) ].map(
2968
- ( _ ) => p.Offset16
2969
- );
2970
- this.markFilteringSet = p.uint16;
2971
- }
2972
- get rightToLeft() {
2973
- return this.lookupFlag & ( 1 === 1 );
2974
- }
2975
- get ignoreBaseGlyphs() {
2976
- return this.lookupFlag & ( 2 === 2 );
2977
- }
2978
- get ignoreLigatures() {
2979
- return this.lookupFlag & ( 4 === 4 );
2980
- }
2981
- get ignoreMarks() {
2982
- return this.lookupFlag & ( 8 === 8 );
2983
- }
2984
- get useMarkFilteringSet() {
2985
- return this.lookupFlag & ( 16 === 16 );
2986
- }
2987
- get markAttachmentType() {
2988
- return this.lookupFlag & ( 65280 === 65280 );
2989
- }
2990
- getSubTable( index ) {
2991
- const builder = this.ctType === `GSUB` ? GSUBtables : GPOStables;
2992
- this.parser.currentPosition =
2993
- this.start + this.subtableOffsets[ index ];
2994
- return builder.buildSubtable( this.lookupType, this.parser );
2995
- }
2996
- }
2997
- class CommonLayoutTable extends SimpleTable {
2998
- constructor( dict, dataview, name ) {
2999
- const { p: p, tableStart: tableStart } = super( dict, dataview, name );
3000
- this.majorVersion = p.uint16;
3001
- this.minorVersion = p.uint16;
3002
- this.scriptListOffset = p.Offset16;
3003
- this.featureListOffset = p.Offset16;
3004
- this.lookupListOffset = p.Offset16;
3005
- if ( this.majorVersion === 1 && this.minorVersion === 1 ) {
3006
- this.featureVariationsOffset = p.Offset32;
3007
- }
3008
- const no_content = ! (
3009
- this.scriptListOffset ||
3010
- this.featureListOffset ||
3011
- this.lookupListOffset
3012
- );
3013
- lazy$1( this, `scriptList`, () => {
3014
- if ( no_content ) return ScriptList.EMPTY;
3015
- p.currentPosition = tableStart + this.scriptListOffset;
3016
- return new ScriptList( p );
3017
- } );
3018
- lazy$1( this, `featureList`, () => {
3019
- if ( no_content ) return FeatureList.EMPTY;
3020
- p.currentPosition = tableStart + this.featureListOffset;
3021
- return new FeatureList( p );
3022
- } );
3023
- lazy$1( this, `lookupList`, () => {
3024
- if ( no_content ) return LookupList.EMPTY;
3025
- p.currentPosition = tableStart + this.lookupListOffset;
3026
- return new LookupList( p );
3027
- } );
3028
- if ( this.featureVariationsOffset ) {
3029
- lazy$1( this, `featureVariations`, () => {
3030
- if ( no_content ) return FeatureVariations.EMPTY;
3031
- p.currentPosition = tableStart + this.featureVariationsOffset;
3032
- return new FeatureVariations( p );
3033
- } );
3034
- }
3035
- }
3036
- getSupportedScripts() {
3037
- return this.scriptList.scriptRecords.map( ( r ) => r.scriptTag );
3038
- }
3039
- getScriptTable( scriptTag ) {
3040
- let record = this.scriptList.scriptRecords.find(
3041
- ( r ) => r.scriptTag === scriptTag
3042
- );
3043
- this.parser.currentPosition =
3044
- this.scriptList.start + record.scriptOffset;
3045
- let table = new ScriptTable( this.parser );
3046
- table.scriptTag = scriptTag;
3047
- return table;
3048
- }
3049
- ensureScriptTable( arg ) {
3050
- if ( typeof arg === 'string' ) {
3051
- return this.getScriptTable( arg );
3052
- }
3053
- return arg;
3054
- }
3055
- getSupportedLangSys( scriptTable ) {
3056
- scriptTable = this.ensureScriptTable( scriptTable );
3057
- const hasDefault = scriptTable.defaultLangSys !== 0;
3058
- const supported = scriptTable.langSysRecords.map(
3059
- ( l ) => l.langSysTag
3060
- );
3061
- if ( hasDefault ) supported.unshift( `dflt` );
3062
- return supported;
3063
- }
3064
- getDefaultLangSysTable( scriptTable ) {
3065
- scriptTable = this.ensureScriptTable( scriptTable );
3066
- let offset = scriptTable.defaultLangSys;
3067
- if ( offset !== 0 ) {
3068
- this.parser.currentPosition = scriptTable.start + offset;
3069
- let table = new LangSysTable( this.parser );
3070
- table.langSysTag = ``;
3071
- table.defaultForScript = scriptTable.scriptTag;
3072
- return table;
3073
- }
3074
- }
3075
- getLangSysTable( scriptTable, langSysTag = `dflt` ) {
3076
- if ( langSysTag === `dflt` )
3077
- return this.getDefaultLangSysTable( scriptTable );
3078
- scriptTable = this.ensureScriptTable( scriptTable );
3079
- let record = scriptTable.langSysRecords.find(
3080
- ( l ) => l.langSysTag === langSysTag
3081
- );
3082
- this.parser.currentPosition = scriptTable.start + record.langSysOffset;
3083
- let table = new LangSysTable( this.parser );
3084
- table.langSysTag = langSysTag;
3085
- return table;
3086
- }
3087
- getFeatures( langSysTable ) {
3088
- return langSysTable.featureIndices.map( ( index ) =>
3089
- this.getFeature( index )
3090
- );
3091
- }
3092
- getFeature( indexOrTag ) {
3093
- let record;
3094
- if ( parseInt( indexOrTag ) == indexOrTag ) {
3095
- record = this.featureList.featureRecords[ indexOrTag ];
3096
- } else {
3097
- record = this.featureList.featureRecords.find(
3098
- ( f ) => f.featureTag === indexOrTag
3099
- );
3100
- }
3101
- if ( ! record ) return;
3102
- this.parser.currentPosition =
3103
- this.featureList.start + record.featureOffset;
3104
- let table = new FeatureTable( this.parser );
3105
- table.featureTag = record.featureTag;
3106
- return table;
3107
- }
3108
- getLookups( featureTable ) {
3109
- return featureTable.lookupListIndices.map( ( index ) =>
3110
- this.getLookup( index )
3111
- );
3112
- }
3113
- getLookup( lookupIndex, type ) {
3114
- let lookupOffset = this.lookupList.lookups[ lookupIndex ];
3115
- this.parser.currentPosition = this.lookupList.start + lookupOffset;
3116
- return new LookupTable( this.parser, type );
3117
- }
3118
- }
3119
- class GSUB extends CommonLayoutTable {
3120
- constructor( dict, dataview ) {
3121
- super( dict, dataview, `GSUB` );
3122
- }
3123
- getLookup( lookupIndex ) {
3124
- return super.getLookup( lookupIndex, `GSUB` );
3125
- }
3126
- }
3127
- var GSUB$1 = Object.freeze( { __proto__: null, GSUB: GSUB } );
3128
- class GPOS extends CommonLayoutTable {
3129
- constructor( dict, dataview ) {
3130
- super( dict, dataview, `GPOS` );
3131
- }
3132
- getLookup( lookupIndex ) {
3133
- return super.getLookup( lookupIndex, `GPOS` );
3134
- }
3135
- }
3136
- var GPOS$1 = Object.freeze( { __proto__: null, GPOS: GPOS } );
3137
- class SVG extends SimpleTable {
3138
- constructor( dict, dataview ) {
3139
- const { p: p } = super( dict, dataview );
3140
- this.version = p.uint16;
3141
- this.offsetToSVGDocumentList = p.Offset32;
3142
- p.currentPosition = this.tableStart + this.offsetToSVGDocumentList;
3143
- this.documentList = new SVGDocumentList( p );
3144
- }
3145
- }
3146
- class SVGDocumentList extends ParsedData {
3147
- constructor( p ) {
3148
- super( p );
3149
- this.numEntries = p.uint16;
3150
- this.documentRecords = [ ...new Array( this.numEntries ) ].map(
3151
- ( _ ) => new SVGDocumentRecord( p )
3152
- );
3153
- }
3154
- getDocument( documentID ) {
3155
- let record = this.documentRecords[ documentID ];
3156
- if ( ! record ) return '';
3157
- let offset = this.start + record.svgDocOffset;
3158
- this.parser.currentPosition = offset;
3159
- return this.parser.readBytes( record.svgDocLength );
3160
- }
3161
- getDocumentForGlyph( glyphID ) {
3162
- let id = this.documentRecords.findIndex(
3163
- ( d ) => d.startGlyphID <= glyphID && glyphID <= d.endGlyphID
3164
- );
3165
- if ( id === -1 ) return '';
3166
- return this.getDocument( id );
3167
- }
3168
- }
3169
- class SVGDocumentRecord {
3170
- constructor( p ) {
3171
- this.startGlyphID = p.uint16;
3172
- this.endGlyphID = p.uint16;
3173
- this.svgDocOffset = p.Offset32;
3174
- this.svgDocLength = p.uint32;
3175
- }
3176
- }
3177
- var SVG$1 = Object.freeze( { __proto__: null, SVG: SVG } );
3178
- class fvar extends SimpleTable {
3179
- constructor( dict, dataview ) {
3180
- const { p: p } = super( dict, dataview );
3181
- this.majorVersion = p.uint16;
3182
- this.minorVersion = p.uint16;
3183
- this.axesArrayOffset = p.Offset16;
3184
- p.uint16;
3185
- this.axisCount = p.uint16;
3186
- this.axisSize = p.uint16;
3187
- this.instanceCount = p.uint16;
3188
- this.instanceSize = p.uint16;
3189
- const axisStart = this.tableStart + this.axesArrayOffset;
3190
- lazy$1( this, `axes`, () => {
3191
- p.currentPosition = axisStart;
3192
- return [ ...new Array( this.axisCount ) ].map(
3193
- ( _ ) => new VariationAxisRecord( p )
3194
- );
3195
- } );
3196
- const instanceStart = axisStart + this.axisCount * this.axisSize;
3197
- lazy$1( this, `instances`, () => {
3198
- let instances = [];
3199
- for ( let i = 0; i < this.instanceCount; i++ ) {
3200
- p.currentPosition = instanceStart + i * this.instanceSize;
3201
- instances.push(
3202
- new InstanceRecord( p, this.axisCount, this.instanceSize )
3203
- );
3204
- }
3205
- return instances;
3206
- } );
3207
- }
3208
- getSupportedAxes() {
3209
- return this.axes.map( ( a ) => a.tag );
3210
- }
3211
- getAxis( name ) {
3212
- return this.axes.find( ( a ) => a.tag === name );
3213
- }
3214
- }
3215
- class VariationAxisRecord {
3216
- constructor( p ) {
3217
- this.tag = p.tag;
3218
- this.minValue = p.fixed;
3219
- this.defaultValue = p.fixed;
3220
- this.maxValue = p.fixed;
3221
- this.flags = p.flags( 16 );
3222
- this.axisNameID = p.uint16;
3223
- }
3224
- }
3225
- class InstanceRecord {
3226
- constructor( p, axisCount, size ) {
3227
- let start = p.currentPosition;
3228
- this.subfamilyNameID = p.uint16;
3229
- p.uint16;
3230
- this.coordinates = [ ...new Array( axisCount ) ].map(
3231
- ( _ ) => p.fixed
3232
- );
3233
- if ( p.currentPosition - start < size ) {
3234
- this.postScriptNameID = p.uint16;
3235
- }
3236
- }
3237
- }
3238
- var fvar$1 = Object.freeze( { __proto__: null, fvar: fvar } );
3239
- class cvt extends SimpleTable {
3240
- constructor( dict, dataview ) {
3241
- const { p: p } = super( dict, dataview );
3242
- const n = dict.length / 2;
3243
- lazy$1( this, `items`, () =>
3244
- [ ...new Array( n ) ].map( ( _ ) => p.fword )
3245
- );
3246
- }
3247
- }
3248
- var cvt$1 = Object.freeze( { __proto__: null, cvt: cvt } );
3249
- class fpgm extends SimpleTable {
3250
- constructor( dict, dataview ) {
3251
- const { p: p } = super( dict, dataview );
3252
- lazy$1( this, `instructions`, () =>
3253
- [ ...new Array( dict.length ) ].map( ( _ ) => p.uint8 )
3254
- );
3255
- }
3256
- }
3257
- var fpgm$1 = Object.freeze( { __proto__: null, fpgm: fpgm } );
3258
- class gasp extends SimpleTable {
3259
- constructor( dict, dataview ) {
3260
- const { p: p } = super( dict, dataview );
3261
- this.version = p.uint16;
3262
- this.numRanges = p.uint16;
3263
- const getter = () =>
3264
- [ ...new Array( this.numRanges ) ].map(
3265
- ( _ ) => new GASPRange( p )
3266
- );
3267
- lazy$1( this, `gaspRanges`, getter );
3268
- }
3269
- }
3270
- class GASPRange {
3271
- constructor( p ) {
3272
- this.rangeMaxPPEM = p.uint16;
3273
- this.rangeGaspBehavior = p.uint16;
3274
- }
3275
- }
3276
- var gasp$1 = Object.freeze( { __proto__: null, gasp: gasp } );
3277
- class glyf extends SimpleTable {
3278
- constructor( dict, dataview ) {
3279
- super( dict, dataview );
3280
- }
3281
- getGlyphData( offset, length ) {
3282
- this.parser.currentPosition = this.tableStart + offset;
3283
- return this.parser.readBytes( length );
3284
- }
3285
- }
3286
- var glyf$1 = Object.freeze( { __proto__: null, glyf: glyf } );
3287
- class loca extends SimpleTable {
3288
- constructor( dict, dataview, tables ) {
3289
- const { p: p } = super( dict, dataview );
3290
- const n = tables.maxp.numGlyphs + 1;
3291
- if ( tables.head.indexToLocFormat === 0 ) {
3292
- this.x2 = true;
3293
- lazy$1( this, `offsets`, () =>
3294
- [ ...new Array( n ) ].map( ( _ ) => p.Offset16 )
3295
- );
3296
- } else {
3297
- lazy$1( this, `offsets`, () =>
3298
- [ ...new Array( n ) ].map( ( _ ) => p.Offset32 )
3299
- );
3300
- }
3301
- }
3302
- getGlyphDataOffsetAndLength( glyphID ) {
3303
- let offset = this.offsets[ glyphID ] * this.x2 ? 2 : 1;
3304
- let nextOffset = this.offsets[ glyphID + 1 ] * this.x2 ? 2 : 1;
3305
- return { offset: offset, length: nextOffset - offset };
3306
- }
3307
- }
3308
- var loca$1 = Object.freeze( { __proto__: null, loca: loca } );
3309
- class prep extends SimpleTable {
3310
- constructor( dict, dataview ) {
3311
- const { p: p } = super( dict, dataview );
3312
- lazy$1( this, `instructions`, () =>
3313
- [ ...new Array( dict.length ) ].map( ( _ ) => p.uint8 )
3314
- );
3315
- }
3316
- }
3317
- var prep$1 = Object.freeze( { __proto__: null, prep: prep } );
3318
- class CFF extends SimpleTable {
3319
- constructor( dict, dataview ) {
3320
- const { p: p } = super( dict, dataview );
3321
- lazy$1( this, `data`, () => p.readBytes() );
3322
- }
3323
- }
3324
- var CFF$1 = Object.freeze( { __proto__: null, CFF: CFF } );
3325
- class CFF2 extends SimpleTable {
3326
- constructor( dict, dataview ) {
3327
- const { p: p } = super( dict, dataview );
3328
- lazy$1( this, `data`, () => p.readBytes() );
3329
- }
3330
- }
3331
- var CFF2$1 = Object.freeze( { __proto__: null, CFF2: CFF2 } );
3332
- class VORG extends SimpleTable {
3333
- constructor( dict, dataview ) {
3334
- const { p: p } = super( dict, dataview );
3335
- this.majorVersion = p.uint16;
3336
- this.minorVersion = p.uint16;
3337
- this.defaultVertOriginY = p.int16;
3338
- this.numVertOriginYMetrics = p.uint16;
3339
- lazy$1( this, `vertORiginYMetrics`, () =>
3340
- [ ...new Array( this.numVertOriginYMetrics ) ].map(
3341
- ( _ ) => new VertOriginYMetric( p )
3342
- )
3343
- );
3344
- }
3345
- }
3346
- class VertOriginYMetric {
3347
- constructor( p ) {
3348
- this.glyphIndex = p.uint16;
3349
- this.vertOriginY = p.int16;
3350
- }
3351
- }
3352
- var VORG$1 = Object.freeze( { __proto__: null, VORG: VORG } );
3353
- class BitmapSize {
3354
- constructor( p ) {
3355
- this.indexSubTableArrayOffset = p.Offset32;
3356
- this.indexTablesSize = p.uint32;
3357
- this.numberofIndexSubTables = p.uint32;
3358
- this.colorRef = p.uint32;
3359
- this.hori = new SbitLineMetrics( p );
3360
- this.vert = new SbitLineMetrics( p );
3361
- this.startGlyphIndex = p.uint16;
3362
- this.endGlyphIndex = p.uint16;
3363
- this.ppemX = p.uint8;
3364
- this.ppemY = p.uint8;
3365
- this.bitDepth = p.uint8;
3366
- this.flags = p.int8;
3367
- }
3368
- }
3369
- class BitmapScale {
3370
- constructor( p ) {
3371
- this.hori = new SbitLineMetrics( p );
3372
- this.vert = new SbitLineMetrics( p );
3373
- this.ppemX = p.uint8;
3374
- this.ppemY = p.uint8;
3375
- this.substitutePpemX = p.uint8;
3376
- this.substitutePpemY = p.uint8;
3377
- }
3378
- }
3379
- class SbitLineMetrics {
3380
- constructor( p ) {
3381
- this.ascender = p.int8;
3382
- this.descender = p.int8;
3383
- this.widthMax = p.uint8;
3384
- this.caretSlopeNumerator = p.int8;
3385
- this.caretSlopeDenominator = p.int8;
3386
- this.caretOffset = p.int8;
3387
- this.minOriginSB = p.int8;
3388
- this.minAdvanceSB = p.int8;
3389
- this.maxBeforeBL = p.int8;
3390
- this.minAfterBL = p.int8;
3391
- this.pad1 = p.int8;
3392
- this.pad2 = p.int8;
3393
- }
3394
- }
3395
- class EBLC extends SimpleTable {
3396
- constructor( dict, dataview, name ) {
3397
- const { p: p } = super( dict, dataview, name );
3398
- this.majorVersion = p.uint16;
3399
- this.minorVersion = p.uint16;
3400
- this.numSizes = p.uint32;
3401
- lazy$1( this, `bitMapSizes`, () =>
3402
- [ ...new Array( this.numSizes ) ].map(
3403
- ( _ ) => new BitmapSize( p )
3404
- )
3405
- );
3406
- }
3407
- }
3408
- var EBLC$1 = Object.freeze( { __proto__: null, EBLC: EBLC } );
3409
- class EBDT extends SimpleTable {
3410
- constructor( dict, dataview, name ) {
3411
- const { p: p } = super( dict, dataview, name );
3412
- this.majorVersion = p.uint16;
3413
- this.minorVersion = p.uint16;
3414
- }
3415
- }
3416
- var EBDT$1 = Object.freeze( { __proto__: null, EBDT: EBDT } );
3417
- class EBSC extends SimpleTable {
3418
- constructor( dict, dataview ) {
3419
- const { p: p } = super( dict, dataview );
3420
- this.majorVersion = p.uint16;
3421
- this.minorVersion = p.uint16;
3422
- this.numSizes = p.uint32;
3423
- lazy$1( this, `bitmapScales`, () =>
3424
- [ ...new Array( this.numSizes ) ].map(
3425
- ( _ ) => new BitmapScale( p )
3426
- )
3427
- );
3428
- }
3429
- }
3430
- var EBSC$1 = Object.freeze( { __proto__: null, EBSC: EBSC } );
3431
- class CBLC extends EBLC {
3432
- constructor( dict, dataview ) {
3433
- super( dict, dataview, `CBLC` );
3434
- }
3435
- }
3436
- var CBLC$1 = Object.freeze( { __proto__: null, CBLC: CBLC } );
3437
- class CBDT extends EBDT {
3438
- constructor( dict, dataview ) {
3439
- super( dict, dataview, `CBDT` );
3440
- }
3441
- }
3442
- var CBDT$1 = Object.freeze( { __proto__: null, CBDT: CBDT } );
3443
- class sbix extends SimpleTable {
3444
- constructor( dict, dataview ) {
3445
- const { p: p } = super( dict, dataview );
3446
- this.version = p.uint16;
3447
- this.flags = p.flags( 16 );
3448
- this.numStrikes = p.uint32;
3449
- lazy$1( this, `strikeOffsets`, () =>
3450
- [ ...new Array( this.numStrikes ) ].map( ( _ ) => p.Offset32 )
3451
- );
3452
- }
3453
- }
3454
- var sbix$1 = Object.freeze( { __proto__: null, sbix: sbix } );
3455
- class COLR extends SimpleTable {
3456
- constructor( dict, dataview ) {
3457
- const { p: p } = super( dict, dataview );
3458
- this.version = p.uint16;
3459
- this.numBaseGlyphRecords = p.uint16;
3460
- this.baseGlyphRecordsOffset = p.Offset32;
3461
- this.layerRecordsOffset = p.Offset32;
3462
- this.numLayerRecords = p.uint16;
3463
- }
3464
- getBaseGlyphRecord( glyphID ) {
3465
- let start = this.tableStart + this.baseGlyphRecordsOffset;
3466
- this.parser.currentPosition = start;
3467
- let first = new BaseGlyphRecord( this.parser );
3468
- let firstID = first.gID;
3469
- let end = this.tableStart + this.layerRecordsOffset - 6;
3470
- this.parser.currentPosition = end;
3471
- let last = new BaseGlyphRecord( this.parser );
3472
- let lastID = last.gID;
3473
- if ( firstID === glyphID ) return first;
3474
- if ( lastID === glyphID ) return last;
3475
- while ( true ) {
3476
- if ( start === end ) break;
3477
- let mid = start + ( end - start ) / 12;
3478
- this.parser.currentPosition = mid;
3479
- let middle = new BaseGlyphRecord( this.parser );
3480
- let midID = middle.gID;
3481
- if ( midID === glyphID ) return middle;
3482
- else if ( midID > glyphID ) {
3483
- end = mid;
3484
- } else if ( midID < glyphID ) {
3485
- start = mid;
3486
- }
3487
- }
3488
- return false;
3489
- }
3490
- getLayers( glyphID ) {
3491
- let record = this.getBaseGlyphRecord( glyphID );
3492
- this.parser.currentPosition =
3493
- this.tableStart +
3494
- this.layerRecordsOffset +
3495
- 4 * record.firstLayerIndex;
3496
- return [ ...new Array( record.numLayers ) ].map(
3497
- ( _ ) => new LayerRecord( p )
3498
- );
3499
- }
3500
- }
3501
- class BaseGlyphRecord {
3502
- constructor( p ) {
3503
- this.gID = p.uint16;
3504
- this.firstLayerIndex = p.uint16;
3505
- this.numLayers = p.uint16;
3506
- }
3507
- }
3508
- class LayerRecord {
3509
- constructor( p ) {
3510
- this.gID = p.uint16;
3511
- this.paletteIndex = p.uint16;
3512
- }
3513
- }
3514
- var COLR$1 = Object.freeze( { __proto__: null, COLR: COLR } );
3515
- class CPAL extends SimpleTable {
3516
- constructor( dict, dataview ) {
3517
- const { p: p } = super( dict, dataview );
3518
- this.version = p.uint16;
3519
- this.numPaletteEntries = p.uint16;
3520
- const numPalettes = ( this.numPalettes = p.uint16 );
3521
- this.numColorRecords = p.uint16;
3522
- this.offsetFirstColorRecord = p.Offset32;
3523
- this.colorRecordIndices = [ ...new Array( this.numPalettes ) ].map(
3524
- ( _ ) => p.uint16
3525
- );
3526
- lazy$1( this, `colorRecords`, () => {
3527
- p.currentPosition = this.tableStart + this.offsetFirstColorRecord;
3528
- return [ ...new Array( this.numColorRecords ) ].map(
3529
- ( _ ) => new ColorRecord( p )
3530
- );
3531
- } );
3532
- if ( this.version === 1 ) {
3533
- this.offsetPaletteTypeArray = p.Offset32;
3534
- this.offsetPaletteLabelArray = p.Offset32;
3535
- this.offsetPaletteEntryLabelArray = p.Offset32;
3536
- lazy$1( this, `paletteTypeArray`, () => {
3537
- p.currentPosition =
3538
- this.tableStart + this.offsetPaletteTypeArray;
3539
- return new PaletteTypeArray( p, numPalettes );
3540
- } );
3541
- lazy$1( this, `paletteLabelArray`, () => {
3542
- p.currentPosition =
3543
- this.tableStart + this.offsetPaletteLabelArray;
3544
- return new PaletteLabelsArray( p, numPalettes );
3545
- } );
3546
- lazy$1( this, `paletteEntryLabelArray`, () => {
3547
- p.currentPosition =
3548
- this.tableStart + this.offsetPaletteEntryLabelArray;
3549
- return new PaletteEntryLabelArray( p, numPalettes );
3550
- } );
3551
- }
3552
- }
3553
- }
3554
- class ColorRecord {
3555
- constructor( p ) {
3556
- this.blue = p.uint8;
3557
- this.green = p.uint8;
3558
- this.red = p.uint8;
3559
- this.alpha = p.uint8;
3560
- }
3561
- }
3562
- class PaletteTypeArray {
3563
- constructor( p, numPalettes ) {
3564
- this.paletteTypes = [ ...new Array( numPalettes ) ].map(
3565
- ( _ ) => p.uint32
3566
- );
3567
- }
3568
- }
3569
- class PaletteLabelsArray {
3570
- constructor( p, numPalettes ) {
3571
- this.paletteLabels = [ ...new Array( numPalettes ) ].map(
3572
- ( _ ) => p.uint16
3573
- );
3574
- }
3575
- }
3576
- class PaletteEntryLabelArray {
3577
- constructor( p, numPalettes ) {
3578
- this.paletteEntryLabels = [ ...new Array( numPalettes ) ].map(
3579
- ( _ ) => p.uint16
3580
- );
3581
- }
3582
- }
3583
- var CPAL$1 = Object.freeze( { __proto__: null, CPAL: CPAL } );
3584
- class DSIG extends SimpleTable {
3585
- constructor( dict, dataview ) {
3586
- const { p: p } = super( dict, dataview );
3587
- this.version = p.uint32;
3588
- this.numSignatures = p.uint16;
3589
- this.flags = p.uint16;
3590
- this.signatureRecords = [ ...new Array( this.numSignatures ) ].map(
3591
- ( _ ) => new SignatureRecord( p )
3592
- );
3593
- }
3594
- getData( signatureID ) {
3595
- const record = this.signatureRecords[ signatureID ];
3596
- this.parser.currentPosition = this.tableStart + record.offset;
3597
- return new SignatureBlockFormat1( this.parser );
3598
- }
3599
- }
3600
- class SignatureRecord {
3601
- constructor( p ) {
3602
- this.format = p.uint32;
3603
- this.length = p.uint32;
3604
- this.offset = p.Offset32;
3605
- }
3606
- }
3607
- class SignatureBlockFormat1 {
3608
- constructor( p ) {
3609
- p.uint16;
3610
- p.uint16;
3611
- this.signatureLength = p.uint32;
3612
- this.signature = p.readBytes( this.signatureLength );
3613
- }
3614
- }
3615
- var DSIG$1 = Object.freeze( { __proto__: null, DSIG: DSIG } );
3616
- class hdmx extends SimpleTable {
3617
- constructor( dict, dataview, tables ) {
3618
- const { p: p } = super( dict, dataview );
3619
- const numGlyphs = tables.hmtx.numGlyphs;
3620
- this.version = p.uint16;
3621
- this.numRecords = p.int16;
3622
- this.sizeDeviceRecord = p.int32;
3623
- this.records = [ ...new Array( numRecords ) ].map(
3624
- ( _ ) => new DeviceRecord( p, numGlyphs )
3625
- );
3626
- }
3627
- }
3628
- class DeviceRecord {
3629
- constructor( p, numGlyphs ) {
3630
- this.pixelSize = p.uint8;
3631
- this.maxWidth = p.uint8;
3632
- this.widths = p.readBytes( numGlyphs );
3633
- }
3634
- }
3635
- var hdmx$1 = Object.freeze( { __proto__: null, hdmx: hdmx } );
3636
- class kern extends SimpleTable {
3637
- constructor( dict, dataview ) {
3638
- const { p: p } = super( dict, dataview );
3639
- this.version = p.uint16;
3640
- this.nTables = p.uint16;
3641
- lazy$1( this, `tables`, () => {
3642
- let offset = this.tableStart + 4;
3643
- const tables = [];
3644
- for ( let i = 0; i < this.nTables; i++ ) {
3645
- p.currentPosition = offset;
3646
- let subtable = new KernSubTable( p );
3647
- tables.push( subtable );
3648
- offset += subtable;
3649
- }
3650
- return tables;
3651
- } );
3652
- }
3653
- }
3654
- class KernSubTable {
3655
- constructor( p ) {
3656
- this.version = p.uint16;
3657
- this.length = p.uint16;
3658
- this.coverage = p.flags( 8 );
3659
- this.format = p.uint8;
3660
- if ( this.format === 0 ) {
3661
- this.nPairs = p.uint16;
3662
- this.searchRange = p.uint16;
3663
- this.entrySelector = p.uint16;
3664
- this.rangeShift = p.uint16;
3665
- lazy$1( this, `pairs`, () =>
3666
- [ ...new Array( this.nPairs ) ].map( ( _ ) => new Pair( p ) )
3667
- );
3668
- }
3669
- if ( this.format === 2 ) {
3670
- console.warn(
3671
- `Kern subtable format 2 is not supported: this parser currently only parses universal table data.`
3672
- );
3673
- }
3674
- }
3675
- get horizontal() {
3676
- return this.coverage[ 0 ];
3677
- }
3678
- get minimum() {
3679
- return this.coverage[ 1 ];
3680
- }
3681
- get crossstream() {
3682
- return this.coverage[ 2 ];
3683
- }
3684
- get override() {
3685
- return this.coverage[ 3 ];
3686
- }
3687
- }
3688
- class Pair {
3689
- constructor( p ) {
3690
- this.left = p.uint16;
3691
- this.right = p.uint16;
3692
- this.value = p.fword;
3693
- }
3694
- }
3695
- var kern$1 = Object.freeze( { __proto__: null, kern: kern } );
3696
- class LTSH extends SimpleTable {
3697
- constructor( dict, dataview ) {
3698
- const { p: p } = super( dict, dataview );
3699
- this.version = p.uint16;
3700
- this.numGlyphs = p.uint16;
3701
- this.yPels = p.readBytes( this.numGlyphs );
3702
- }
3703
- }
3704
- var LTSH$1 = Object.freeze( { __proto__: null, LTSH: LTSH } );
3705
- class MERG extends SimpleTable {
3706
- constructor( dict, dataview ) {
3707
- const { p: p } = super( dict, dataview );
3708
- this.version = p.uint16;
3709
- this.mergeClassCount = p.uint16;
3710
- this.mergeDataOffset = p.Offset16;
3711
- this.classDefCount = p.uint16;
3712
- this.offsetToClassDefOffsets = p.Offset16;
3713
- lazy$1( this, `mergeEntryMatrix`, () =>
3714
- [ ...new Array( this.mergeClassCount ) ].map( ( _ ) =>
3715
- p.readBytes( this.mergeClassCount )
3716
- )
3717
- );
3718
- console.warn( `Full MERG parsing is currently not supported.` );
3719
- console.warn(
3720
- `If you need this table parsed, please file an issue, or better yet, a PR.`
3721
- );
3722
- }
3723
- }
3724
- var MERG$1 = Object.freeze( { __proto__: null, MERG: MERG } );
3725
- class meta extends SimpleTable {
3726
- constructor( dict, dataview ) {
3727
- const { p: p } = super( dict, dataview );
3728
- this.version = p.uint32;
3729
- this.flags = p.uint32;
3730
- p.uint32;
3731
- this.dataMapsCount = p.uint32;
3732
- this.dataMaps = [ ...new Array( this.dataMapsCount ) ].map(
3733
- ( _ ) => new DataMap( this.tableStart, p )
3734
- );
3735
- }
3736
- }
3737
- class DataMap {
3738
- constructor( tableStart, p ) {
3739
- this.tableStart = tableStart;
3740
- this.parser = p;
3741
- this.tag = p.tag;
3742
- this.dataOffset = p.Offset32;
3743
- this.dataLength = p.uint32;
3744
- }
3745
- getData() {
3746
- this.parser.currentField = this.tableStart + this.dataOffset;
3747
- return this.parser.readBytes( this.dataLength );
3748
- }
3749
- }
3750
- var meta$1 = Object.freeze( { __proto__: null, meta: meta } );
3751
- class PCLT extends SimpleTable {
3752
- constructor( dict, dataview ) {
3753
- super( dict, dataview );
3754
- console.warn(
3755
- `This font uses a PCLT table, which is currently not supported by this parser.`
3756
- );
3757
- console.warn(
3758
- `If you need this table parsed, please file an issue, or better yet, a PR.`
3759
- );
3760
- }
3761
- }
3762
- var PCLT$1 = Object.freeze( { __proto__: null, PCLT: PCLT } );
3763
- class VDMX extends SimpleTable {
3764
- constructor( dict, dataview ) {
3765
- const { p: p } = super( dict, dataview );
3766
- this.version = p.uint16;
3767
- this.numRecs = p.uint16;
3768
- this.numRatios = p.uint16;
3769
- this.ratRanges = [ ...new Array( this.numRatios ) ].map(
3770
- ( _ ) => new RatioRange( p )
3771
- );
3772
- this.offsets = [ ...new Array( this.numRatios ) ].map(
3773
- ( _ ) => p.Offset16
3774
- );
3775
- this.VDMXGroups = [ ...new Array( this.numRecs ) ].map(
3776
- ( _ ) => new VDMXGroup( p )
3777
- );
3778
- }
3779
- }
3780
- class RatioRange {
3781
- constructor( p ) {
3782
- this.bCharSet = p.uint8;
3783
- this.xRatio = p.uint8;
3784
- this.yStartRatio = p.uint8;
3785
- this.yEndRatio = p.uint8;
3786
- }
3787
- }
3788
- class VDMXGroup {
3789
- constructor( p ) {
3790
- this.recs = p.uint16;
3791
- this.startsz = p.uint8;
3792
- this.endsz = p.uint8;
3793
- this.records = [ ...new Array( this.recs ) ].map(
3794
- ( _ ) => new vTable( p )
3795
- );
3796
- }
3797
- }
3798
- class vTable {
3799
- constructor( p ) {
3800
- this.yPelHeight = p.uint16;
3801
- this.yMax = p.int16;
3802
- this.yMin = p.int16;
3803
- }
3804
- }
3805
- var VDMX$1 = Object.freeze( { __proto__: null, VDMX: VDMX } );
3806
- class vhea extends SimpleTable {
3807
- constructor( dict, dataview ) {
3808
- const { p: p } = super( dict, dataview );
3809
- this.version = p.fixed;
3810
- this.ascent = this.vertTypoAscender = p.int16;
3811
- this.descent = this.vertTypoDescender = p.int16;
3812
- this.lineGap = this.vertTypoLineGap = p.int16;
3813
- this.advanceHeightMax = p.int16;
3814
- this.minTopSideBearing = p.int16;
3815
- this.minBottomSideBearing = p.int16;
3816
- this.yMaxExtent = p.int16;
3817
- this.caretSlopeRise = p.int16;
3818
- this.caretSlopeRun = p.int16;
3819
- this.caretOffset = p.int16;
3820
- this.reserved = p.int16;
3821
- this.reserved = p.int16;
3822
- this.reserved = p.int16;
3823
- this.reserved = p.int16;
3824
- this.metricDataFormat = p.int16;
3825
- this.numOfLongVerMetrics = p.uint16;
3826
- p.verifyLength();
3827
- }
3828
- }
3829
- var vhea$1 = Object.freeze( { __proto__: null, vhea: vhea } );
3830
- class vmtx extends SimpleTable {
3831
- constructor( dict, dataview, tables ) {
3832
- super( dict, dataview );
3833
- const numOfLongVerMetrics = tables.vhea.numOfLongVerMetrics;
3834
- const numGlyphs = tables.maxp.numGlyphs;
3835
- const metricsStart = p.currentPosition;
3836
- lazy( this, `vMetrics`, () => {
3837
- p.currentPosition = metricsStart;
3838
- return [ ...new Array( numOfLongVerMetrics ) ].map(
3839
- ( _ ) => new LongVertMetric( p.uint16, p.int16 )
3840
- );
3841
- } );
3842
- if ( numOfLongVerMetrics < numGlyphs ) {
3843
- const tsbStart = metricsStart + numOfLongVerMetrics * 4;
3844
- lazy( this, `topSideBearings`, () => {
3845
- p.currentPosition = tsbStart;
3846
- return [ ...new Array( numGlyphs - numOfLongVerMetrics ) ].map(
3847
- ( _ ) => p.int16
3848
- );
3849
- } );
3850
- }
3851
- }
3852
- }
3853
- class LongVertMetric {
3854
- constructor( h, b ) {
3855
- this.advanceHeight = h;
3856
- this.topSideBearing = b;
3857
- }
3858
- }
3859
- var vmtx$1 = Object.freeze( { __proto__: null, vmtx: vmtx } );
3860
- export { Font };
3861
- /* eslint-enable */