decocms 4.113.3 → 4.113.4
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.
- package/dist/client/assets/{AlertCircle-C3yBEe62.js → AlertCircle-D3NSbtte.js} +1 -1
- package/dist/client/assets/{AreaChart-infhzD-o.js → AreaChart-CVVwbKz-.js} +1 -1
- package/dist/client/assets/{ArrowRight-csX1J00v.js → ArrowRight-ByO1s01w.js} +1 -1
- package/dist/client/assets/{ArrowUp-BMUqiZDH.js → ArrowUp-Cd7BXS0r.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B0lTHBei.js → ArrowUpRight-OT_eUSGv.js} +1 -1
- package/dist/client/assets/{Check-BOCHVTek.js → Check-DexGeb34.js} +1 -1
- package/dist/client/assets/{CheckCircle-C06fMtNJ.js → CheckCircle-BHeeUcEs.js} +1 -1
- package/dist/client/assets/{ChevronDown-yHcuw3Yi.js → ChevronDown-CHuNudj6.js} +1 -1
- package/dist/client/assets/{ChevronRight-BvtCGcbv.js → ChevronRight-CMzdRCrr.js} +1 -1
- package/dist/client/assets/{ChevronUp-ClBbaiAV.js → ChevronUp-lRFXwe0H.js} +1 -1
- package/dist/client/assets/{Copy01-DjMityLv.js → Copy01-uMwlKnXA.js} +1 -1
- package/dist/client/assets/{DotsVertical-C4ZbABhl.js → DotsVertical-BYSP2N_n.js} +1 -1
- package/dist/client/assets/{Eye-Drm0H5R_.js → Eye-BctMyF-b.js} +1 -1
- package/dist/client/assets/{FilterLines-DqKeoryA.js → FilterLines-CN2zN3dy.js} +1 -1
- package/dist/client/assets/{Globe01-BQOw_Ub7.js → Globe01-CdsyprSD.js} +1 -1
- package/dist/client/assets/{Globe04-CGcQW0g-.js → Globe04-Bsu11XTy.js} +1 -1
- package/dist/client/assets/{HardDrive-CWWkxzA_.js → HardDrive-BbGoyEqj.js} +1 -1
- package/dist/client/assets/{Image01-DlFSq1lp.js → Image01-CEPIXDUJ.js} +1 -1
- package/dist/client/assets/{Key01-DrW6AdUh.js → Key01-I5rdl_Gb.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DcUppE8c.js → LayoutLeft-DUKr-FQx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BboRX9pE.js → LinkExternal01-CerBDso7.js} +1 -1
- package/dist/client/assets/{LogOut01-BB-7O4XA.js → LogOut01-BQcYh9Ui.js} +1 -1
- package/dist/client/assets/{Monitor01-CcN96Otm.js → Monitor01-bBKqAlRi.js} +1 -1
- package/dist/client/assets/{Package-BzQD_Ty_.js → Package-C1L6WXbG.js} +1 -1
- package/dist/client/assets/{Palette-Blkp2e-R.js → Palette-DkA-m4II.js} +1 -1
- package/dist/client/assets/{Play-D8x6tbEi.js → Play-D5AlhRua.js} +1 -1
- package/dist/client/assets/{Plus-CzNYCMBF.js → Plus-B78kfbrH.js} +1 -1
- package/dist/client/assets/{SearchLg-ChhVm0Qf.js → SearchLg-HLi9z3k2.js} +1 -1
- package/dist/client/assets/{SearchMd-CTSIioHN.js → SearchMd-D9xCjcBT.js} +1 -1
- package/dist/client/assets/{Settings02-Cw_4rjJK.js → Settings02-D4D7dHyq.js} +1 -1
- package/dist/client/assets/{Shield01-DSa5H3Oo.js → Shield01-C0sINRXL.js} +1 -1
- package/dist/client/assets/{Star01-D85zX6Wg.js → Star01-Hh5rtrm_.js} +1 -1
- package/dist/client/assets/{Stars01-DTnCAiJN.js → Stars01-BIr-9im_.js} +1 -1
- package/dist/client/assets/{Stars02-BOwVjfZL.js → Stars02-x-FNLmKd.js} +1 -1
- package/dist/client/assets/{Sun-BgpgdJOh.js → Sun-CbURsFMr.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DdzfKexZ.js → SwitchHorizontal01-CI53Hh9k.js} +1 -1
- package/dist/client/assets/{Tool01-BHPElJg3.js → Tool01-CrK-zdU8.js} +1 -1
- package/dist/client/assets/{Tool02-B1WxUTRS.js → Tool02-BLqj76jE.js} +1 -1
- package/dist/client/assets/{Trash01-CQs4hG5x.js → Trash01-Df4dKmk-.js} +1 -1
- package/dist/client/assets/{TrendUp01-Cjtdx_Mr.js → TrendUp01-CDAx5KLE.js} +1 -1
- package/dist/client/assets/{Upload01-2aufxkFJ.js → Upload01-Dy7G4Vqj.js} +1 -1
- package/dist/client/assets/{User01-qg2q5EXG.js → User01-B00HeJ3v.js} +1 -1
- package/dist/client/assets/{Users01-DecEGc0z.js → Users01-demha86n.js} +1 -1
- package/dist/client/assets/{Users03-DvyrEhaR.js → Users03-CK3Zfb7D.js} +1 -1
- package/dist/client/assets/{X-ByT759cs.js → X-CehcuOdv.js} +1 -1
- package/dist/client/assets/{XCircle-bCCgCduZ.js → XCircle-BaIgTqjQ.js} +1 -1
- package/dist/client/assets/{XClose-CZnGWolh.js → XClose-Bf6_Xwqn.js} +1 -1
- package/dist/client/assets/{Zap-CqiaHzzF.js → Zap-CqCVe0AY.js} +1 -1
- package/dist/client/assets/{ZapSquare-c0rQSrXf.js → ZapSquare-UWBEBtze.js} +1 -1
- package/dist/client/assets/{ZoomOut-CrXsudJp.js → ZoomOut-kGLYh1vh.js} +1 -1
- package/dist/client/assets/{access-gate-v1EkWw_v.js → access-gate-Brf1uq7w.js} +1 -1
- package/dist/client/assets/{add-section-modal-CCmZDfGj.js → add-section-modal-hl41gB3e.js} +1 -1
- package/dist/client/assets/{agent-icon-BOnTghRl.js → agent-icon-C5hkjd9d.js} +1 -1
- package/dist/client/assets/{agents-list-Bh9Nz4Fw.js → agents-list-DUZLZiO7.js} +1 -1
- package/dist/client/assets/{ai-providers-B78j6u61.js → ai-providers-Ddtnde82.js} +1 -1
- package/dist/client/assets/{alert-D-rAiL9n.js → alert-C0nUQV3Z.js} +1 -1
- package/dist/client/assets/{alert-dialog-BV1C1gcm.js → alert-dialog-CoSPCPpg.js} +1 -1
- package/dist/client/assets/{app-editor-0kysJGlw.js → app-editor-C022NrTg.js} +1 -1
- package/dist/client/assets/{auth-DrixEdZV.js → auth-3hywqU0Z.js} +1 -1
- package/dist/client/assets/{auth-catchall-OgqNGUQu.js → auth-catchall-B4Hu45Ne.js} +1 -1
- package/dist/client/assets/{auth-entry-Bu-wAE4C.js → auth-entry-Bd0jbgb_.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BPjEQYcT.js → auth-split-layout-CY08Qy2Q.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-trH0piDT.js → authenticate-and-persist-oauth-C97UAKVm.js} +1 -1
- package/dist/client/assets/{automation-list-row-Hhbhn6Ve.js → automation-list-row-CzqgyFTo.js} +1 -1
- package/dist/client/assets/{automation-runs-Cl8NKzOf.js → automation-runs-BJXzFuc5.js} +1 -1
- package/dist/client/assets/{automations-C0XROIdQ.js → automations-BNgdqlWi.js} +1 -1
- package/dist/client/assets/{autosend-bk9SGLB7.js → autosend-DKunmHJC.js} +1 -1
- package/dist/client/assets/{avatar-TfVrzXcD.js → avatar-bZ-OyZ4C.js} +1 -1
- package/dist/client/assets/{badge-Dq8tKfND.js → badge-BEoEV_-s.js} +1 -1
- package/dist/client/assets/{block-document-CSSMbpaN.js → block-document-Bsh4SSZF.js} +1 -1
- package/dist/client/assets/{brand-context-BpSXT9j1.js → brand-context-DsI_N6jC.js} +1 -1
- package/dist/client/assets/{buckets-CSQzXH56.js → buckets-66qFPEUl.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BnemcYrz.js → bulk-category-panel-Cufz0WM3.js} +1 -1
- package/dist/client/assets/{calendar-C4A-LflQ.js → calendar-CtwiiKBb.js} +1 -1
- package/dist/client/assets/{capability-load-error-BVansliv.js → capability-load-error-BIVVxP4I.js} +1 -1
- package/dist/client/assets/{card-CYIXg6Tz.js → card-BzIUIhXj.js} +1 -1
- package/dist/client/assets/{category-editor-CQlm8YTD.js → category-editor-CvwKblO3.js} +1 -1
- package/dist/client/assets/{chat-context-C0qm1cNd.js → chat-context-Crb9rWHK.js} +1 -1
- package/dist/client/assets/{checkbox-CJlLtjz4.js → checkbox-B7FxhNJt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-xyy-6T0v.js → cli-auth-success-B13-d7YS.js} +1 -1
- package/dist/client/assets/{collection-detail-Ber5gOC6.js → collection-detail-CEn6RIOn.js} +1 -1
- package/dist/client/assets/{collection-display-button-_9VLEjYD.js → collection-display-button-CzT8Gsvj.js} +1 -1
- package/dist/client/assets/{collection-search-DMVP7tq9.js → collection-search-CnQx2Rcs.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CfaNknkJ.js → collection-table-wrapper-1UMvZ3fa.js} +1 -1
- package/dist/client/assets/{collection-tabs-BYtcgqcY.js → collection-tabs-CBtRCQQL.js} +1 -1
- package/dist/client/assets/{command-55Q776qF.js → command-C5gxZS1R.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CwQohRCA.js → commerce-onboarding-CB-WZK2l.js} +1 -1
- package/dist/client/assets/{companions-core-BsogTMm0.js → companions-core-42eUIML2.js} +1 -1
- package/dist/client/assets/{connect-Dzubmbm6.js → connect-DrIqorJQ.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BRyqkebt.js → connect-desktop-dialog-BTzMpZn4.js} +1 -1
- package/dist/client/assets/{connection-card-CnHj36QW.js → connection-card-CBIOrMcr.js} +1 -1
- package/dist/client/assets/{connection-detail-DioIwvgq.js → connection-detail-CUFaaTIx.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C36oVpDa.js → connection-form-helpers-51wU-tA4.js} +1 -1
- package/dist/client/assets/{connections-CMhMeidX.js → connections-fJWiq9na.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DbXyz4b2.js → decopilot-sse-pool-JL7UXTva.js} +1 -1
- package/dist/client/assets/{dialog-Mssh4wvU.js → dialog-BopH09uO.js} +1 -1
- package/dist/client/assets/{domain-settings-D5jbLq0-.js → domain-settings-UBCepEd-.js} +1 -1
- package/dist/client/assets/{drawer-Df2dZjAh.js → drawer-4wGUz3NV.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BOgizJmB.js → dropdown-menu-CqUwPgCM.js} +1 -1
- package/dist/client/assets/{empty-state-CajaBMj9.js → empty-state-DMQGyp-2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bd7ZbKmz.js → extract-connection-data-Dg2OurD8.js} +1 -1
- package/dist/client/assets/{file-explorer-C0-F0HB8.js → file-explorer-Cr2rWfg3.js} +1 -1
- package/dist/client/assets/{file-type-icon-DeZBzLiN.js → file-type-icon-Dq1fYczo.js} +1 -1
- package/dist/client/assets/{files-DMRbcRYD.js → files-D11P-V12.js} +1 -1
- package/dist/client/assets/{form-a5EhWS__.js → form-DGbrQv7O.js} +1 -1
- package/dist/client/assets/{general-BXzwd9kr.js → general-ByuqDQPP.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BF2G7ylb.js → github-repo-picker-CsJtF4k1.js} +1 -1
- package/dist/client/assets/{hooks-BYKqudQZ.js → hooks-Bqa3-ZMc.js} +1 -1
- package/dist/client/assets/{index-CDAhksmq.js → index-2cPeCHTJ.js} +1 -1
- package/dist/client/assets/{index-D0XkAkng.js → index-BU5jOX-E.js} +1 -1
- package/dist/client/assets/{index-ChR3SC6w.js → index-BZ6EPALd.js} +1 -1
- package/dist/client/assets/{index-Dd318vVc.js → index-BsEzp8oj.js} +1 -1
- package/dist/client/assets/{index-D3QnFu3t.js → index-BzpPy3wE.js} +3 -3
- package/dist/client/assets/{index-D8_uS6ju.js → index-CYhwzBFB.js} +1 -1
- package/dist/client/assets/{index-BjFrw_Cz.js → index-Cfzztnsx.js} +1 -1
- package/dist/client/assets/{index-D6Qe38nY.js → index-D0ar0WVw.js} +1 -1
- package/dist/client/assets/{index-BzKhWus-.js → index-D3an6z2y.js} +1 -1
- package/dist/client/assets/{index-wa1mGSJt.js → index-DJOz2VN0.js} +5 -5
- package/dist/client/assets/{index-i4iJK1qu.js → index-DNl9xlj2.js} +3 -3
- package/dist/client/assets/{index-BvXIjHT6.js → index-JokIayzs.js} +1 -1
- package/dist/client/assets/{index-DKYptawH.js → index-MOQFWNpJ.js} +1 -1
- package/dist/client/assets/{index-redirect-DAwJl3u9.js → index-redirect-C8kzuGQD.js} +1 -1
- package/dist/client/assets/{input-DBTIXVeB.js → input-BgKPAcUy.js} +1 -1
- package/dist/client/assets/{integration-icon-Cws5p9F1.js → integration-icon-COAmfKM2.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-U14K8dLP.js → invite-member-dialog-D_2ikydr.js} +1 -1
- package/dist/client/assets/{label-hZbHKQe4.js → label-Bit-k39a.js} +1 -1
- package/dist/client/assets/{layout-BbmfwSeT.js → layout-bmMNsy2b.js} +1 -1
- package/dist/client/assets/{login-CYk7QqzO.js → login-Bme8dehk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BBJ-dCGK.js → mcp-oauth-DtUJKJBX.js} +1 -1
- package/dist/client/assets/{members-Br5ZzfAU.js → members-BdjB5MAU.js} +1 -1
- package/dist/client/assets/{monaco-editor-B7XD9jse.js → monaco-editor-BrEGduvG.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CiB1VTGS.js → monitoring-stats-row-CNmPKGSb.js} +1 -1
- package/dist/client/assets/{multi-select-DtCSfvTi.js → multi-select-Bu-8nHIy.js} +1 -1
- package/dist/client/assets/{oauth-callback-CuoSY6yW.js → oauth-callback-DVtgM464.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DTd9RCl8.js → oauth-callback-ai-provider-D0dOkVqX.js} +1 -1
- package/dist/client/assets/{onboarding-VI53SQy5.js → onboarding-BT0PHxMW.js} +1 -1
- package/dist/client/assets/{org-install-BpRHfBoz.js → org-install-CVKBAdf6.js} +1 -1
- package/dist/client/assets/{org-layout-Ip0hYM6i.js → org-layout-Dv1Blc3Y.js} +1 -1
- package/dist/client/assets/{organization-choice-Ccir5zvX.js → organization-choice-B6BWp_1y.js} +1 -1
- package/dist/client/assets/{orgs-BK0nOPLw.js → orgs-Cy8dbVQf.js} +1 -1
- package/dist/client/assets/{page-seo-form-CBAWdwBB.js → page-seo-form-CBHtkQ-1.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BEV8Rj_2.js +1 -0
- package/dist/client/assets/{popover-WvXSsr2A.js → popover-Bk7l46es.js} +1 -1
- package/dist/client/assets/{post-editor-GEIG3Qbs.js → post-editor-BFFD4TxR.js} +1 -1
- package/dist/client/assets/{primitives-B4b9OMlU.js → primitives-BUqBmg2w.js} +1 -1
- package/dist/client/assets/{profile-BJOXihUj.js → profile-_UM8G-04.js} +1 -1
- package/dist/client/assets/project-app-view-d8NlTW9s.js +1 -0
- package/dist/client/assets/record-editor-D87inyPk.js +1 -0
- package/dist/client/assets/redirect-editor-B5p1mIS_.js +1 -0
- package/dist/client/assets/registry-Cgy8gH4Y.js +2 -0
- package/dist/client/assets/{registry-layout-CUSBCALf.js → registry-layout-DZTQ7Enm.js} +2 -2
- package/dist/client/assets/{reports-CJYmnCRR.js → reports-CogLmgwx.js} +2 -2
- package/dist/client/assets/{require-capability-BOqOfzCO.js → require-capability-DAXk0d5y.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C1iQaX9e.js → required-auth-layout-DVJ0P1R1.js} +1 -1
- package/dist/client/assets/{reset-password-ChmXlYVK.js → reset-password-Ba_pBAvO.js} +1 -1
- package/dist/client/assets/{roles-CuzTIzcA.js → roles-CXTr00hX.js} +1 -1
- package/dist/client/assets/{search-input-Di_KVfz5.js → search-input-C-UMJodP.js} +1 -1
- package/dist/client/assets/{secrets-Cwnb5SFR.js → secrets-D88X3IUQ.js} +1 -1
- package/dist/client/assets/{sections-editor-BnUP7eos.js → sections-editor-BFKZY_dP.js} +1 -1
- package/dist/client/assets/{select-CS3vGjLf.js → select-C-jyJoDt.js} +1 -1
- package/dist/client/assets/{select-model-CBkA3Qex.js → select-model-Dgd4xGjo.js} +1 -1
- package/dist/client/assets/{self-tool-result-olaCzjy8.js → self-tool-result-DPMrglQq.js} +1 -1
- package/dist/client/assets/{seo-editor-BS3PrYY5.js → seo-editor-BY6DSXGz.js} +1 -1
- package/dist/client/assets/{settings-layout-BWiwB1ve.js → settings-layout-CkDQpCLh.js} +1 -1
- package/dist/client/assets/{settings-section-B42r-p4q.js → settings-section-6MwJAdqF.js} +1 -1
- package/dist/client/assets/{shell-controls-CG47bgem.js → shell-controls-CnX0OdDH.js} +1 -1
- package/dist/client/assets/{shell-layout-C2jFubEc.js → shell-layout-CN7hhO1J.js} +1 -1
- package/dist/client/assets/{sidebar-DhNO0hbl.js → sidebar-C_iv7Nh9.js} +1 -1
- package/dist/client/assets/{skeleton-CkFFLL1Z.js → skeleton-DbS6ExIt.js} +1 -1
- package/dist/client/assets/{sso-DvIYBwsX.js → sso-B8CdFzAl.js} +1 -1
- package/dist/client/assets/{store-D2kZokQ2.js → store-Bnyy1WiV.js} +1 -1
- package/dist/client/assets/store-registry-BSo6cvku.js +2 -0
- package/dist/client/assets/{studio-tools-Dj_suUV-.js → studio-tools-IiJMHnzv.js} +1 -1
- package/dist/client/assets/{switch-CWGgmiWZ.js → switch-yqZ24tl_.js} +1 -1
- package/dist/client/assets/{table-B7Z84RDB.js → table-CmSWRFMQ.js} +1 -1
- package/dist/client/assets/{tabs-CSjEyx_g.js → tabs-7R3MGlLI.js} +1 -1
- package/dist/client/assets/{textarea-DNrJISFS.js → textarea-BE6VI2Sm.js} +1 -1
- package/dist/client/assets/{toggle-group-DngQXFC1.js → toggle-group-lTjODskL.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BPZ8JgHL.js → toolbar-icon-button-DysigV8P.js} +1 -1
- package/dist/client/assets/{toolbar-BJAhXpws.js → toolbar-mS39lMFz.js} +1 -1
- package/dist/client/assets/{tooltip-BoYfeb4r.js → tooltip-CQ993dHl.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B0uEL6GU.js → use-ai-providers-CcQLY3nb.js} +1 -1
- package/dist/client/assets/{use-api-keys-BUXdsmWE.js → use-api-keys-DJYutKrk.js} +1 -1
- package/dist/client/assets/{use-automations-BX-f2xPQ.js → use-automations-Dhj1E9Ph.js} +1 -1
- package/dist/client/assets/{use-autosave-D2xExJSi.js → use-autosave-C2xapmR1.js} +1 -1
- package/dist/client/assets/{use-capability-zn_dFQCr.js → use-capability-DyYemPOJ.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Daz3W4ZL.js → use-clock-tick-Cy_Qdrwk.js} +1 -1
- package/dist/client/assets/{use-connection-CI4KVjBL.js → use-connection-DgItAPXg.js} +1 -1
- package/dist/client/assets/{use-copy-BFe-yhR7.js → use-copy-Cl4f2mnT.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BruuOj8R.js → use-create-virtual-mcp-Cr2zciLP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C18-WjK7.js → use-debounced-autosave-DacEdb47.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CgLjUKeF.js → use-debounced-value-COWnhTlx.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cl6XjjTb.js → use-deco-credits-C258e8Gu.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Opg95yOG.js → use-decopilot-events-C8Qld7KH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CkYrHV-n.js → use-delete-connection-D8xzfXPS.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CWMJlws-.js → use-deployment-admin-CUVPi201.js} +1 -1
- package/dist/client/assets/{use-file-configs-CU2Y0Emb.js → use-file-configs-BS9XBoPf.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-mXDq9sbk.js → use-infinite-scroll-CHbZVRlR.js} +1 -1
- package/dist/client/assets/{use-join-requests-zFCwv89L.js → use-join-requests-BnVp32Ft.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BoHM8OB0.js → use-mcp-auth-status-C_bc7znM.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DL89siIV.js → use-mcp-client-rUzkHeFC.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C4CClJFZ.js → use-mcp-tools-wZzusmBD.js} +1 -1
- package/dist/client/assets/{use-members-A3agoGMA.js → use-members-Bs4G8Gn6.js} +1 -1
- package/dist/client/assets/{use-mobile-BwfgD4pT.js → use-mobile-Dfk9gz4P.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bc0CpSD2.js → use-navigate-to-agent-D_ROb12r.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BTfVRkCO.js → use-org-auth-client-C2bpFjJB.js} +1 -1
- package/dist/client/assets/{use-org-sso-DYo24v3_.js → use-org-sso-o6qtDNhz.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DYKLAq-n.js → use-organization-roles-CIhMiXnm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DoCpZun-.js → use-organization-settings-BN6Mbe3T.js} +1 -1
- package/dist/client/assets/{use-registry-app-nEihaLca.js → use-registry-app-CdXrR-uL.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DuneVuyO.js → use-registry-connections-DUTwru2C.js} +1 -1
- package/dist/client/assets/{use-secrets-CG9MzH4M.js → use-secrets-BGQjv51d.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C-LWwT7t.js → use-status-sounds-DNfyHXSY.js} +1 -1
- package/dist/client/assets/{use-view-mode--BSnFAw6.js → use-view-mode-3AUQk446.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C6uu6xME.js → use-virtual-mcp-EXgj09hR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BuJ4N0EZ.js +1 -0
- package/dist/client/assets/{useQueries-BT8q2MfJ.js → useQueries-BTxFVSBJ.js} +1 -1
- package/dist/client/assets/{useRouterState-BMgTcVFU.js → useRouterState-CSm1vh-t.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CnxU3y26.js +1 -0
- package/dist/client/assets/{users-BXaOYgw2.js → users-BUKZ3ENb.js} +1 -1
- package/dist/client/assets/{variant-calendar-C61DYxyp.js → variant-calendar-BkY_wbhM.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C8Ikqgl7.js → view-mode-toggle-cynxUaRv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/report-og-fallback.png +0 -0
- package/dist/server/cli.js +656 -656
- package/dist/server/migrate.js +5 -5
- package/dist/server/node_modules/@resvg/resvg-js/LICENSE +373 -0
- package/dist/server/node_modules/@resvg/resvg-js/README.md +314 -0
- package/dist/server/node_modules/@resvg/resvg-js/index.js +23 -0
- package/dist/server/node_modules/@resvg/resvg-js/js-binding.js +1 -0
- package/dist/server/node_modules/@resvg/resvg-js/package.json +152 -0
- package/dist/server/node_modules/@shuding/opentype.js/LICENSE +20 -0
- package/dist/server/node_modules/@shuding/opentype.js/README.md +9 -0
- package/dist/server/node_modules/@shuding/opentype.js/RELEASES.md +272 -0
- package/dist/server/node_modules/@shuding/opentype.js/bin/ot +84 -0
- package/dist/server/node_modules/@shuding/opentype.js/bin/server.js +64 -0
- package/dist/server/node_modules/@shuding/opentype.js/bin/test-render +96 -0
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.js +11655 -0
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.min.js +2 -0
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.module.js +11639 -0
- package/dist/server/node_modules/@shuding/opentype.js/package.json +73 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/bbox.js +158 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/bidi.js +243 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/char.js +43 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/check.js +16 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/encoding.js +1032 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/applySubstitution.js +74 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicPresentationForms.js +83 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicRequiredLigatures.js +41 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicSentence.js +43 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicWord.js +31 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/featureQuery.js +483 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/contextCheck/latinWord.js +31 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/latinLigatures.js +40 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/font.js +433 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/glyph.js +274 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/glyphset.js +150 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/hintingtt.js +3062 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/index.js +5 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/layout.js +357 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/opentype.js +375 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/parse.js +628 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/path.js +212 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/position.js +77 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/substitution.js +447 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/table.js +215 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/cff.js +1156 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/cmap.js +145 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/fvar.js +71 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gdef.js +62 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/glyf.js +349 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gpos.js +146 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gsub.js +251 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/head.js +35 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/hhea.js +27 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/hmtx.js +51 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/kern.js +69 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/loca.js +31 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/ltag.js +33 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/maxp.js +32 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/meta.js +30 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/name.js +680 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/os2.js +65 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/post.js +41 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/tokenizer.js +522 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/types.js +976 -0
- package/dist/server/node_modules/@shuding/opentype.js/src/util.js +17 -0
- package/dist/server/node_modules/base64-js/.travis.yml +5 -0
- package/dist/server/node_modules/base64-js/LICENSE.MIT +21 -0
- package/dist/server/node_modules/base64-js/README.md +31 -0
- package/dist/server/node_modules/base64-js/bench/bench.js +19 -0
- package/dist/server/node_modules/base64-js/lib/b64.js +124 -0
- package/dist/server/node_modules/base64-js/package.json +34 -0
- package/dist/server/node_modules/base64-js/test/convert.js +51 -0
- package/dist/server/node_modules/base64-js/test/url-safe.js +18 -0
- package/dist/server/node_modules/camelize/.eslintrc +24 -0
- package/dist/server/node_modules/camelize/.github/FUNDING.yml +12 -0
- package/dist/server/node_modules/camelize/CHANGELOG.md +64 -0
- package/dist/server/node_modules/camelize/LICENSE +18 -0
- package/dist/server/node_modules/camelize/README.md +81 -0
- package/dist/server/node_modules/camelize/example/camel.js +12 -0
- package/dist/server/node_modules/camelize/index.js +61 -0
- package/dist/server/node_modules/camelize/package.json +84 -0
- package/dist/server/node_modules/camelize/test/camel.js +48 -0
- package/dist/server/node_modules/color-name/LICENSE +8 -0
- package/dist/server/node_modules/color-name/README.md +11 -0
- package/dist/server/node_modules/color-name/index.js +152 -0
- package/dist/server/node_modules/color-name/package.json +28 -0
- package/dist/server/node_modules/css-background-parser/LICENSE +22 -0
- package/dist/server/node_modules/css-background-parser/README.md +149 -0
- package/dist/server/node_modules/css-background-parser/index.js +162 -0
- package/dist/server/node_modules/css-background-parser/package.json +19 -0
- package/dist/server/node_modules/css-box-shadow/README.md +27 -0
- package/dist/server/node_modules/css-box-shadow/index.js +64 -0
- package/dist/server/node_modules/css-box-shadow/package.json +14 -0
- package/dist/server/node_modules/css-box-shadow/test.js +204 -0
- package/dist/server/node_modules/css-color-keywords/LICENSE +15 -0
- package/dist/server/node_modules/css-color-keywords/README.md +47 -0
- package/dist/server/node_modules/css-color-keywords/colors.json +148 -0
- package/dist/server/node_modules/css-color-keywords/index.js +3 -0
- package/dist/server/node_modules/css-color-keywords/package.json +27 -0
- package/dist/server/node_modules/css-gradient-parser/LICENSE +21 -0
- package/dist/server/node_modules/css-gradient-parser/README.md +75 -0
- package/dist/server/node_modules/css-gradient-parser/dist/index.cjs +2 -0
- package/dist/server/node_modules/css-gradient-parser/dist/index.js +2 -0
- package/dist/server/node_modules/css-gradient-parser/package.json +54 -0
- package/dist/server/node_modules/css-to-react-native/LICENSE.md +21 -0
- package/dist/server/node_modules/css-to-react-native/README.md +115 -0
- package/dist/server/node_modules/css-to-react-native/index.js +886 -0
- package/dist/server/node_modules/css-to-react-native/package.json +65 -0
- package/dist/server/node_modules/css-to-react-native/src/TokenStream.js +74 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/border.js +85 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/borderColor.js +37 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/boxModel.js +136 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/boxShadow.js +83 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/colors.js +31 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/flex.js +122 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/flexFlow.js +22 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/font.js +117 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontFamily.js +43 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontVariant.js +15 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontWeight.js +8 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/index.js +204 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/placeContent.js +19 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/shadowOffsets.js +13 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecoration.js +103 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecorationLine.js +23 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textShadow.js +30 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/transform.js +55 -0
- package/dist/server/node_modules/css-to-react-native/src/__tests__/units.js +132 -0
- package/dist/server/node_modules/css-to-react-native/src/devPropertiesWithoutUnitsRegExp.js +19 -0
- package/dist/server/node_modules/css-to-react-native/src/index.js +90 -0
- package/dist/server/node_modules/css-to-react-native/src/tokenTypes.js +75 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/border.js +53 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/boxShadow.js +11 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/flex.js +65 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/flexFlow.js +37 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/font.js +63 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/fontFamily.js +20 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/fontVariant.js +14 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/index.js +77 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/placeContent.js +24 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/textDecoration.js +53 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/textDecorationLine.js +18 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/textShadow.js +10 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/transform.js +74 -0
- package/dist/server/node_modules/css-to-react-native/src/transforms/util.js +99 -0
- package/dist/server/node_modules/hex-rgb/index.js +47 -0
- package/dist/server/node_modules/hex-rgb/license +9 -0
- package/dist/server/node_modules/hex-rgb/package.json +39 -0
- package/dist/server/node_modules/hex-rgb/readme.md +86 -0
- package/dist/server/node_modules/linebreak/LICENSE +21 -0
- package/dist/server/node_modules/linebreak/dist/main.cjs +1369 -0
- package/dist/server/node_modules/linebreak/dist/module.mjs +1368 -0
- package/dist/server/node_modules/linebreak/package.json +57 -0
- package/dist/server/node_modules/linebreak/readme.md +62 -0
- package/dist/server/node_modules/parse-css-color/CHANGELOG.md +54 -0
- package/dist/server/node_modules/parse-css-color/LICENSE +21 -0
- package/dist/server/node_modules/parse-css-color/README.md +110 -0
- package/dist/server/node_modules/parse-css-color/dist/index.cjs.js +171 -0
- package/dist/server/node_modules/parse-css-color/dist/index.esm.js +167 -0
- package/dist/server/node_modules/parse-css-color/dist/index.umd.js +7 -0
- package/dist/server/node_modules/parse-css-color/package.json +55 -0
- package/dist/server/node_modules/postcss-value-parser/LICENSE +22 -0
- package/dist/server/node_modules/postcss-value-parser/README.md +263 -0
- package/dist/server/node_modules/postcss-value-parser/lib/index.js +28 -0
- package/dist/server/node_modules/postcss-value-parser/lib/parse.js +321 -0
- package/dist/server/node_modules/postcss-value-parser/lib/stringify.js +48 -0
- package/dist/server/node_modules/postcss-value-parser/lib/unit.js +120 -0
- package/dist/server/node_modules/postcss-value-parser/lib/walk.js +22 -0
- package/dist/server/node_modules/postcss-value-parser/package.json +58 -0
- package/dist/server/node_modules/satori/LICENSE +373 -0
- package/dist/server/node_modules/satori/README.md +516 -0
- package/dist/server/node_modules/satori/dist/index.cjs +8 -0
- package/dist/server/node_modules/satori/dist/index.cjs.LEGAL.txt +4 -0
- package/dist/server/node_modules/satori/dist/index.js +8 -0
- package/dist/server/node_modules/satori/dist/index.js.LEGAL.txt +4 -0
- package/dist/server/node_modules/satori/dist/jsx/index.cjs +2 -0
- package/dist/server/node_modules/satori/dist/jsx/index.cjs.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/jsx/index.js +2 -0
- package/dist/server/node_modules/satori/dist/jsx/index.js.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.cjs +2 -0
- package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.cjs.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.js +2 -0
- package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.js.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/standalone.cjs +8 -0
- package/dist/server/node_modules/satori/dist/standalone.cjs.LEGAL.txt +4 -0
- package/dist/server/node_modules/satori/dist/standalone.js +8 -0
- package/dist/server/node_modules/satori/dist/standalone.js.LEGAL.txt +4 -0
- package/dist/server/node_modules/satori/package.json +149 -0
- package/dist/server/node_modules/satori/yoga.wasm +0 -0
- package/dist/server/node_modules/tiny-inflate/LICENSE +21 -0
- package/dist/server/node_modules/tiny-inflate/index.js +375 -0
- package/dist/server/node_modules/tiny-inflate/package.json +28 -0
- package/dist/server/node_modules/tiny-inflate/readme.md +31 -0
- package/dist/server/node_modules/tiny-inflate/test/index.js +75 -0
- package/dist/server/node_modules/tiny-inflate/test/lorem.txt +199 -0
- package/dist/server/node_modules/unicode-trie/LICENSE +8 -0
- package/dist/server/node_modules/unicode-trie/README.md +77 -0
- package/dist/server/node_modules/unicode-trie/builder.js +966 -0
- package/dist/server/node_modules/unicode-trie/index.js +136 -0
- package/dist/server/node_modules/unicode-trie/package.json +27 -0
- package/dist/server/node_modules/unicode-trie/swap.js +25 -0
- package/dist/server/node_modules/unicode-trie/test/mocha.opts +1 -0
- package/dist/server/node_modules/unicode-trie/test/test.js +243 -0
- package/dist/server/server.js +640 -640
- package/package.json +3 -1
- package/dist/client/assets/page-seo-sheet-BVOTKmAi.js +0 -1
- package/dist/client/assets/project-app-view-BJPw6BEN.js +0 -1
- package/dist/client/assets/record-editor-DGNLZeof.js +0 -1
- package/dist/client/assets/redirect-editor-rNADegcF.js +0 -1
- package/dist/client/assets/registry-DSHcnwR4.js +0 -2
- package/dist/client/assets/store-registry-q7deglpz.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DVl8ILZo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ClimnWE2.js +0 -1
|
@@ -0,0 +1,1156 @@
|
|
|
1
|
+
// The `CFF` table contains the glyph outlines in PostScript format.
|
|
2
|
+
// https://www.microsoft.com/typography/OTSPEC/cff.htm
|
|
3
|
+
// http://download.microsoft.com/download/8/0/1/801a191c-029d-4af3-9642-555f6fe514ee/cff.pdf
|
|
4
|
+
// http://download.microsoft.com/download/8/0/1/801a191c-029d-4af3-9642-555f6fe514ee/type2.pdf
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
CffEncoding,
|
|
8
|
+
cffStandardEncoding,
|
|
9
|
+
cffExpertEncoding,
|
|
10
|
+
cffStandardStrings,
|
|
11
|
+
} from '../encoding';
|
|
12
|
+
import glyphset from '../glyphset';
|
|
13
|
+
import parse from '../parse';
|
|
14
|
+
import Path from '../path';
|
|
15
|
+
|
|
16
|
+
// Subroutines are encoded using the negative half of the number space.
|
|
17
|
+
// See type 2 chapter 4.7 "Subroutine operators".
|
|
18
|
+
function calcCFFSubroutineBias(subrs) {
|
|
19
|
+
let bias;
|
|
20
|
+
if (subrs.length < 1240) {
|
|
21
|
+
bias = 107;
|
|
22
|
+
} else if (subrs.length < 33900) {
|
|
23
|
+
bias = 1131;
|
|
24
|
+
} else {
|
|
25
|
+
bias = 32768;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return bias;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Parse a `CFF` INDEX array.
|
|
32
|
+
// An index array consists of a list of offsets, then a list of objects at those offsets.
|
|
33
|
+
function parseCFFIndex(data, start, conversionFn) {
|
|
34
|
+
const offsets = [];
|
|
35
|
+
const objects = [];
|
|
36
|
+
const count = parse.getCard16(data, start);
|
|
37
|
+
let objectOffset;
|
|
38
|
+
let endOffset;
|
|
39
|
+
if (count !== 0) {
|
|
40
|
+
const offsetSize = parse.getByte(data, start + 2);
|
|
41
|
+
objectOffset = start + (count + 1) * offsetSize + 2;
|
|
42
|
+
let pos = start + 3;
|
|
43
|
+
for (let i = 0; i < count + 1; i += 1) {
|
|
44
|
+
offsets.push(parse.getOffset(data, pos, offsetSize));
|
|
45
|
+
pos += offsetSize;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The total size of the index array is 4 header bytes + the value of the last offset.
|
|
49
|
+
endOffset = objectOffset + offsets[count];
|
|
50
|
+
} else {
|
|
51
|
+
endOffset = start + 2;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for (let i = 0; i < offsets.length - 1; i += 1) {
|
|
55
|
+
let value = parse.getBytes(
|
|
56
|
+
data,
|
|
57
|
+
objectOffset + offsets[i],
|
|
58
|
+
objectOffset + offsets[i + 1]
|
|
59
|
+
);
|
|
60
|
+
if (conversionFn) {
|
|
61
|
+
value = conversionFn(value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
objects.push(value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return { objects: objects, startOffset: start, endOffset: endOffset };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function parseCFFIndexLowMemory(data, start) {
|
|
71
|
+
const offsets = [];
|
|
72
|
+
const count = parse.getCard16(data, start);
|
|
73
|
+
let objectOffset;
|
|
74
|
+
let endOffset;
|
|
75
|
+
if (count !== 0) {
|
|
76
|
+
const offsetSize = parse.getByte(data, start + 2);
|
|
77
|
+
objectOffset = start + (count + 1) * offsetSize + 2;
|
|
78
|
+
let pos = start + 3;
|
|
79
|
+
for (let i = 0; i < count + 1; i += 1) {
|
|
80
|
+
offsets.push(parse.getOffset(data, pos, offsetSize));
|
|
81
|
+
pos += offsetSize;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// The total size of the index array is 4 header bytes + the value of the last offset.
|
|
85
|
+
endOffset = objectOffset + offsets[count];
|
|
86
|
+
} else {
|
|
87
|
+
endOffset = start + 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return { offsets: offsets, startOffset: start, endOffset: endOffset };
|
|
91
|
+
}
|
|
92
|
+
function getCffIndexObject(i, offsets, data, start, conversionFn) {
|
|
93
|
+
const count = parse.getCard16(data, start);
|
|
94
|
+
let objectOffset = 0;
|
|
95
|
+
if (count !== 0) {
|
|
96
|
+
const offsetSize = parse.getByte(data, start + 2);
|
|
97
|
+
objectOffset = start + (count + 1) * offsetSize + 2;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let value = parse.getBytes(
|
|
101
|
+
data,
|
|
102
|
+
objectOffset + offsets[i],
|
|
103
|
+
objectOffset + offsets[i + 1]
|
|
104
|
+
);
|
|
105
|
+
if (conversionFn) {
|
|
106
|
+
value = conversionFn(value);
|
|
107
|
+
}
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Parse a `CFF` DICT real value.
|
|
112
|
+
function parseFloatOperand(parser) {
|
|
113
|
+
let s = '';
|
|
114
|
+
const eof = 15;
|
|
115
|
+
const lookup = [
|
|
116
|
+
'0',
|
|
117
|
+
'1',
|
|
118
|
+
'2',
|
|
119
|
+
'3',
|
|
120
|
+
'4',
|
|
121
|
+
'5',
|
|
122
|
+
'6',
|
|
123
|
+
'7',
|
|
124
|
+
'8',
|
|
125
|
+
'9',
|
|
126
|
+
'.',
|
|
127
|
+
'E',
|
|
128
|
+
'E-',
|
|
129
|
+
null,
|
|
130
|
+
'-',
|
|
131
|
+
];
|
|
132
|
+
while (true) {
|
|
133
|
+
const b = parser.parseByte();
|
|
134
|
+
const n1 = b >> 4;
|
|
135
|
+
const n2 = b & 15;
|
|
136
|
+
|
|
137
|
+
if (n1 === eof) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
s += lookup[n1];
|
|
142
|
+
|
|
143
|
+
if (n2 === eof) {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
s += lookup[n2];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return parseFloat(s);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Parse a `CFF` DICT operand.
|
|
154
|
+
function parseOperand(parser, b0) {
|
|
155
|
+
let b1;
|
|
156
|
+
let b2;
|
|
157
|
+
let b3;
|
|
158
|
+
let b4;
|
|
159
|
+
if (b0 === 28) {
|
|
160
|
+
b1 = parser.parseByte();
|
|
161
|
+
b2 = parser.parseByte();
|
|
162
|
+
return (b1 << 8) | b2;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (b0 === 29) {
|
|
166
|
+
b1 = parser.parseByte();
|
|
167
|
+
b2 = parser.parseByte();
|
|
168
|
+
b3 = parser.parseByte();
|
|
169
|
+
b4 = parser.parseByte();
|
|
170
|
+
return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (b0 === 30) {
|
|
174
|
+
return parseFloatOperand(parser);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (b0 >= 32 && b0 <= 246) {
|
|
178
|
+
return b0 - 139;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (b0 >= 247 && b0 <= 250) {
|
|
182
|
+
b1 = parser.parseByte();
|
|
183
|
+
return (b0 - 247) * 256 + b1 + 108;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (b0 >= 251 && b0 <= 254) {
|
|
187
|
+
b1 = parser.parseByte();
|
|
188
|
+
return -(b0 - 251) * 256 - b1 - 108;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
throw new Error('Invalid b0 ' + b0);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Convert the entries returned by `parseDict` to a proper dictionary.
|
|
195
|
+
// If a value is a list of one, it is unpacked.
|
|
196
|
+
function entriesToObject(entries) {
|
|
197
|
+
const o = {};
|
|
198
|
+
for (let i = 0; i < entries.length; i += 1) {
|
|
199
|
+
const key = entries[i][0];
|
|
200
|
+
const values = entries[i][1];
|
|
201
|
+
let value;
|
|
202
|
+
if (values.length === 1) {
|
|
203
|
+
value = values[0];
|
|
204
|
+
} else {
|
|
205
|
+
value = values;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (o.hasOwnProperty(key) && !isNaN(o[key])) {
|
|
209
|
+
throw new Error('Object ' + o + ' already has key ' + key);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
o[key] = value;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return o;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Parse a `CFF` DICT object.
|
|
219
|
+
// A dictionary contains key-value pairs in a compact tokenized format.
|
|
220
|
+
function parseCFFDict(data, start, size) {
|
|
221
|
+
start = start !== undefined ? start : 0;
|
|
222
|
+
const parser = new parse.Parser(data, start);
|
|
223
|
+
const entries = [];
|
|
224
|
+
let operands = [];
|
|
225
|
+
size = size !== undefined ? size : data.length;
|
|
226
|
+
|
|
227
|
+
while (parser.relativeOffset < size) {
|
|
228
|
+
let op = parser.parseByte();
|
|
229
|
+
|
|
230
|
+
// The first byte for each dict item distinguishes between operator (key) and operand (value).
|
|
231
|
+
// Values <= 21 are operators.
|
|
232
|
+
if (op <= 21) {
|
|
233
|
+
// Two-byte operators have an initial escape byte of 12.
|
|
234
|
+
if (op === 12) {
|
|
235
|
+
op = 1200 + parser.parseByte();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
entries.push([op, operands]);
|
|
239
|
+
operands = [];
|
|
240
|
+
} else {
|
|
241
|
+
// Since the operands (values) come before the operators (keys), we store all operands in a list
|
|
242
|
+
// until we encounter an operator.
|
|
243
|
+
operands.push(parseOperand(parser, op));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return entriesToObject(entries);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Given a String Index (SID), return the value of the string.
|
|
251
|
+
// Strings below index 392 are standard CFF strings and are not encoded in the font.
|
|
252
|
+
function getCFFString(strings, index) {
|
|
253
|
+
if (index <= 390) {
|
|
254
|
+
index = cffStandardStrings[index];
|
|
255
|
+
} else {
|
|
256
|
+
index = strings[index - 391];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return index;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Interpret a dictionary and return a new dictionary with readable keys and values for missing entries.
|
|
263
|
+
// This function takes `meta` which is a list of objects containing `operand`, `name` and `default`.
|
|
264
|
+
function interpretDict(dict, meta, strings) {
|
|
265
|
+
const newDict = {};
|
|
266
|
+
let value;
|
|
267
|
+
|
|
268
|
+
// Because we also want to include missing values, we start out from the meta list
|
|
269
|
+
// and lookup values in the dict.
|
|
270
|
+
for (let i = 0; i < meta.length; i += 1) {
|
|
271
|
+
const m = meta[i];
|
|
272
|
+
|
|
273
|
+
if (Array.isArray(m.type)) {
|
|
274
|
+
const values = [];
|
|
275
|
+
values.length = m.type.length;
|
|
276
|
+
for (let j = 0; j < m.type.length; j++) {
|
|
277
|
+
value = dict[m.op] !== undefined ? dict[m.op][j] : undefined;
|
|
278
|
+
if (value === undefined) {
|
|
279
|
+
value =
|
|
280
|
+
m.value !== undefined && m.value[j] !== undefined
|
|
281
|
+
? m.value[j]
|
|
282
|
+
: null;
|
|
283
|
+
}
|
|
284
|
+
if (m.type[j] === 'SID') {
|
|
285
|
+
value = getCFFString(strings, value);
|
|
286
|
+
}
|
|
287
|
+
values[j] = value;
|
|
288
|
+
}
|
|
289
|
+
newDict[m.name] = values;
|
|
290
|
+
} else {
|
|
291
|
+
value = dict[m.op];
|
|
292
|
+
if (value === undefined) {
|
|
293
|
+
value = m.value !== undefined ? m.value : null;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (m.type === 'SID') {
|
|
297
|
+
value = getCFFString(strings, value);
|
|
298
|
+
}
|
|
299
|
+
newDict[m.name] = value;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return newDict;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Parse the CFF header.
|
|
307
|
+
function parseCFFHeader(data, start) {
|
|
308
|
+
const header = {};
|
|
309
|
+
header.formatMajor = parse.getCard8(data, start);
|
|
310
|
+
header.formatMinor = parse.getCard8(data, start + 1);
|
|
311
|
+
header.size = parse.getCard8(data, start + 2);
|
|
312
|
+
header.offsetSize = parse.getCard8(data, start + 3);
|
|
313
|
+
header.startOffset = start;
|
|
314
|
+
header.endOffset = start + 4;
|
|
315
|
+
return header;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const TOP_DICT_META = [
|
|
319
|
+
{ name: 'version', op: 0, type: 'SID' },
|
|
320
|
+
{ name: 'notice', op: 1, type: 'SID' },
|
|
321
|
+
{ name: 'copyright', op: 1200, type: 'SID' },
|
|
322
|
+
{ name: 'fullName', op: 2, type: 'SID' },
|
|
323
|
+
{ name: 'familyName', op: 3, type: 'SID' },
|
|
324
|
+
{ name: 'weight', op: 4, type: 'SID' },
|
|
325
|
+
{ name: 'isFixedPitch', op: 1201, type: 'number', value: 0 },
|
|
326
|
+
{ name: 'italicAngle', op: 1202, type: 'number', value: 0 },
|
|
327
|
+
{ name: 'underlinePosition', op: 1203, type: 'number', value: -100 },
|
|
328
|
+
{ name: 'underlineThickness', op: 1204, type: 'number', value: 50 },
|
|
329
|
+
{ name: 'paintType', op: 1205, type: 'number', value: 0 },
|
|
330
|
+
{ name: 'charstringType', op: 1206, type: 'number', value: 2 },
|
|
331
|
+
{
|
|
332
|
+
name: 'fontMatrix',
|
|
333
|
+
op: 1207,
|
|
334
|
+
type: ['real', 'real', 'real', 'real', 'real', 'real'],
|
|
335
|
+
value: [0.001, 0, 0, 0.001, 0, 0],
|
|
336
|
+
},
|
|
337
|
+
{ name: 'uniqueId', op: 13, type: 'number' },
|
|
338
|
+
{
|
|
339
|
+
name: 'fontBBox',
|
|
340
|
+
op: 5,
|
|
341
|
+
type: ['number', 'number', 'number', 'number'],
|
|
342
|
+
value: [0, 0, 0, 0],
|
|
343
|
+
},
|
|
344
|
+
{ name: 'strokeWidth', op: 1208, type: 'number', value: 0 },
|
|
345
|
+
{ name: 'xuid', op: 14, type: [], value: null },
|
|
346
|
+
{ name: 'charset', op: 15, type: 'offset', value: 0 },
|
|
347
|
+
{ name: 'encoding', op: 16, type: 'offset', value: 0 },
|
|
348
|
+
{ name: 'charStrings', op: 17, type: 'offset', value: 0 },
|
|
349
|
+
{ name: 'private', op: 18, type: ['number', 'offset'], value: [0, 0] },
|
|
350
|
+
{ name: 'ros', op: 1230, type: ['SID', 'SID', 'number'] },
|
|
351
|
+
{ name: 'cidFontVersion', op: 1231, type: 'number', value: 0 },
|
|
352
|
+
{ name: 'cidFontRevision', op: 1232, type: 'number', value: 0 },
|
|
353
|
+
{ name: 'cidFontType', op: 1233, type: 'number', value: 0 },
|
|
354
|
+
{ name: 'cidCount', op: 1234, type: 'number', value: 8720 },
|
|
355
|
+
{ name: 'uidBase', op: 1235, type: 'number' },
|
|
356
|
+
{ name: 'fdArray', op: 1236, type: 'offset' },
|
|
357
|
+
{ name: 'fdSelect', op: 1237, type: 'offset' },
|
|
358
|
+
{ name: 'fontName', op: 1238, type: 'SID' },
|
|
359
|
+
];
|
|
360
|
+
|
|
361
|
+
const PRIVATE_DICT_META = [
|
|
362
|
+
{ name: 'subrs', op: 19, type: 'offset', value: 0 },
|
|
363
|
+
{ name: 'defaultWidthX', op: 20, type: 'number', value: 0 },
|
|
364
|
+
{ name: 'nominalWidthX', op: 21, type: 'number', value: 0 },
|
|
365
|
+
];
|
|
366
|
+
|
|
367
|
+
// Parse the CFF top dictionary. A CFF table can contain multiple fonts, each with their own top dictionary.
|
|
368
|
+
// The top dictionary contains the essential metadata for the font, together with the private dictionary.
|
|
369
|
+
function parseCFFTopDict(data, strings) {
|
|
370
|
+
const dict = parseCFFDict(data, 0, data.byteLength);
|
|
371
|
+
return interpretDict(dict, TOP_DICT_META, strings);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Parse the CFF private dictionary. We don't fully parse out all the values, only the ones we need.
|
|
375
|
+
function parseCFFPrivateDict(data, start, size, strings) {
|
|
376
|
+
const dict = parseCFFDict(data, start, size);
|
|
377
|
+
return interpretDict(dict, PRIVATE_DICT_META, strings);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Returns a list of "Top DICT"s found using an INDEX list.
|
|
381
|
+
// Used to read both the usual high-level Top DICTs and also the FDArray
|
|
382
|
+
// discovered inside CID-keyed fonts. When a Top DICT has a reference to
|
|
383
|
+
// a Private DICT that is read and saved into the Top DICT.
|
|
384
|
+
//
|
|
385
|
+
// In addition to the expected/optional values as outlined in TOP_DICT_META
|
|
386
|
+
// the following values might be saved into the Top DICT.
|
|
387
|
+
//
|
|
388
|
+
// _subrs [] array of local CFF subroutines from Private DICT
|
|
389
|
+
// _subrsBias bias value computed from number of subroutines
|
|
390
|
+
// (see calcCFFSubroutineBias() and parseCFFCharstring())
|
|
391
|
+
// _defaultWidthX default widths for CFF characters
|
|
392
|
+
// _nominalWidthX bias added to width embedded within glyph description
|
|
393
|
+
//
|
|
394
|
+
// _privateDict saved copy of parsed Private DICT from Top DICT
|
|
395
|
+
function gatherCFFTopDicts(data, start, cffIndex, strings) {
|
|
396
|
+
const topDictArray = [];
|
|
397
|
+
for (let iTopDict = 0; iTopDict < cffIndex.length; iTopDict += 1) {
|
|
398
|
+
const topDictData = new DataView(
|
|
399
|
+
new Uint8Array(cffIndex[iTopDict]).buffer
|
|
400
|
+
);
|
|
401
|
+
const topDict = parseCFFTopDict(topDictData, strings);
|
|
402
|
+
topDict._subrs = [];
|
|
403
|
+
topDict._subrsBias = 0;
|
|
404
|
+
topDict._defaultWidthX = 0;
|
|
405
|
+
topDict._nominalWidthX = 0;
|
|
406
|
+
const privateSize = topDict.private[0];
|
|
407
|
+
const privateOffset = topDict.private[1];
|
|
408
|
+
if (privateSize !== 0 && privateOffset !== 0) {
|
|
409
|
+
const privateDict = parseCFFPrivateDict(
|
|
410
|
+
data,
|
|
411
|
+
privateOffset + start,
|
|
412
|
+
privateSize,
|
|
413
|
+
strings
|
|
414
|
+
);
|
|
415
|
+
topDict._defaultWidthX = privateDict.defaultWidthX;
|
|
416
|
+
topDict._nominalWidthX = privateDict.nominalWidthX;
|
|
417
|
+
if (privateDict.subrs !== 0) {
|
|
418
|
+
const subrOffset = privateOffset + privateDict.subrs;
|
|
419
|
+
const subrIndex = parseCFFIndex(data, subrOffset + start);
|
|
420
|
+
topDict._subrs = subrIndex.objects;
|
|
421
|
+
topDict._subrsBias = calcCFFSubroutineBias(topDict._subrs);
|
|
422
|
+
}
|
|
423
|
+
topDict._privateDict = privateDict;
|
|
424
|
+
}
|
|
425
|
+
topDictArray.push(topDict);
|
|
426
|
+
}
|
|
427
|
+
return topDictArray;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Parse the CFF charset table, which contains internal names for all the glyphs.
|
|
431
|
+
// This function will return a list of glyph names.
|
|
432
|
+
// See Adobe TN #5176 chapter 13, "Charsets".
|
|
433
|
+
function parseCFFCharset(data, start, nGlyphs, strings) {
|
|
434
|
+
let sid;
|
|
435
|
+
let count;
|
|
436
|
+
const parser = new parse.Parser(data, start);
|
|
437
|
+
|
|
438
|
+
// The .notdef glyph is not included, so subtract 1.
|
|
439
|
+
nGlyphs -= 1;
|
|
440
|
+
const charset = ['.notdef'];
|
|
441
|
+
|
|
442
|
+
const format = parser.parseCard8();
|
|
443
|
+
if (format === 0) {
|
|
444
|
+
for (let i = 0; i < nGlyphs; i += 1) {
|
|
445
|
+
sid = parser.parseSID();
|
|
446
|
+
charset.push(getCFFString(strings, sid));
|
|
447
|
+
}
|
|
448
|
+
} else if (format === 1) {
|
|
449
|
+
while (charset.length <= nGlyphs) {
|
|
450
|
+
sid = parser.parseSID();
|
|
451
|
+
count = parser.parseCard8();
|
|
452
|
+
for (let i = 0; i <= count; i += 1) {
|
|
453
|
+
charset.push(getCFFString(strings, sid));
|
|
454
|
+
sid += 1;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
} else if (format === 2) {
|
|
458
|
+
while (charset.length <= nGlyphs) {
|
|
459
|
+
sid = parser.parseSID();
|
|
460
|
+
count = parser.parseCard16();
|
|
461
|
+
for (let i = 0; i <= count; i += 1) {
|
|
462
|
+
charset.push(getCFFString(strings, sid));
|
|
463
|
+
sid += 1;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
} else {
|
|
467
|
+
throw new Error('Unknown charset format ' + format);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
return charset;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Parse the CFF encoding data. Only one encoding can be specified per font.
|
|
474
|
+
// See Adobe TN #5176 chapter 12, "Encodings".
|
|
475
|
+
function parseCFFEncoding(data, start, charset) {
|
|
476
|
+
let code;
|
|
477
|
+
const enc = {};
|
|
478
|
+
const parser = new parse.Parser(data, start);
|
|
479
|
+
const format = parser.parseCard8();
|
|
480
|
+
if (format === 0) {
|
|
481
|
+
const nCodes = parser.parseCard8();
|
|
482
|
+
for (let i = 0; i < nCodes; i += 1) {
|
|
483
|
+
code = parser.parseCard8();
|
|
484
|
+
enc[code] = i;
|
|
485
|
+
}
|
|
486
|
+
} else if (format === 1) {
|
|
487
|
+
const nRanges = parser.parseCard8();
|
|
488
|
+
code = 1;
|
|
489
|
+
for (let i = 0; i < nRanges; i += 1) {
|
|
490
|
+
const first = parser.parseCard8();
|
|
491
|
+
const nLeft = parser.parseCard8();
|
|
492
|
+
for (let j = first; j <= first + nLeft; j += 1) {
|
|
493
|
+
enc[j] = code;
|
|
494
|
+
code += 1;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
498
|
+
throw new Error('Unknown encoding format ' + format);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return new CffEncoding(enc, charset);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// Take in charstring code and return a Glyph object.
|
|
505
|
+
// The encoding is described in the Type 2 Charstring Format
|
|
506
|
+
// https://www.microsoft.com/typography/OTSPEC/charstr2.htm
|
|
507
|
+
function parseCFFCharstring(font, glyph, code) {
|
|
508
|
+
let c1x;
|
|
509
|
+
let c1y;
|
|
510
|
+
let c2x;
|
|
511
|
+
let c2y;
|
|
512
|
+
const p = new Path();
|
|
513
|
+
const stack = [];
|
|
514
|
+
let nStems = 0;
|
|
515
|
+
let haveWidth = false;
|
|
516
|
+
let open = false;
|
|
517
|
+
let x = 0;
|
|
518
|
+
let y = 0;
|
|
519
|
+
let subrs;
|
|
520
|
+
let subrsBias;
|
|
521
|
+
let defaultWidthX;
|
|
522
|
+
let nominalWidthX;
|
|
523
|
+
if (font.isCIDFont) {
|
|
524
|
+
const fdIndex = font.tables.cff.topDict._fdSelect[glyph.index];
|
|
525
|
+
const fdDict = font.tables.cff.topDict._fdArray[fdIndex];
|
|
526
|
+
subrs = fdDict._subrs;
|
|
527
|
+
subrsBias = fdDict._subrsBias;
|
|
528
|
+
defaultWidthX = fdDict._defaultWidthX;
|
|
529
|
+
nominalWidthX = fdDict._nominalWidthX;
|
|
530
|
+
} else {
|
|
531
|
+
subrs = font.tables.cff.topDict._subrs;
|
|
532
|
+
subrsBias = font.tables.cff.topDict._subrsBias;
|
|
533
|
+
defaultWidthX = font.tables.cff.topDict._defaultWidthX;
|
|
534
|
+
nominalWidthX = font.tables.cff.topDict._nominalWidthX;
|
|
535
|
+
}
|
|
536
|
+
let width = defaultWidthX;
|
|
537
|
+
|
|
538
|
+
function newContour(x, y) {
|
|
539
|
+
if (open) {
|
|
540
|
+
p.closePath();
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
p.moveTo(x, y);
|
|
544
|
+
open = true;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function parseStems() {
|
|
548
|
+
let hasWidthArg;
|
|
549
|
+
|
|
550
|
+
// The number of stem operators on the stack is always even.
|
|
551
|
+
// If the value is uneven, that means a width is specified.
|
|
552
|
+
hasWidthArg = stack.length % 2 !== 0;
|
|
553
|
+
if (hasWidthArg && !haveWidth) {
|
|
554
|
+
width = stack.shift() + nominalWidthX;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
nStems += stack.length >> 1;
|
|
558
|
+
stack.length = 0;
|
|
559
|
+
haveWidth = true;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function parse(code) {
|
|
563
|
+
let b1;
|
|
564
|
+
let b2;
|
|
565
|
+
let b3;
|
|
566
|
+
let b4;
|
|
567
|
+
let codeIndex;
|
|
568
|
+
let subrCode;
|
|
569
|
+
let jpx;
|
|
570
|
+
let jpy;
|
|
571
|
+
let c3x;
|
|
572
|
+
let c3y;
|
|
573
|
+
let c4x;
|
|
574
|
+
let c4y;
|
|
575
|
+
|
|
576
|
+
let i = 0;
|
|
577
|
+
while (i < code.length) {
|
|
578
|
+
let v = code[i];
|
|
579
|
+
i += 1;
|
|
580
|
+
switch (v) {
|
|
581
|
+
case 1: // hstem
|
|
582
|
+
parseStems();
|
|
583
|
+
break;
|
|
584
|
+
case 3: // vstem
|
|
585
|
+
parseStems();
|
|
586
|
+
break;
|
|
587
|
+
case 4: // vmoveto
|
|
588
|
+
if (stack.length > 1 && !haveWidth) {
|
|
589
|
+
width = stack.shift() + nominalWidthX;
|
|
590
|
+
haveWidth = true;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
y += stack.pop();
|
|
594
|
+
newContour(x, y);
|
|
595
|
+
break;
|
|
596
|
+
case 5: // rlineto
|
|
597
|
+
while (stack.length > 0) {
|
|
598
|
+
x += stack.shift();
|
|
599
|
+
y += stack.shift();
|
|
600
|
+
p.lineTo(x, y);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
break;
|
|
604
|
+
case 6: // hlineto
|
|
605
|
+
while (stack.length > 0) {
|
|
606
|
+
x += stack.shift();
|
|
607
|
+
p.lineTo(x, y);
|
|
608
|
+
if (stack.length === 0) {
|
|
609
|
+
break;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
y += stack.shift();
|
|
613
|
+
p.lineTo(x, y);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
break;
|
|
617
|
+
case 7: // vlineto
|
|
618
|
+
while (stack.length > 0) {
|
|
619
|
+
y += stack.shift();
|
|
620
|
+
p.lineTo(x, y);
|
|
621
|
+
if (stack.length === 0) {
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
x += stack.shift();
|
|
626
|
+
p.lineTo(x, y);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
break;
|
|
630
|
+
case 8: // rrcurveto
|
|
631
|
+
while (stack.length > 0) {
|
|
632
|
+
c1x = x + stack.shift();
|
|
633
|
+
c1y = y + stack.shift();
|
|
634
|
+
c2x = c1x + stack.shift();
|
|
635
|
+
c2y = c1y + stack.shift();
|
|
636
|
+
x = c2x + stack.shift();
|
|
637
|
+
y = c2y + stack.shift();
|
|
638
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
break;
|
|
642
|
+
case 10: // callsubr
|
|
643
|
+
codeIndex = stack.pop() + subrsBias;
|
|
644
|
+
subrCode = subrs[codeIndex];
|
|
645
|
+
if (subrCode) {
|
|
646
|
+
parse(subrCode);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
break;
|
|
650
|
+
case 11: // return
|
|
651
|
+
return;
|
|
652
|
+
case 12: // flex operators
|
|
653
|
+
v = code[i];
|
|
654
|
+
i += 1;
|
|
655
|
+
switch (v) {
|
|
656
|
+
case 35: // flex
|
|
657
|
+
// |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 dx6 dy6 fd flex (12 35) |-
|
|
658
|
+
c1x = x + stack.shift(); // dx1
|
|
659
|
+
c1y = y + stack.shift(); // dy1
|
|
660
|
+
c2x = c1x + stack.shift(); // dx2
|
|
661
|
+
c2y = c1y + stack.shift(); // dy2
|
|
662
|
+
jpx = c2x + stack.shift(); // dx3
|
|
663
|
+
jpy = c2y + stack.shift(); // dy3
|
|
664
|
+
c3x = jpx + stack.shift(); // dx4
|
|
665
|
+
c3y = jpy + stack.shift(); // dy4
|
|
666
|
+
c4x = c3x + stack.shift(); // dx5
|
|
667
|
+
c4y = c3y + stack.shift(); // dy5
|
|
668
|
+
x = c4x + stack.shift(); // dx6
|
|
669
|
+
y = c4y + stack.shift(); // dy6
|
|
670
|
+
stack.shift(); // flex depth
|
|
671
|
+
p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);
|
|
672
|
+
p.curveTo(c3x, c3y, c4x, c4y, x, y);
|
|
673
|
+
break;
|
|
674
|
+
case 34: // hflex
|
|
675
|
+
// |- dx1 dx2 dy2 dx3 dx4 dx5 dx6 hflex (12 34) |-
|
|
676
|
+
c1x = x + stack.shift(); // dx1
|
|
677
|
+
c1y = y; // dy1
|
|
678
|
+
c2x = c1x + stack.shift(); // dx2
|
|
679
|
+
c2y = c1y + stack.shift(); // dy2
|
|
680
|
+
jpx = c2x + stack.shift(); // dx3
|
|
681
|
+
jpy = c2y; // dy3
|
|
682
|
+
c3x = jpx + stack.shift(); // dx4
|
|
683
|
+
c3y = c2y; // dy4
|
|
684
|
+
c4x = c3x + stack.shift(); // dx5
|
|
685
|
+
c4y = y; // dy5
|
|
686
|
+
x = c4x + stack.shift(); // dx6
|
|
687
|
+
p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);
|
|
688
|
+
p.curveTo(c3x, c3y, c4x, c4y, x, y);
|
|
689
|
+
break;
|
|
690
|
+
case 36: // hflex1
|
|
691
|
+
// |- dx1 dy1 dx2 dy2 dx3 dx4 dx5 dy5 dx6 hflex1 (12 36) |-
|
|
692
|
+
c1x = x + stack.shift(); // dx1
|
|
693
|
+
c1y = y + stack.shift(); // dy1
|
|
694
|
+
c2x = c1x + stack.shift(); // dx2
|
|
695
|
+
c2y = c1y + stack.shift(); // dy2
|
|
696
|
+
jpx = c2x + stack.shift(); // dx3
|
|
697
|
+
jpy = c2y; // dy3
|
|
698
|
+
c3x = jpx + stack.shift(); // dx4
|
|
699
|
+
c3y = c2y; // dy4
|
|
700
|
+
c4x = c3x + stack.shift(); // dx5
|
|
701
|
+
c4y = c3y + stack.shift(); // dy5
|
|
702
|
+
x = c4x + stack.shift(); // dx6
|
|
703
|
+
p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);
|
|
704
|
+
p.curveTo(c3x, c3y, c4x, c4y, x, y);
|
|
705
|
+
break;
|
|
706
|
+
case 37: // flex1
|
|
707
|
+
// |- dx1 dy1 dx2 dy2 dx3 dy3 dx4 dy4 dx5 dy5 d6 flex1 (12 37) |-
|
|
708
|
+
c1x = x + stack.shift(); // dx1
|
|
709
|
+
c1y = y + stack.shift(); // dy1
|
|
710
|
+
c2x = c1x + stack.shift(); // dx2
|
|
711
|
+
c2y = c1y + stack.shift(); // dy2
|
|
712
|
+
jpx = c2x + stack.shift(); // dx3
|
|
713
|
+
jpy = c2y + stack.shift(); // dy3
|
|
714
|
+
c3x = jpx + stack.shift(); // dx4
|
|
715
|
+
c3y = jpy + stack.shift(); // dy4
|
|
716
|
+
c4x = c3x + stack.shift(); // dx5
|
|
717
|
+
c4y = c3y + stack.shift(); // dy5
|
|
718
|
+
if (Math.abs(c4x - x) > Math.abs(c4y - y)) {
|
|
719
|
+
x = c4x + stack.shift();
|
|
720
|
+
} else {
|
|
721
|
+
y = c4y + stack.shift();
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
p.curveTo(c1x, c1y, c2x, c2y, jpx, jpy);
|
|
725
|
+
p.curveTo(c3x, c3y, c4x, c4y, x, y);
|
|
726
|
+
break;
|
|
727
|
+
default:
|
|
728
|
+
console.log(
|
|
729
|
+
'Glyph ' +
|
|
730
|
+
glyph.index +
|
|
731
|
+
': unknown operator ' +
|
|
732
|
+
1200 +
|
|
733
|
+
v
|
|
734
|
+
);
|
|
735
|
+
stack.length = 0;
|
|
736
|
+
}
|
|
737
|
+
break;
|
|
738
|
+
case 14: // endchar
|
|
739
|
+
if (stack.length > 0 && !haveWidth) {
|
|
740
|
+
width = stack.shift() + nominalWidthX;
|
|
741
|
+
haveWidth = true;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
if (open) {
|
|
745
|
+
p.closePath();
|
|
746
|
+
open = false;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
break;
|
|
750
|
+
case 18: // hstemhm
|
|
751
|
+
parseStems();
|
|
752
|
+
break;
|
|
753
|
+
case 19: // hintmask
|
|
754
|
+
case 20: // cntrmask
|
|
755
|
+
parseStems();
|
|
756
|
+
i += (nStems + 7) >> 3;
|
|
757
|
+
break;
|
|
758
|
+
case 21: // rmoveto
|
|
759
|
+
if (stack.length > 2 && !haveWidth) {
|
|
760
|
+
width = stack.shift() + nominalWidthX;
|
|
761
|
+
haveWidth = true;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
y += stack.pop();
|
|
765
|
+
x += stack.pop();
|
|
766
|
+
newContour(x, y);
|
|
767
|
+
break;
|
|
768
|
+
case 22: // hmoveto
|
|
769
|
+
if (stack.length > 1 && !haveWidth) {
|
|
770
|
+
width = stack.shift() + nominalWidthX;
|
|
771
|
+
haveWidth = true;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
x += stack.pop();
|
|
775
|
+
newContour(x, y);
|
|
776
|
+
break;
|
|
777
|
+
case 23: // vstemhm
|
|
778
|
+
parseStems();
|
|
779
|
+
break;
|
|
780
|
+
case 24: // rcurveline
|
|
781
|
+
while (stack.length > 2) {
|
|
782
|
+
c1x = x + stack.shift();
|
|
783
|
+
c1y = y + stack.shift();
|
|
784
|
+
c2x = c1x + stack.shift();
|
|
785
|
+
c2y = c1y + stack.shift();
|
|
786
|
+
x = c2x + stack.shift();
|
|
787
|
+
y = c2y + stack.shift();
|
|
788
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
x += stack.shift();
|
|
792
|
+
y += stack.shift();
|
|
793
|
+
p.lineTo(x, y);
|
|
794
|
+
break;
|
|
795
|
+
case 25: // rlinecurve
|
|
796
|
+
while (stack.length > 6) {
|
|
797
|
+
x += stack.shift();
|
|
798
|
+
y += stack.shift();
|
|
799
|
+
p.lineTo(x, y);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
c1x = x + stack.shift();
|
|
803
|
+
c1y = y + stack.shift();
|
|
804
|
+
c2x = c1x + stack.shift();
|
|
805
|
+
c2y = c1y + stack.shift();
|
|
806
|
+
x = c2x + stack.shift();
|
|
807
|
+
y = c2y + stack.shift();
|
|
808
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
809
|
+
break;
|
|
810
|
+
case 26: // vvcurveto
|
|
811
|
+
if (stack.length % 2) {
|
|
812
|
+
x += stack.shift();
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
while (stack.length > 0) {
|
|
816
|
+
c1x = x;
|
|
817
|
+
c1y = y + stack.shift();
|
|
818
|
+
c2x = c1x + stack.shift();
|
|
819
|
+
c2y = c1y + stack.shift();
|
|
820
|
+
x = c2x;
|
|
821
|
+
y = c2y + stack.shift();
|
|
822
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
break;
|
|
826
|
+
case 27: // hhcurveto
|
|
827
|
+
if (stack.length % 2) {
|
|
828
|
+
y += stack.shift();
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
while (stack.length > 0) {
|
|
832
|
+
c1x = x + stack.shift();
|
|
833
|
+
c1y = y;
|
|
834
|
+
c2x = c1x + stack.shift();
|
|
835
|
+
c2y = c1y + stack.shift();
|
|
836
|
+
x = c2x + stack.shift();
|
|
837
|
+
y = c2y;
|
|
838
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
break;
|
|
842
|
+
case 28: // shortint
|
|
843
|
+
b1 = code[i];
|
|
844
|
+
b2 = code[i + 1];
|
|
845
|
+
stack.push(((b1 << 24) | (b2 << 16)) >> 16);
|
|
846
|
+
i += 2;
|
|
847
|
+
break;
|
|
848
|
+
case 29: // callgsubr
|
|
849
|
+
codeIndex = stack.pop() + font.gsubrsBias;
|
|
850
|
+
subrCode = font.gsubrs[codeIndex];
|
|
851
|
+
if (subrCode) {
|
|
852
|
+
parse(subrCode);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
break;
|
|
856
|
+
case 30: // vhcurveto
|
|
857
|
+
while (stack.length > 0) {
|
|
858
|
+
c1x = x;
|
|
859
|
+
c1y = y + stack.shift();
|
|
860
|
+
c2x = c1x + stack.shift();
|
|
861
|
+
c2y = c1y + stack.shift();
|
|
862
|
+
x = c2x + stack.shift();
|
|
863
|
+
y = c2y + (stack.length === 1 ? stack.shift() : 0);
|
|
864
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
865
|
+
if (stack.length === 0) {
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
c1x = x + stack.shift();
|
|
870
|
+
c1y = y;
|
|
871
|
+
c2x = c1x + stack.shift();
|
|
872
|
+
c2y = c1y + stack.shift();
|
|
873
|
+
y = c2y + stack.shift();
|
|
874
|
+
x = c2x + (stack.length === 1 ? stack.shift() : 0);
|
|
875
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
break;
|
|
879
|
+
case 31: // hvcurveto
|
|
880
|
+
while (stack.length > 0) {
|
|
881
|
+
c1x = x + stack.shift();
|
|
882
|
+
c1y = y;
|
|
883
|
+
c2x = c1x + stack.shift();
|
|
884
|
+
c2y = c1y + stack.shift();
|
|
885
|
+
y = c2y + stack.shift();
|
|
886
|
+
x = c2x + (stack.length === 1 ? stack.shift() : 0);
|
|
887
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
888
|
+
if (stack.length === 0) {
|
|
889
|
+
break;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
c1x = x;
|
|
893
|
+
c1y = y + stack.shift();
|
|
894
|
+
c2x = c1x + stack.shift();
|
|
895
|
+
c2y = c1y + stack.shift();
|
|
896
|
+
x = c2x + stack.shift();
|
|
897
|
+
y = c2y + (stack.length === 1 ? stack.shift() : 0);
|
|
898
|
+
p.curveTo(c1x, c1y, c2x, c2y, x, y);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
break;
|
|
902
|
+
default:
|
|
903
|
+
if (v < 32) {
|
|
904
|
+
console.log(
|
|
905
|
+
'Glyph ' + glyph.index + ': unknown operator ' + v
|
|
906
|
+
);
|
|
907
|
+
} else if (v < 247) {
|
|
908
|
+
stack.push(v - 139);
|
|
909
|
+
} else if (v < 251) {
|
|
910
|
+
b1 = code[i];
|
|
911
|
+
i += 1;
|
|
912
|
+
stack.push((v - 247) * 256 + b1 + 108);
|
|
913
|
+
} else if (v < 255) {
|
|
914
|
+
b1 = code[i];
|
|
915
|
+
i += 1;
|
|
916
|
+
stack.push(-(v - 251) * 256 - b1 - 108);
|
|
917
|
+
} else {
|
|
918
|
+
b1 = code[i];
|
|
919
|
+
b2 = code[i + 1];
|
|
920
|
+
b3 = code[i + 2];
|
|
921
|
+
b4 = code[i + 3];
|
|
922
|
+
i += 4;
|
|
923
|
+
stack.push(
|
|
924
|
+
((b1 << 24) | (b2 << 16) | (b3 << 8) | b4) / 65536
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
parse(code);
|
|
932
|
+
|
|
933
|
+
glyph.advanceWidth = width;
|
|
934
|
+
return p;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
function parseCFFFDSelect(data, start, nGlyphs, fdArrayCount) {
|
|
938
|
+
const fdSelect = [];
|
|
939
|
+
let fdIndex;
|
|
940
|
+
const parser = new parse.Parser(data, start);
|
|
941
|
+
const format = parser.parseCard8();
|
|
942
|
+
if (format === 0) {
|
|
943
|
+
// Simple list of nGlyphs elements
|
|
944
|
+
for (let iGid = 0; iGid < nGlyphs; iGid++) {
|
|
945
|
+
fdIndex = parser.parseCard8();
|
|
946
|
+
if (fdIndex >= fdArrayCount) {
|
|
947
|
+
throw new Error(
|
|
948
|
+
'CFF table CID Font FDSelect has bad FD index value ' +
|
|
949
|
+
fdIndex +
|
|
950
|
+
' (FD count ' +
|
|
951
|
+
fdArrayCount +
|
|
952
|
+
')'
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
fdSelect.push(fdIndex);
|
|
956
|
+
}
|
|
957
|
+
} else if (format === 3) {
|
|
958
|
+
// Ranges
|
|
959
|
+
const nRanges = parser.parseCard16();
|
|
960
|
+
let first = parser.parseCard16();
|
|
961
|
+
if (first !== 0) {
|
|
962
|
+
throw new Error(
|
|
963
|
+
'CFF Table CID Font FDSelect format 3 range has bad initial GID ' +
|
|
964
|
+
first
|
|
965
|
+
);
|
|
966
|
+
}
|
|
967
|
+
let next;
|
|
968
|
+
for (let iRange = 0; iRange < nRanges; iRange++) {
|
|
969
|
+
fdIndex = parser.parseCard8();
|
|
970
|
+
next = parser.parseCard16();
|
|
971
|
+
if (fdIndex >= fdArrayCount) {
|
|
972
|
+
throw new Error(
|
|
973
|
+
'CFF table CID Font FDSelect has bad FD index value ' +
|
|
974
|
+
fdIndex +
|
|
975
|
+
' (FD count ' +
|
|
976
|
+
fdArrayCount +
|
|
977
|
+
')'
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
if (next > nGlyphs) {
|
|
981
|
+
throw new Error(
|
|
982
|
+
'CFF Table CID Font FDSelect format 3 range has bad GID ' +
|
|
983
|
+
next
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
for (; first < next; first++) {
|
|
987
|
+
fdSelect.push(fdIndex);
|
|
988
|
+
}
|
|
989
|
+
first = next;
|
|
990
|
+
}
|
|
991
|
+
if (next !== nGlyphs) {
|
|
992
|
+
throw new Error(
|
|
993
|
+
'CFF Table CID Font FDSelect format 3 range has bad final GID ' +
|
|
994
|
+
next
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
} else {
|
|
998
|
+
throw new Error(
|
|
999
|
+
'CFF Table CID Font FDSelect table has unsupported format ' + format
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
return fdSelect;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// Parse the `CFF` table, which contains the glyph outlines in PostScript format.
|
|
1006
|
+
function parseCFFTable(data, start, font, opt) {
|
|
1007
|
+
font.tables.cff = {};
|
|
1008
|
+
const header = parseCFFHeader(data, start);
|
|
1009
|
+
const nameIndex = parseCFFIndex(
|
|
1010
|
+
data,
|
|
1011
|
+
header.endOffset,
|
|
1012
|
+
parse.bytesToString
|
|
1013
|
+
);
|
|
1014
|
+
const topDictIndex = parseCFFIndex(data, nameIndex.endOffset);
|
|
1015
|
+
const stringIndex = parseCFFIndex(
|
|
1016
|
+
data,
|
|
1017
|
+
topDictIndex.endOffset,
|
|
1018
|
+
parse.bytesToString
|
|
1019
|
+
);
|
|
1020
|
+
const globalSubrIndex = parseCFFIndex(data, stringIndex.endOffset);
|
|
1021
|
+
font.gsubrs = globalSubrIndex.objects;
|
|
1022
|
+
font.gsubrsBias = calcCFFSubroutineBias(font.gsubrs);
|
|
1023
|
+
|
|
1024
|
+
const topDictArray = gatherCFFTopDicts(
|
|
1025
|
+
data,
|
|
1026
|
+
start,
|
|
1027
|
+
topDictIndex.objects,
|
|
1028
|
+
stringIndex.objects
|
|
1029
|
+
);
|
|
1030
|
+
if (topDictArray.length !== 1) {
|
|
1031
|
+
throw new Error(
|
|
1032
|
+
"CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " +
|
|
1033
|
+
topDictArray.length
|
|
1034
|
+
);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
const topDict = topDictArray[0];
|
|
1038
|
+
font.tables.cff.topDict = topDict;
|
|
1039
|
+
|
|
1040
|
+
if (topDict._privateDict) {
|
|
1041
|
+
font.defaultWidthX = topDict._privateDict.defaultWidthX;
|
|
1042
|
+
font.nominalWidthX = topDict._privateDict.nominalWidthX;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
if (topDict.ros[0] !== undefined && topDict.ros[1] !== undefined) {
|
|
1046
|
+
font.isCIDFont = true;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
if (font.isCIDFont) {
|
|
1050
|
+
let fdArrayOffset = topDict.fdArray;
|
|
1051
|
+
let fdSelectOffset = topDict.fdSelect;
|
|
1052
|
+
if (fdArrayOffset === 0 || fdSelectOffset === 0) {
|
|
1053
|
+
throw new Error(
|
|
1054
|
+
'Font is marked as a CID font, but FDArray and/or FDSelect information is missing'
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
fdArrayOffset += start;
|
|
1058
|
+
const fdArrayIndex = parseCFFIndex(data, fdArrayOffset);
|
|
1059
|
+
const fdArray = gatherCFFTopDicts(
|
|
1060
|
+
data,
|
|
1061
|
+
start,
|
|
1062
|
+
fdArrayIndex.objects,
|
|
1063
|
+
stringIndex.objects
|
|
1064
|
+
);
|
|
1065
|
+
topDict._fdArray = fdArray;
|
|
1066
|
+
fdSelectOffset += start;
|
|
1067
|
+
topDict._fdSelect = parseCFFFDSelect(
|
|
1068
|
+
data,
|
|
1069
|
+
fdSelectOffset,
|
|
1070
|
+
font.numGlyphs,
|
|
1071
|
+
fdArray.length
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
const privateDictOffset = start + topDict.private[1];
|
|
1076
|
+
const privateDict = parseCFFPrivateDict(
|
|
1077
|
+
data,
|
|
1078
|
+
privateDictOffset,
|
|
1079
|
+
topDict.private[0],
|
|
1080
|
+
stringIndex.objects
|
|
1081
|
+
);
|
|
1082
|
+
font.defaultWidthX = privateDict.defaultWidthX;
|
|
1083
|
+
font.nominalWidthX = privateDict.nominalWidthX;
|
|
1084
|
+
|
|
1085
|
+
if (privateDict.subrs !== 0) {
|
|
1086
|
+
const subrOffset = privateDictOffset + privateDict.subrs;
|
|
1087
|
+
const subrIndex = parseCFFIndex(data, subrOffset);
|
|
1088
|
+
font.subrs = subrIndex.objects;
|
|
1089
|
+
font.subrsBias = calcCFFSubroutineBias(font.subrs);
|
|
1090
|
+
} else {
|
|
1091
|
+
font.subrs = [];
|
|
1092
|
+
font.subrsBias = 0;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// Offsets in the top dict are relative to the beginning of the CFF data, so add the CFF start offset.
|
|
1096
|
+
let charStringsIndex;
|
|
1097
|
+
if (opt.lowMemory) {
|
|
1098
|
+
charStringsIndex = parseCFFIndexLowMemory(
|
|
1099
|
+
data,
|
|
1100
|
+
start + topDict.charStrings
|
|
1101
|
+
);
|
|
1102
|
+
font.nGlyphs = charStringsIndex.offsets.length;
|
|
1103
|
+
} else {
|
|
1104
|
+
charStringsIndex = parseCFFIndex(data, start + topDict.charStrings);
|
|
1105
|
+
font.nGlyphs = charStringsIndex.objects.length;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
const charset = parseCFFCharset(
|
|
1109
|
+
data,
|
|
1110
|
+
start + topDict.charset,
|
|
1111
|
+
font.nGlyphs,
|
|
1112
|
+
stringIndex.objects
|
|
1113
|
+
);
|
|
1114
|
+
if (topDict.encoding === 0) {
|
|
1115
|
+
// Standard encoding
|
|
1116
|
+
font.cffEncoding = new CffEncoding(cffStandardEncoding, charset);
|
|
1117
|
+
} else if (topDict.encoding === 1) {
|
|
1118
|
+
// Expert encoding
|
|
1119
|
+
font.cffEncoding = new CffEncoding(cffExpertEncoding, charset);
|
|
1120
|
+
} else {
|
|
1121
|
+
font.cffEncoding = parseCFFEncoding(
|
|
1122
|
+
data,
|
|
1123
|
+
start + topDict.encoding,
|
|
1124
|
+
charset
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// Prefer the CMAP encoding to the CFF encoding.
|
|
1129
|
+
font.encoding = font.encoding || font.cffEncoding;
|
|
1130
|
+
|
|
1131
|
+
font.glyphs = new glyphset.GlyphSet(font);
|
|
1132
|
+
if (opt.lowMemory) {
|
|
1133
|
+
font._push = function (i) {
|
|
1134
|
+
const charString = getCffIndexObject(
|
|
1135
|
+
i,
|
|
1136
|
+
charStringsIndex.offsets,
|
|
1137
|
+
data,
|
|
1138
|
+
start + topDict.charStrings
|
|
1139
|
+
);
|
|
1140
|
+
font.glyphs.push(
|
|
1141
|
+
i,
|
|
1142
|
+
glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)
|
|
1143
|
+
);
|
|
1144
|
+
};
|
|
1145
|
+
} else {
|
|
1146
|
+
for (let i = 0; i < font.nGlyphs; i += 1) {
|
|
1147
|
+
const charString = charStringsIndex.objects[i];
|
|
1148
|
+
font.glyphs.push(
|
|
1149
|
+
i,
|
|
1150
|
+
glyphset.cffGlyphLoader(font, i, parseCFFCharstring, charString)
|
|
1151
|
+
);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export default { parse: parseCFFTable };
|