Skip to content

Commit

Permalink
fix: font family including tags (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie authored Oct 22, 2024
1 parent f293a15 commit 6139bdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/assetpack/src/webfont/webfont.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkExt, createNewAssetAt, path } from '../core/index.js';
import { checkExt, createNewAssetAt, path, stripTags } from '../core/index.js';
import { fonts } from './fonts.js';

import type { Asset, AssetPipe } from '../core/index.js';
Expand Down Expand Up @@ -44,7 +44,7 @@ export function webfont(): AssetPipe<any, 'wf'>
newAsset.buffer = buffer;

// set the family name to the filename if it doesn't exist
asset.metaData.family ??= path.trimExt(asset.filename);
asset.metaData.family ??= stripTags(path.trimExt(asset.filename));

return [newAsset];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/assetpack/test/webfont/Webfont.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ describe('Webfont', () =>
files: [],
folders: [
{
name: 'defaultFolder{wf}',
name: 'defaultFolder',
files: [
{
name: 'ttf.ttf',
name: 'ttf{wf}.ttf',
content: assetPath('font/Roboto-Regular.ttf'),
},
],
Expand Down

0 comments on commit 6139bdd

Please sign in to comment.