-
-
Notifications
You must be signed in to change notification settings - Fork 46
feat: Bitmapfont add cachebuster & compress #116
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 8 out of 11 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- packages/assetpack/package.json: Language not supported
- packages/assetpack/test/resources/font/custom.json: Language not supported
- packages/docs/docs/guide/pipes/webfont.mdx: Language not supported
Comments suppressed due to low confidence (4)
packages/assetpack/test/webfont/SDFCustomConfig.test.ts:87
- [nitpick] The test could be more comprehensive by adding more edge cases to ensure robustness.
checkChars(json.font.chars.char, 'abcABC');
packages/assetpack/src/webfont/sdf.ts:215
- [nitpick] The function name 'createName' is ambiguous. It should be renamed to 'generateScaledName' for better clarity.
export function createName(
packages/assetpack/src/webfont/sdf.ts:203
- The 'resolve' call is nested inside the 'generateBMFont' callback. If 'generateBMFont' throws an error synchronously, it will not be caught by the 'reject' call. Consider adding a try-catch block around 'generateBMFont' to handle synchronous errors.
resolve({ textures, font });
packages/assetpack/src/webfont/sdf.ts:215
- The new behavior introduced by 'createName' and 'mergeCharset' functions should be covered by tests to ensure they work as expected.
export function createName(
|
||
const json: jsonType = JSON.parse(fntJsonStr); | ||
const extname = path.extname(asset.filename); | ||
|
Copilot
AI
Feb 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function transform uses formats.map to create new assets but does not handle the case where formats might be empty. Add a check to ensure formats is not empty before proceeding.
if (formats.length === 0) { | |
return []; | |
} |
Copilot uses AI. Check for mistakes.
BitmapFont (sdf/msdf)
cachebuster
compress
mipmap
split
replace the file of all pages in fnt

BMFont file
support .xml | .fnt

mipmap is not supported
custom config
The font.charset in the JSON will be merged with the global font.charset, while other fields will be replaced by the JSON.
.json :

pipes :

output (fnt):

output (image):
