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:
33
src/file/fonts/create-regular-font.ts
Normal file
33
src/file/fonts/create-regular-font.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { XmlComponent } from "@file/xml-components";
|
||||
|
||||
import { CharacterSet, createFont } from "./font";
|
||||
|
||||
export const createRegularFont = ({
|
||||
name,
|
||||
index,
|
||||
fontKey,
|
||||
characterSet,
|
||||
}: {
|
||||
readonly name: string;
|
||||
readonly index: number;
|
||||
readonly fontKey: string;
|
||||
readonly characterSet?: (typeof CharacterSet)[keyof typeof CharacterSet];
|
||||
}): XmlComponent =>
|
||||
createFont({
|
||||
name,
|
||||
sig: {
|
||||
usb0: "E0002AFF",
|
||||
usb1: "C000247B",
|
||||
usb2: "00000009",
|
||||
usb3: "00000000",
|
||||
csb0: "000001FF",
|
||||
csb1: "00000000",
|
||||
},
|
||||
charset: characterSet,
|
||||
family: "auto",
|
||||
pitch: "variable",
|
||||
embedRegular: {
|
||||
fontKey,
|
||||
id: `rId${index}`,
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user