Feat/embedded fonts (#2174)

* #239 Embedded fonts

* Add boilerplate for font table

* Fix linting

* Fix linting

* Fix odttf naming

* Correct writing of fonts to relationships and font table

new uuid function

* Add font to run

* Add demo

Fix tests

* Add character set support

* Add tests

* Write tests
This commit is contained in:
Dolan
2023-12-30 02:23:54 +00:00
committed by GitHub
parent fa401297da
commit 010ef05ce3
28 changed files with 794 additions and 30 deletions

View File

@ -1,4 +1,4 @@
import { nanoid } from "nanoid/non-secure";
import { nanoid, customAlphabet } from "nanoid/non-secure";
// Twip - twentieths of a point
export const convertMillimetersToTwip = (millimeters: number): number => Math.floor((millimeters / 25.4) * 72 * 20);
@ -23,3 +23,7 @@ export const docPropertiesUniqueNumericIdGen = (): UniqueNumericIdCreator => uni
export const bookmarkUniqueNumericIdGen = (): UniqueNumericIdCreator => uniqueNumericIdCreator();
export const uniqueId = (): string => nanoid().toLowerCase();
const generateUuidPart = (count: number): string => customAlphabet("1234567890abcdef", count)();
export const uniqueUuid = (): string =>
`${generateUuidPart(8)}-${generateUuidPart(4)}-${generateUuidPart(4)}-${generateUuidPart(4)}-${generateUuidPart(12)}`;