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

@ -17,6 +17,7 @@ import { Styles } from "./styles";
import { ExternalStylesFactory } from "./styles/external-styles-factory";
import { DefaultStylesFactory } from "./styles/factory";
import { FileChild } from "./file-child";
import { FontWrapper } from "./fonts/font-wrapper";
export interface ISectionOptions {
readonly headers?: {
@ -53,6 +54,7 @@ export class File {
private readonly appProperties: AppProperties;
private readonly styles: Styles;
private readonly comments: Comments;
private readonly fontWrapper: FontWrapper;
public constructor(options: IPropertiesOptions) {
this.coreProperties = new CoreProperties({
@ -109,6 +111,8 @@ export class File {
this.footnotesWrapper.View.createFootNote(parseFloat(key), options.footnotes[key].children);
}
}
this.fontWrapper = new FontWrapper(options.fonts ?? []);
}
private addSection({ headers = {}, footers = {}, children, properties }: ISectionOptions): void {
@ -292,4 +296,8 @@ export class File {
public get Comments(): Comments {
return this.comments;
}
public get FontTable(): FontWrapper {
return this.fontWrapper;
}
}