decocms 4.161.2 → 4.162.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.
- package/dist/client/assets/{AlertCircle-DkjWcZD-.js → AlertCircle-LCxBCJ8n.js} +1 -1
- package/dist/client/assets/{AreaChart-BhkonnRg.js → AreaChart-CVlhdmdg.js} +1 -1
- package/dist/client/assets/{ArrowUp-DAA8boPY.js → ArrowUp-LFRKHLuQ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D8TPuRuJ.js → ArrowUpRight-CXMFqfGp.js} +1 -1
- package/dist/client/assets/{Check-De5xpJ0K.js → Check-BCFAcmIa.js} +1 -1
- package/dist/client/assets/{CheckCircle-DeJIdYYq.js → CheckCircle-DpOD9rH0.js} +1 -1
- package/dist/client/assets/{ChevronDown-grOM3xSX.js → ChevronDown-BOvaCVzg.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cyogjxfm.js → ChevronRight-liTksB2U.js} +1 -1
- package/dist/client/assets/{ChevronUp-DIUedEx1.js → ChevronUp-BIqoKMUJ.js} +1 -1
- package/dist/client/assets/{Copy01-DEkTleE-.js → Copy01-ZIMiAxdP.js} +1 -1
- package/dist/client/assets/{CpuChip01-Dsk680MX.js → CpuChip01-ZsmfFXVO.js} +1 -1
- package/dist/client/assets/{DotsVertical-BaMvQPx5.js → DotsVertical-CtO9eku7.js} +1 -1
- package/dist/client/assets/{Eye-DdzBJpW0.js → Eye-BQWYf35S.js} +1 -1
- package/dist/client/assets/{FilterLines-1IFdHyBL.js → FilterLines-CaGojimS.js} +1 -1
- package/dist/client/assets/{HardDrive-CZF0RiCb.js → HardDrive-BRyCfhBH.js} +1 -1
- package/dist/client/assets/{Key01-qFWWm7I0.js → Key01-i8xg5eM3.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D3dfvOJc.js → LayoutLeft-Co2_iLon.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BUH7ViZX.js → LinkExternal01-S8dAjzzi.js} +1 -1
- package/dist/client/assets/{LogOut01-GO407ARs.js → LogOut01-D75UBZCc.js} +1 -1
- package/dist/client/assets/{Monitor01-BBb-96JI.js → Monitor01-BAx1QWFz.js} +1 -1
- package/dist/client/assets/{Palette-G-qrN-IT.js → Palette-Bg3YC03V.js} +1 -1
- package/dist/client/assets/{Play-CkvF8PeT.js → Play-VIp82r5R.js} +1 -1
- package/dist/client/assets/{Plus-DolMQAo4.js → Plus-C9hAZmdY.js} +1 -1
- package/dist/client/assets/{SearchLg-CFQzg9fN.js → SearchLg-CqGEHAUM.js} +1 -1
- package/dist/client/assets/{SearchMd-DCX7P32_.js → SearchMd-oPsBet0y.js} +1 -1
- package/dist/client/assets/{Settings02-QFTejQVV.js → Settings02-DNMfHyCE.js} +1 -1
- package/dist/client/assets/{Shield01-BlitQe4N.js → Shield01-DD8XMdYI.js} +1 -1
- package/dist/client/assets/{Star01-D0qlrfqR.js → Star01-y2n-9wTn.js} +1 -1
- package/dist/client/assets/{Stars01-2TnupN6q.js → Stars01-CJ0QEEdc.js} +1 -1
- package/dist/client/assets/{Stars02-DbK2oBak.js → Stars02-B3TWh8au.js} +1 -1
- package/dist/client/assets/{Sun-DVajpqnC.js → Sun-BQEYQLhf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DY4K5cqR.js → SwitchHorizontal01-Dsxsamxe.js} +1 -1
- package/dist/client/assets/{Tool01-CgtDQOgO.js → Tool01-Oew-Vovb.js} +1 -1
- package/dist/client/assets/{Tool02-MSwzSxke.js → Tool02-CJeM1QZT.js} +1 -1
- package/dist/client/assets/{Trash01-DSxLTY0P.js → Trash01-CLRqp8e5.js} +1 -1
- package/dist/client/assets/{TrendUp01-djHA1GEE.js → TrendUp01-Bm1SbHN0.js} +1 -1
- package/dist/client/assets/{Upload01-W82kShpH.js → Upload01-ZVOuhs4w.js} +1 -1
- package/dist/client/assets/{User01-CXTn_TP5.js → User01-BYLEai7_.js} +1 -1
- package/dist/client/assets/{Users01-DQVb_7oO.js → Users01-CS4W313X.js} +1 -1
- package/dist/client/assets/{Users03-DK2c0NaU.js → Users03-CbHaoSh0.js} +1 -1
- package/dist/client/assets/{X-DsGAzzV8.js → X-x99fWfG-.js} +1 -1
- package/dist/client/assets/{XCircle-DuADiFVm.js → XCircle-CeqmuHIK.js} +1 -1
- package/dist/client/assets/{XClose-BOYWq1vy.js → XClose-CCug5seG.js} +1 -1
- package/dist/client/assets/{Zap-Djw_FpdI.js → Zap-DHqCvvjt.js} +1 -1
- package/dist/client/assets/{ZapSquare-C3s49zNL.js → ZapSquare-BKWVL4uR.js} +1 -1
- package/dist/client/assets/{access-gate-BRcWAcEH.js → access-gate-C9PFWoZS.js} +1 -1
- package/dist/client/assets/{add-section-modal-DkaZh9cy.js → add-section-modal-DEjIe-XG.js} +1 -1
- package/dist/client/assets/{agent-icon-D0etPDkN.js → agent-icon-DR5LB4zY.js} +1 -1
- package/dist/client/assets/{agents-list-1nArnMzn.js → agents-list-BvXD__fr.js} +1 -1
- package/dist/client/assets/{ai-providers-XeksWCKW.js → ai-providers-DuMestUx.js} +1 -1
- package/dist/client/assets/{alert-I-_PUhRM.js → alert-DWAFMZWl.js} +1 -1
- package/dist/client/assets/{alert-dialog-B3JnEiZT.js → alert-dialog-DR9_FciR.js} +1 -1
- package/dist/client/assets/{app-editor-BbkYtqwi.js → app-editor-BC28cPFO.js} +1 -1
- package/dist/client/assets/{auth-BkcPrlSH.js → auth-BiMrtm96.js} +1 -1
- package/dist/client/assets/{auth-catchall-JZDu0xii.js → auth-catchall-BNPPREMt.js} +1 -1
- package/dist/client/assets/{auth-entry-D376ANc2.js → auth-entry-CVJjeL2L.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DULW70yu.js → auth-split-layout-CbPO57v5.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DZxhoF_0.js → authenticate-and-persist-oauth-B8SUVbil.js} +1 -1
- package/dist/client/assets/{automation-list-row-y5_hhf0p.js → automation-list-row-C5X09Iy0.js} +1 -1
- package/dist/client/assets/{automation-runs-DNqF8MQa.js → automation-runs-i1Rm2H_V.js} +1 -1
- package/dist/client/assets/{automations-BTGiuB5f.js → automations-C48IGjrC.js} +1 -1
- package/dist/client/assets/{avatar-ShBwmidu.js → avatar-CssB4IS0.js} +1 -1
- package/dist/client/assets/{badge-CLGDkcax.js → badge-B-S2iO6e.js} +1 -1
- package/dist/client/assets/{block-document-DKkHndgg.js → block-document-Dotg4_gG.js} +1 -1
- package/dist/client/assets/{brand-context-DidwD5g4.js → brand-context-C331P1EH.js} +1 -1
- package/dist/client/assets/{buckets-BXy6rRmD.js → buckets-zt_s5mti.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Pp9TOqgP.js → bulk-category-panel-DMe3EujP.js} +1 -1
- package/dist/client/assets/{calendar-BcaXLcUe.js → calendar-BO4sgiAT.js} +1 -1
- package/dist/client/assets/{capability-load-error-CqdQPRYW.js → capability-load-error-B2CpoAHd.js} +1 -1
- package/dist/client/assets/{card-C98b87L-.js → card-Dtd81GX2.js} +1 -1
- package/dist/client/assets/{category-editor-BnVhTkaR.js → category-editor-BxdNiDrW.js} +1 -1
- package/dist/client/assets/{chat-context-DAYV5YFw.js → chat-context-_ugV5jB0.js} +1 -1
- package/dist/client/assets/{checkbox-hx3qwtU4.js → checkbox-DyL6jqNP.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CSA4lo7W.js → cli-auth-success-CBllfpZy.js} +1 -1
- package/dist/client/assets/{collection-detail-Dnt_8ShC.js → collection-detail-CJ-IT8lZ.js} +1 -1
- package/dist/client/assets/{collection-display-button-D7ZFqgmc.js → collection-display-button-rIB9x9ex.js} +1 -1
- package/dist/client/assets/{collection-search-BujcF3uz.js → collection-search-DDaBoxpd.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dxzi1B76.js → collection-table-wrapper-DvDVvjdJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-1Doa_k8q.js → collection-tabs-6ZZEGxA4.js} +1 -1
- package/dist/client/assets/{command-DTif1pCh.js → command-B0sPw5D_.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CkLAXxz7.js → commerce-onboarding-CA2gNg1f.js} +1 -1
- package/dist/client/assets/{companions-core-DyTSbEDy.js → companions-core-bB24Ott2.js} +1 -1
- package/dist/client/assets/{connect-BQJsmY0Z.js → connect-dTZGddot.js} +1 -1
- package/dist/client/assets/{connection-DT5hjP5L.js → connection-B2NXk64E.js} +1 -1
- package/dist/client/assets/{connection-card-BEnBoaJQ.js → connection-card-D4yqc7qp.js} +1 -1
- package/dist/client/assets/{connection-detail-3HClPo6D.js → connection-detail-BNv09xz3.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D1M4SXKF.js → connection-form-helpers-Dp2JRmtQ.js} +1 -1
- package/dist/client/assets/{connections-ok4_lFFO.js → connections-Dkp0iGo0.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Z3wBsgik.js → decopilot-sse-pool-tfgrlddF.js} +1 -1
- package/dist/client/assets/{dialog-B1XOtEFa.js → dialog-DDV9hxrK.js} +1 -1
- package/dist/client/assets/{domain-settings-BX-8JSGW.js → domain-settings-Cj5IWEJw.js} +1 -1
- package/dist/client/assets/{drawer-Bindqbrh.js → drawer-CLLhxT0A.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B2utwqdh.js → dropdown-menu-DFyP7pd-.js} +1 -1
- package/dist/client/assets/{empty-state-ClLU6296.js → empty-state-C8MJdBfO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DSg0AjMi.js → extract-connection-data-GzPEHPIn.js} +1 -1
- package/dist/client/assets/{file-explorer-5gFVDcag.js → file-explorer-DcVPQshc.js} +1 -1
- package/dist/client/assets/{form-ujVSU6EU.js → form-dL4WOA5T.js} +1 -1
- package/dist/client/assets/{general-BgWx-5sJ.js → general-6LKGbmPX.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CuyTuY6S.js → github-repo-picker-BYme-j8T.js} +1 -1
- package/dist/client/assets/{hooks-BSzBu2tD.js → hooks-B9cPFqGD.js} +1 -1
- package/dist/client/assets/{index-Cx7SoZn_.js → index-60s5nmmz.js} +1 -1
- package/dist/client/assets/{index-DLYm4Sa-.js → index-BBd4FRXS.js} +1 -1
- package/dist/client/assets/{index-BwQT5Hhi.js → index-By7P3hhU.js} +1 -1
- package/dist/client/assets/{index-Bhxc2Isb.js → index-D2YLDCkn.js} +1 -1
- package/dist/client/assets/{index-B6q32zYz.js → index-DeVgWfhn.js} +1 -1
- package/dist/client/assets/{index-CBD4gVZR.js → index-Y9ucfh4p.js} +1 -1
- package/dist/client/assets/{index-DvtCTmmx.js → index-ZADPN4om.js} +3 -3
- package/dist/client/assets/{index-DyrZQfe8.js → index-jG87093U.js} +1 -1
- package/dist/client/assets/{index-WEdfBcak.js → index-kfiIPtrP.js} +3 -3
- package/dist/client/assets/{index-PxBIb6oF.js → index-pBoO89BO.js} +1 -1
- package/dist/client/assets/{index-redirect-CzO62sP0.js → index-redirect-CfBCt2ky.js} +1 -1
- package/dist/client/assets/{index-DJEeCuky.js → index-u1ajTG-j.js} +5 -5
- package/dist/client/assets/{input-psV6HQEl.js → input-BjlpMnRZ.js} +1 -1
- package/dist/client/assets/{integration-icon-DjHXNUPP.js → integration-icon-CI602PfH.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CB5VBjiU.js → invite-member-dialog-phqD0XUF.js} +1 -1
- package/dist/client/assets/{label-6xyucx-s.js → label-CSNgMmTA.js} +1 -1
- package/dist/client/assets/{layout-CBOg45xC.js → layout-BBpcfaXL.js} +1 -1
- package/dist/client/assets/{login-Cxn9KXio.js → login-DE_463fT.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CKixkOtS.js → mcp-oauth-CxvR2V5h.js} +1 -1
- package/dist/client/assets/{members-CL8x8Krr.js → members-CeatJR1m.js} +1 -1
- package/dist/client/assets/{monaco-editor-DJpDPKHP.js → monaco-editor-zuz4s4Wv.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DPROMALt.js → monitoring-stats-row-krDWXB2t.js} +1 -1
- package/dist/client/assets/{multi-select-Bh_v-l_m.js → multi-select-CMyA49eR.js} +1 -1
- package/dist/client/assets/{oauth-callback-DutuJ6V_.js → oauth-callback-C9jDdjjs.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C4S55pOq.js → oauth-callback-ai-provider-CY3QZi7E.js} +1 -1
- package/dist/client/assets/{onboarding-DuerzaiT.js → onboarding-C3hOUjMo.js} +1 -1
- package/dist/client/assets/{org-layout-of8A1jAC.js → org-layout-XwuOFG3d.js} +1 -1
- package/dist/client/assets/{organization-choice-B3rPtstm.js → organization-choice-BM-XKanD.js} +1 -1
- package/dist/client/assets/{orgs-3twuRrYh.js → orgs-DmL2XQRI.js} +1 -1
- package/dist/client/assets/{page-seo-form-BY3nYdel.js → page-seo-form-0xV6qNbu.js} +1 -1
- package/dist/client/assets/{popover-BGrrSZ8M.js → popover-EE72qx8A.js} +1 -1
- package/dist/client/assets/{post-editor-C4XyjEMt.js → post-editor-BuHJ7HnN.js} +1 -1
- package/dist/client/assets/{primitives-CbLkj1JF.js → primitives-ChQICk_y.js} +1 -1
- package/dist/client/assets/{profile-QV2jNue9.js → profile-B0SoUvj9.js} +1 -1
- package/dist/client/assets/project-app-view-YTx3iCq1.js +1 -0
- package/dist/client/assets/record-editor-M7bvrOuK.js +1 -0
- package/dist/client/assets/{redirect-editor-s6PMTrlX.js → redirect-editor-_6dVoePs.js} +1 -1
- package/dist/client/assets/registry-fNrz9Fbw.js +2 -0
- package/dist/client/assets/{registry-layout-DO-5mJZI.js → registry-layout-OS_nbWHC.js} +1 -1
- package/dist/client/assets/{reports-CwFf2f6b.js → reports-B3VBQs5Y.js} +1 -1
- package/dist/client/assets/{require-capability-BeOopecx.js → require-capability-CieeBdjs.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BFWyMRf5.js → required-auth-layout-BDIyJAhL.js} +1 -1
- package/dist/client/assets/{reset-password-C_-lQlSH.js → reset-password-CpG0cI8F.js} +1 -1
- package/dist/client/assets/{roles-D_oBaje3.js → roles-DlOhY5JD.js} +1 -1
- package/dist/client/assets/{search-input-Bfg6VxQW.js → search-input-cF6ciAVZ.js} +1 -1
- package/dist/client/assets/{secrets-k2GFZysm.js → secrets-Dh26lP0l.js} +1 -1
- package/dist/client/assets/{sections-editor-BujDptuZ.js → sections-editor-HbcASmu4.js} +1 -1
- package/dist/client/assets/{select-CWMyLghp.js → select-ceaThfRJ.js} +1 -1
- package/dist/client/assets/{select-model-CXvd3jI3.js → select-model-CDLnPEtQ.js} +1 -1
- package/dist/client/assets/{self-tool-result-BpCEaqPw.js → self-tool-result-CaPtQwDV.js} +1 -1
- package/dist/client/assets/{seo-editor-Cxh8JRxE.js → seo-editor-CoW5u7nN.js} +1 -1
- package/dist/client/assets/{settings-layout-D-wc3B9V.js → settings-layout-CM35yCas.js} +1 -1
- package/dist/client/assets/{settings-section-Z9R6HthO.js → settings-section-BJKYi71q.js} +1 -1
- package/dist/client/assets/{shell-controls-DJv-74jc.js → shell-controls-BLKKFd-i.js} +1 -1
- package/dist/client/assets/{shell-layout-C7_zhx2J.js → shell-layout-Cem8gTbL.js} +1 -1
- package/dist/client/assets/{sidebar-CGksZnes.js → sidebar-4JG4Ky1v.js} +1 -1
- package/dist/client/assets/{skeleton-BpfjGmFh.js → skeleton-QaXxQA1G.js} +1 -1
- package/dist/client/assets/{spinner-D0HY4fdO.js → spinner-CyUVcOie.js} +1 -1
- package/dist/client/assets/{sso-Bz5k2CGO.js → sso-CCHd62CO.js} +1 -1
- package/dist/client/assets/{store-DT_Iylxw.js → store-lf3dlAB1.js} +1 -1
- package/dist/client/assets/store-registry-BTA3Me55.js +2 -0
- package/dist/client/assets/{studio-tools-ChooDZCt.js → studio-tools-CUWFqlTh.js} +1 -1
- package/dist/client/assets/{switch-BmoPsk_L.js → switch-1Vfz3uSg.js} +1 -1
- package/dist/client/assets/{tab-id-DpWn0fbM.js → tab-id-CI2T4n3l.js} +1 -1
- package/dist/client/assets/{table-BluVU23Z.js → table-BQAbKOYa.js} +1 -1
- package/dist/client/assets/{tabs-C9Dri0XB.js → tabs-qagPrFeg.js} +1 -1
- package/dist/client/assets/{textarea-CMhJIDqb.js → textarea-C3WLqu3y.js} +1 -1
- package/dist/client/assets/{toggle-group-BK4yx2ic.js → toggle-group-NXghphbz.js} +1 -1
- package/dist/client/assets/{toolbar-CJN41Q0U.js → toolbar-ZE2CENTf.js} +1 -1
- package/dist/client/assets/{tooltip-DCC06XNr.js → tooltip-CiyZj9MW.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CTGRuhSY.js → use-ai-providers-B6AoVltc.js} +1 -1
- package/dist/client/assets/{use-automations-CTEnO1Zu.js → use-automations-CiQS3Pmq.js} +1 -1
- package/dist/client/assets/{use-autosave-CgHGIUlv.js → use-autosave-DE9X8qzD.js} +1 -1
- package/dist/client/assets/{use-capability-BTlnzwER.js → use-capability-DX60Hp0S.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Dg1-zfZ4.js → use-clock-tick-Q8CgV2VU.js} +1 -1
- package/dist/client/assets/{use-connection-BTIHIL2U.js → use-connection-c87Xz8U-.js} +1 -1
- package/dist/client/assets/{use-copy-Bkx7pWID.js → use-copy-BPhBM3Oi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-ClJmipur.js → use-create-virtual-mcp-BnZL3DPb.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Dp_dA5sI.js → use-debounced-autosave-BmT6bwNL.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Dx_Znjq0.js → use-debounced-value-DViZw7k7.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CnnQh7bH.js → use-deco-credits-DJJXk8t9.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-B84Jbaf1.js → use-decopilot-events-DuMl-BWe.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Dd7d9SGg.js → use-delete-connection--jtVGLkv.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CElXlSvL.js → use-deployment-admin-Cr_7c4Yl.js} +1 -1
- package/dist/client/assets/{use-file-configs-DUlhqIgH.js → use-file-configs-CwjnQywn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CRM4xUSx.js → use-infinite-scroll-8IyahDR0.js} +1 -1
- package/dist/client/assets/{use-join-requests-B0JwpKM9.js → use-join-requests-tHCwhSs3.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DH8oUnNS.js → use-mcp-auth-status-sjpR15R6.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C78T1evw.js → use-mcp-client-BmnPrlCp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-qcP_UOWU.js → use-mcp-tools-B9U_ZOEs.js} +1 -1
- package/dist/client/assets/{use-members-5U5mLxdD.js → use-members-BglXgqfG.js} +1 -1
- package/dist/client/assets/{use-mobile-BufL0gpx.js → use-mobile-ZF_jSfPp.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-bcvHJsmR.js → use-navigate-to-agent-DIeI8ULY.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-B93vTKrZ.js → use-org-auth-client-C-GSCd--.js} +1 -1
- package/dist/client/assets/{use-org-sso-BpALHDeh.js → use-org-sso-BawqtY1O.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CHjz2_ga.js → use-organization-roles-BfAcHhLm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-rcLpLxq6.js → use-organization-settings-DcixnwK-.js} +1 -1
- package/dist/client/assets/{use-registry-connections-XjUGFr5z.js → use-registry-connections-VIMCCdEN.js} +1 -1
- package/dist/client/assets/{use-secrets-DVGBRr0e.js → use-secrets-DN6xkhJI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CNPY1kJ-.js → use-status-sounds-CVssdpKX.js} +1 -1
- package/dist/client/assets/{use-tags-d-ihZKch.js → use-tags-OVuXWbIz.js} +1 -1
- package/dist/client/assets/{use-view-mode-CxLEvfyI.js → use-view-mode-BdkdIEp5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-tTUO8PD5.js → use-virtual-mcp-BIQdKSoy.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-QTu-xaep.js +1 -0
- package/dist/client/assets/{useQueries-CX-pbcRo.js → useQueries-D2CKhSr2.js} +1 -1
- package/dist/client/assets/{useRouterState-DM9ViZSm.js → useRouterState-B0tRZSRp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-_f32It26.js +1 -0
- package/dist/client/assets/{users-hps1B13C.js → users-Xgmv3XAu.js} +1 -1
- package/dist/client/assets/{variant-calendar--g4p8stV.js → variant-calendar-CHbHmJQD.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Cn3ICdtv.js → view-mode-toggle-DTYJdfuz.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +766 -766
- package/dist/server/server.js +576 -576
- package/package.json +2 -4
- package/dist/client/assets/project-app-view-CZZgc1s8.js +0 -1
- package/dist/client/assets/record-editor-Bk_Re_fD.js +0 -1
- package/dist/client/assets/registry-BTKEcIS_.js +0 -2
- package/dist/client/assets/store-registry-DwAm5lvb.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C1ye6sqf.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CiYM_Dv6.js +0 -1
- package/dist/server/node_modules/@resvg/resvg-js/LICENSE +0 -373
- package/dist/server/node_modules/@resvg/resvg-js/README.md +0 -314
- package/dist/server/node_modules/@resvg/resvg-js/index.js +0 -23
- package/dist/server/node_modules/@resvg/resvg-js/js-binding.js +0 -1
- package/dist/server/node_modules/@resvg/resvg-js/package.json +0 -152
- package/dist/server/node_modules/@shuding/opentype.js/LICENSE +0 -20
- package/dist/server/node_modules/@shuding/opentype.js/README.md +0 -9
- package/dist/server/node_modules/@shuding/opentype.js/RELEASES.md +0 -272
- package/dist/server/node_modules/@shuding/opentype.js/bin/ot +0 -84
- package/dist/server/node_modules/@shuding/opentype.js/bin/server.js +0 -64
- package/dist/server/node_modules/@shuding/opentype.js/bin/test-render +0 -96
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.js +0 -11655
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.min.js +0 -2
- package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.module.js +0 -11639
- package/dist/server/node_modules/@shuding/opentype.js/package.json +0 -73
- package/dist/server/node_modules/@shuding/opentype.js/src/bbox.js +0 -158
- package/dist/server/node_modules/@shuding/opentype.js/src/bidi.js +0 -243
- package/dist/server/node_modules/@shuding/opentype.js/src/char.js +0 -43
- package/dist/server/node_modules/@shuding/opentype.js/src/check.js +0 -16
- package/dist/server/node_modules/@shuding/opentype.js/src/encoding.js +0 -1032
- package/dist/server/node_modules/@shuding/opentype.js/src/features/applySubstitution.js +0 -74
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicPresentationForms.js +0 -83
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicRequiredLigatures.js +0 -41
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicSentence.js +0 -43
- package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicWord.js +0 -31
- package/dist/server/node_modules/@shuding/opentype.js/src/features/featureQuery.js +0 -483
- package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/contextCheck/latinWord.js +0 -31
- package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/latinLigatures.js +0 -40
- package/dist/server/node_modules/@shuding/opentype.js/src/font.js +0 -433
- package/dist/server/node_modules/@shuding/opentype.js/src/glyph.js +0 -274
- package/dist/server/node_modules/@shuding/opentype.js/src/glyphset.js +0 -150
- package/dist/server/node_modules/@shuding/opentype.js/src/hintingtt.js +0 -3062
- package/dist/server/node_modules/@shuding/opentype.js/src/index.js +0 -5
- package/dist/server/node_modules/@shuding/opentype.js/src/layout.js +0 -357
- package/dist/server/node_modules/@shuding/opentype.js/src/opentype.js +0 -375
- package/dist/server/node_modules/@shuding/opentype.js/src/parse.js +0 -628
- package/dist/server/node_modules/@shuding/opentype.js/src/path.js +0 -212
- package/dist/server/node_modules/@shuding/opentype.js/src/position.js +0 -77
- package/dist/server/node_modules/@shuding/opentype.js/src/substitution.js +0 -447
- package/dist/server/node_modules/@shuding/opentype.js/src/table.js +0 -215
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/cff.js +0 -1156
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/cmap.js +0 -145
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/fvar.js +0 -71
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gdef.js +0 -62
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/glyf.js +0 -349
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gpos.js +0 -146
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/gsub.js +0 -251
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/head.js +0 -35
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/hhea.js +0 -27
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/hmtx.js +0 -51
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/kern.js +0 -69
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/loca.js +0 -31
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/ltag.js +0 -33
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/maxp.js +0 -32
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/meta.js +0 -30
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/name.js +0 -680
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/os2.js +0 -65
- package/dist/server/node_modules/@shuding/opentype.js/src/tables/post.js +0 -41
- package/dist/server/node_modules/@shuding/opentype.js/src/tokenizer.js +0 -522
- package/dist/server/node_modules/@shuding/opentype.js/src/types.js +0 -976
- package/dist/server/node_modules/@shuding/opentype.js/src/util.js +0 -17
- package/dist/server/node_modules/base64-js/.travis.yml +0 -5
- package/dist/server/node_modules/base64-js/LICENSE.MIT +0 -21
- package/dist/server/node_modules/base64-js/README.md +0 -31
- package/dist/server/node_modules/base64-js/bench/bench.js +0 -19
- package/dist/server/node_modules/base64-js/lib/b64.js +0 -124
- package/dist/server/node_modules/base64-js/package.json +0 -34
- package/dist/server/node_modules/base64-js/test/convert.js +0 -51
- package/dist/server/node_modules/base64-js/test/url-safe.js +0 -18
- package/dist/server/node_modules/camelize/.eslintrc +0 -24
- package/dist/server/node_modules/camelize/.github/FUNDING.yml +0 -12
- package/dist/server/node_modules/camelize/CHANGELOG.md +0 -64
- package/dist/server/node_modules/camelize/LICENSE +0 -18
- package/dist/server/node_modules/camelize/README.md +0 -81
- package/dist/server/node_modules/camelize/example/camel.js +0 -12
- package/dist/server/node_modules/camelize/index.js +0 -61
- package/dist/server/node_modules/camelize/package.json +0 -84
- package/dist/server/node_modules/camelize/test/camel.js +0 -48
- package/dist/server/node_modules/color-name/LICENSE +0 -8
- package/dist/server/node_modules/color-name/README.md +0 -11
- package/dist/server/node_modules/color-name/index.js +0 -152
- package/dist/server/node_modules/color-name/package.json +0 -28
- package/dist/server/node_modules/css-background-parser/LICENSE +0 -22
- package/dist/server/node_modules/css-background-parser/README.md +0 -149
- package/dist/server/node_modules/css-background-parser/index.js +0 -162
- package/dist/server/node_modules/css-background-parser/package.json +0 -19
- package/dist/server/node_modules/css-box-shadow/README.md +0 -27
- package/dist/server/node_modules/css-box-shadow/index.js +0 -64
- package/dist/server/node_modules/css-box-shadow/package.json +0 -14
- package/dist/server/node_modules/css-box-shadow/test.js +0 -204
- package/dist/server/node_modules/css-color-keywords/LICENSE +0 -15
- package/dist/server/node_modules/css-color-keywords/README.md +0 -47
- package/dist/server/node_modules/css-color-keywords/colors.json +0 -148
- package/dist/server/node_modules/css-color-keywords/index.js +0 -3
- package/dist/server/node_modules/css-color-keywords/package.json +0 -27
- package/dist/server/node_modules/css-gradient-parser/LICENSE +0 -21
- package/dist/server/node_modules/css-gradient-parser/README.md +0 -75
- package/dist/server/node_modules/css-gradient-parser/dist/index.cjs +0 -2
- package/dist/server/node_modules/css-gradient-parser/dist/index.js +0 -2
- package/dist/server/node_modules/css-gradient-parser/package.json +0 -54
- package/dist/server/node_modules/css-to-react-native/LICENSE.md +0 -21
- package/dist/server/node_modules/css-to-react-native/README.md +0 -115
- package/dist/server/node_modules/css-to-react-native/index.js +0 -886
- package/dist/server/node_modules/css-to-react-native/package.json +0 -65
- package/dist/server/node_modules/css-to-react-native/src/TokenStream.js +0 -74
- package/dist/server/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +0 -23
- package/dist/server/node_modules/css-to-react-native/src/__tests__/border.js +0 -85
- package/dist/server/node_modules/css-to-react-native/src/__tests__/borderColor.js +0 -37
- package/dist/server/node_modules/css-to-react-native/src/__tests__/boxModel.js +0 -136
- package/dist/server/node_modules/css-to-react-native/src/__tests__/boxShadow.js +0 -83
- package/dist/server/node_modules/css-to-react-native/src/__tests__/colors.js +0 -31
- package/dist/server/node_modules/css-to-react-native/src/__tests__/flex.js +0 -122
- package/dist/server/node_modules/css-to-react-native/src/__tests__/flexFlow.js +0 -22
- package/dist/server/node_modules/css-to-react-native/src/__tests__/font.js +0 -117
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontFamily.js +0 -43
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontVariant.js +0 -15
- package/dist/server/node_modules/css-to-react-native/src/__tests__/fontWeight.js +0 -8
- package/dist/server/node_modules/css-to-react-native/src/__tests__/index.js +0 -204
- package/dist/server/node_modules/css-to-react-native/src/__tests__/placeContent.js +0 -19
- package/dist/server/node_modules/css-to-react-native/src/__tests__/shadowOffsets.js +0 -13
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecoration.js +0 -103
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecorationLine.js +0 -23
- package/dist/server/node_modules/css-to-react-native/src/__tests__/textShadow.js +0 -30
- package/dist/server/node_modules/css-to-react-native/src/__tests__/transform.js +0 -55
- package/dist/server/node_modules/css-to-react-native/src/__tests__/units.js +0 -132
- package/dist/server/node_modules/css-to-react-native/src/devPropertiesWithoutUnitsRegExp.js +0 -19
- package/dist/server/node_modules/css-to-react-native/src/index.js +0 -90
- package/dist/server/node_modules/css-to-react-native/src/tokenTypes.js +0 -75
- package/dist/server/node_modules/css-to-react-native/src/transforms/aspectRatio.js +0 -12
- package/dist/server/node_modules/css-to-react-native/src/transforms/border.js +0 -53
- package/dist/server/node_modules/css-to-react-native/src/transforms/boxShadow.js +0 -11
- package/dist/server/node_modules/css-to-react-native/src/transforms/flex.js +0 -65
- package/dist/server/node_modules/css-to-react-native/src/transforms/flexFlow.js +0 -37
- package/dist/server/node_modules/css-to-react-native/src/transforms/font.js +0 -63
- package/dist/server/node_modules/css-to-react-native/src/transforms/fontFamily.js +0 -20
- package/dist/server/node_modules/css-to-react-native/src/transforms/fontVariant.js +0 -14
- package/dist/server/node_modules/css-to-react-native/src/transforms/index.js +0 -77
- package/dist/server/node_modules/css-to-react-native/src/transforms/placeContent.js +0 -24
- package/dist/server/node_modules/css-to-react-native/src/transforms/textDecoration.js +0 -53
- package/dist/server/node_modules/css-to-react-native/src/transforms/textDecorationLine.js +0 -18
- package/dist/server/node_modules/css-to-react-native/src/transforms/textShadow.js +0 -10
- package/dist/server/node_modules/css-to-react-native/src/transforms/transform.js +0 -74
- package/dist/server/node_modules/css-to-react-native/src/transforms/util.js +0 -99
- package/dist/server/node_modules/hex-rgb/index.js +0 -47
- package/dist/server/node_modules/hex-rgb/license +0 -9
- package/dist/server/node_modules/hex-rgb/package.json +0 -39
- package/dist/server/node_modules/hex-rgb/readme.md +0 -86
- package/dist/server/node_modules/linebreak/LICENSE +0 -21
- package/dist/server/node_modules/linebreak/dist/main.cjs +0 -1369
- package/dist/server/node_modules/linebreak/dist/module.mjs +0 -1368
- package/dist/server/node_modules/linebreak/package.json +0 -57
- package/dist/server/node_modules/linebreak/readme.md +0 -62
- package/dist/server/node_modules/parse-css-color/CHANGELOG.md +0 -54
- package/dist/server/node_modules/parse-css-color/LICENSE +0 -21
- package/dist/server/node_modules/parse-css-color/README.md +0 -110
- package/dist/server/node_modules/parse-css-color/dist/index.cjs.js +0 -171
- package/dist/server/node_modules/parse-css-color/dist/index.esm.js +0 -167
- package/dist/server/node_modules/parse-css-color/dist/index.umd.js +0 -7
- package/dist/server/node_modules/parse-css-color/package.json +0 -55
- package/dist/server/node_modules/postcss-value-parser/LICENSE +0 -22
- package/dist/server/node_modules/postcss-value-parser/README.md +0 -263
- package/dist/server/node_modules/postcss-value-parser/lib/index.js +0 -28
- package/dist/server/node_modules/postcss-value-parser/lib/parse.js +0 -321
- package/dist/server/node_modules/postcss-value-parser/lib/stringify.js +0 -48
- package/dist/server/node_modules/postcss-value-parser/lib/unit.js +0 -120
- package/dist/server/node_modules/postcss-value-parser/lib/walk.js +0 -22
- package/dist/server/node_modules/postcss-value-parser/package.json +0 -58
- package/dist/server/node_modules/satori/LICENSE +0 -373
- package/dist/server/node_modules/satori/README.md +0 -516
- package/dist/server/node_modules/satori/dist/index.cjs +0 -8
- package/dist/server/node_modules/satori/dist/index.cjs.LEGAL.txt +0 -4
- package/dist/server/node_modules/satori/dist/index.js +0 -8
- package/dist/server/node_modules/satori/dist/index.js.LEGAL.txt +0 -4
- package/dist/server/node_modules/satori/dist/jsx/index.cjs +0 -2
- package/dist/server/node_modules/satori/dist/jsx/index.cjs.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/jsx/index.js +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.js.LEGAL.txt +0 -0
- package/dist/server/node_modules/satori/dist/standalone.cjs +0 -8
- package/dist/server/node_modules/satori/dist/standalone.cjs.LEGAL.txt +0 -4
- package/dist/server/node_modules/satori/dist/standalone.js +0 -8
- package/dist/server/node_modules/satori/dist/standalone.js.LEGAL.txt +0 -4
- package/dist/server/node_modules/satori/package.json +0 -149
- package/dist/server/node_modules/satori/yoga.wasm +0 -0
- package/dist/server/node_modules/tiny-inflate/LICENSE +0 -21
- package/dist/server/node_modules/tiny-inflate/index.js +0 -375
- package/dist/server/node_modules/tiny-inflate/package.json +0 -28
- package/dist/server/node_modules/tiny-inflate/readme.md +0 -31
- package/dist/server/node_modules/tiny-inflate/test/index.js +0 -75
- package/dist/server/node_modules/tiny-inflate/test/lorem.txt +0 -199
- package/dist/server/node_modules/unicode-trie/LICENSE +0 -8
- package/dist/server/node_modules/unicode-trie/README.md +0 -77
- package/dist/server/node_modules/unicode-trie/builder.js +0 -966
- package/dist/server/node_modules/unicode-trie/index.js +0 -136
- package/dist/server/node_modules/unicode-trie/package.json +0 -27
- package/dist/server/node_modules/unicode-trie/swap.js +0 -25
- package/dist/server/node_modules/unicode-trie/test/mocha.opts +0 -1
- package/dist/server/node_modules/unicode-trie/test/test.js +0 -243
|
@@ -1,1156 +0,0 @@
|
|
|
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 };
|