Skip to content

Commit

Permalink
chore: opt font type
Browse files Browse the repository at this point in the history
  • Loading branch information
lslzl3000 committed Aug 13, 2024
1 parent 579aab8 commit a38371a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/geometry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export * from "./ExtrudeGeometry/Path2D"
export * from "./ExtrudeGeometry/Shape2D"
export * from "./ExtrudeGeometry/ShapeUtils"
export * from "./parser/FontParser"
export * from "./TextGeometry"
export * from "./lib/opentype"
export * from "./TextGeometry"
3 changes: 2 additions & 1 deletion packages/geometry/parser/FontParser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ParserBase } from "@orillusion/core";
import { parse } from "../lib/opentype";
import { parse, Font } from "../lib/opentype";

export class FontParser extends ParserBase {
declare public data: Font;
public async parseBuffer(buffer: ArrayBuffer) {
const font = parse(buffer);
this.data = font;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/Res.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class Res {
public async load<T extends ParserBase>(url: string, c: Parser<T>, loaderFunctions?: LoaderFunctions) {
let loader = new FileLoader();
let parser = await loader.load(url, c, loaderFunctions);
let ret = parser.data;
let ret = parser.data as T["data"];
return ret;
}

Expand Down

0 comments on commit a38371a

Please sign in to comment.