英文:
Is it not possible to use an icon path with the '@' sign in the manifest.json defined under 'fonts'?
问题
这是源代码的一部分,Manifest.json文件以及我的项目编译输出的一部分。
// 源代码
@asset(iconfont/*)
// Manifest.json
{
"info": {
...
},
"provides": {
...
"webfonts": [
{
"name": "FontAwesome6Regular",
"defaultSize": 16,
"comparisonString": "\\u30\\u31",
"mapping": "iconfont/fontawesome6/fa-regular.map",
"resources": [
"iconfont/fontawesome6/fa-regular-400.woff2"
]
}
]
},
...
"$schema": "https://qooxdoo.org/schema/Manifest-1-0-0.json"
}
// 输出
Manifest使用了不推荐的provides.webfonts,考虑切换到provides.font
生成应用程序...
正在编写应用程序certiplanner
在应用程序testtapper中需要的webfont FontAwesome6Brands的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-brands-400.woff2
在应用程序testtapper中需要的webfont FontAwesome6Regular的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-regular-400.woff2
在应用程序testtapper中需要的webfont FontAwesome6Solid的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-solid-900.woff2
在应用程序testtapper中需要的webfont FontAwesome6Duotone的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-duotone-900.woff2
在应用程序testtapper中需要的webfont FontAwesome6Light的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-light-300.woff2
在应用程序testtapper中需要的webfont FontAwesome6Thin的资源不可用,请考虑使用@asset来包含iconfont/fontawesome6/fa-thin-100.woff2
正在编写应用程序testtapper
正在编写应用程序iconbrowser
应用程序已生成
* 终端将被任务重用,按任意键关闭它。
我从provides.webfonts更改为provides.fonts,因为在qx 7.6中更推荐使用provides.fonts。我确认它正常工作。
// 源代码
@asset(iconfont/*)
@usefont(FontAwesome6Regular)
// Manifest.json
"fonts": {
"FontAwesome6Regular": {
"family": [
"FontAwesome6Regular"
],
"defaultSize": 16,
"comparisonString": "\\u30\\u31",
"mapping": "iconfont/fontawesome6/fa-regular.map",
"fontFaces": [
{
"fontFamily": "FontAwesome6Regular",
"paths": [
"iconfont/fontawesome6/fa-regular-400.woff2"
]
}
]
}
}
但是,我需要更改图标路径,如下所示。
-- this.__loginBtn = new qx.ui.form.Button("Login", "@FontAwesome6Regular/lock-open/16");
++ this.__loginBtn = new qx.ui.form.Button("Login", "FontAwesome6Regular/lock-open/16");
我尝试将字体的ID从FontAwesome6Regular更改为@FontAwesome6Regular(并相应更新usefont声明),但没有成功。我不想更改数百个图标路径。
有人知道如何解决这个问题吗?
英文:
It is a part of source code, Manifest.json and outpuf of compile of my project.
// source code
@asset(iconfont/*)
// Manifest.json
{
"info": {
...
},
"provides": {
...
"webfonts": [
{
"name": "FontAwesome6Regular",
"defaultSize": 16,
"comparisonString": "\\u30\\u31",
"mapping": "iconfont/fontawesome6/fa-regular.map",
"resources": [
"iconfont/fontawesome6/fa-regular-400.woff2"
]
}
]
},
...
"$schema": "https://qooxdoo.org/schema/Manifest-1-0-0.json"
}
// output
Manifest uses deprecated provides.webfonts, consider switching to provides.font
Making applications...
Writing application certiplanner
Assets required for webfont FontAwesome6Brands are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-brands-400.woff2
Assets required for webfont FontAwesome6Regular are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-regular-400.woff2
Assets required for webfont FontAwesome6Solid are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-solid-900.woff2
Assets required for webfont FontAwesome6Duotone are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-duotone-900.woff2
Assets required for webfont FontAwesome6Light are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-light-300.woff2
Assets required for webfont FontAwesome6Thin are not available in application testtapper, consider using @asset to include iconfont/fontawesome6/fa-thin-100.woff2
Writing application testtapper
Writing application iconbrowser
Applications are made
* Terminal will be reused by tasks, press any key to close it.
I changed from provides.webfonts to provides.fonts because provides.fonts is preferred in qx 7.6.
I checked it works well.
// source code
@asset(iconfont/*)
@usefont(FontAwesome6Regular)
// Manifest.json
"fonts": {
"FontAwesome6Regular": {
"family": [
"FontAwesome6Regular"
],
"defaultSize": 16,
"comparisonString": "\\u30\\u31",
"mapping": "iconfont/fontawesome6/fa-regular.map",
"fontFaces": [
{
"fontFamily": "FontAwesome6Regular",
"paths": [
"iconfont/fontawesome6/fa-regular-400.woff2"
]
}
]
}
}
But I need to change icon path like below.
-- this.__loginBtn = new qx.ui.form.Button("Login", "@FontAwesome6Regular/lock-open/16");
++ this.__loginBtn = new qx.ui.form.Button("Login", "FontAwesome6Regular/lock-open/16");
I tried changing the font's ID from FontAwesome6Regular to @FontAwesome6Regular (and also updated the 'usefont' declaration accordingly),
but it didn't work.
I don't want to change hundreds of icon paths.
Does anyone know a solution to this issue?
答案1
得分: 1
请创建一个可重现的测试案例并提交错误报告。
英文:
There should be absolutely no difference - you have to use the ‘@‘ sign, whether you use ‘fonts’ or ‘webfonts’ in Manifest.json
Please create a reproducible test case and file a bug report
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论