Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font store #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/api/make-pdf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FontLoader, FontStore } from '../font-loader.ts';
import { FontStore } from '../font-store.ts';
import { ImageLoader, ImageStore } from '../image-loader.ts';
import { layoutPages } from '../layout/layout.ts';
import { readDocumentDefinition } from '../read-document.ts';
Expand All @@ -14,9 +14,8 @@ import type { DocumentDefinition } from './document.ts';
*/
export async function makePdf(definition: DocumentDefinition): Promise<Uint8Array> {
const def = readAs(definition, 'definition', readDocumentDefinition);
const fontLoader = new FontLoader(def.fonts ?? []);
const fontStore = new FontStore(def.fonts ?? []);
const imageLoader = new ImageLoader(def.images ?? []);
const fontStore = new FontStore(fontLoader);
const imageStore = new ImageStore(imageLoader);
const guides = !!def.dev?.guides;
const ctx = { fontStore, imageStore, guides };
Expand Down
207 changes: 0 additions & 207 deletions src/font-loader.test.ts

This file was deleted.

125 changes: 0 additions & 125 deletions src/font-loader.ts

This file was deleted.

Loading
Loading