Skip to content

Commit

Permalink
fix(ttf-generator): add correct format options from type
Browse files Browse the repository at this point in the history
  • Loading branch information
casaper committed Dec 22, 2020
1 parent f495d5d commit 7867af0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/generators/asset-types/ttf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const generator: FontGenerator<string> = {
dependsOn: FontAssetType.SVG,

async generate({ formatOptions }, svg) {
const font = svg2ttf(svg, formatOptions[FontAssetType.TTF]);
const font = svg2ttf(svg, formatOptions?.ttf);
return Buffer.from(font.buffer);
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/types/runner.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import svg2ttf from 'svg2ttf';
import { SvgIcons2FontOptions } from 'svgicons2svgfont';
import { CodepointsMap } from '../utils/codepoints';
import { FontAssetType, OtherAssetType, AssetType } from './misc';
Expand All @@ -18,7 +19,7 @@ export interface FormatOptions {
*/
metadata?: string;
};
ttf?: any;
ttf?: svg2ttf.FontOptions;
svg?: Pick<
SvgIcons2FontOptions,
| 'fontId'
Expand Down

0 comments on commit 7867af0

Please sign in to comment.