* #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
34 lines
796 B
TypeScript
34 lines
796 B
TypeScript
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}`,
|
|
},
|
|
});
|