NutzCN Logo
问答 NB,MVC下加载字体文件出现异常
发布于 1948天前 作者 shuxinyun 2456 次浏览 复制 上一个帖子 下一个帖子
标签:

我在页面中引用了字体文件,跑起来后出现如下错误:

[DEBUG] 23:42:59.189 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:114) - load properties from File[C:\working\shuxin.epei\im\target\classes\application.properties]
[DEBUG] 23:43:00.052 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/layui/font/iconfont : NOT Action match
[DEBUG] 23:43:00.105 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/css/fonts/fa-solid-900 : NOT Action match
[DEBUG] 23:43:00.158 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/layui/font/iconfont : NOT Action match
[DEBUG] 23:43:00.450 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/css/fonts/fa-solid-900 : NOT Action match
[DEBUG] 23:43:00.557 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/css/fonts/fa-solid-900 : NOT Action match

控制平台出现

doc:1 Failed to decode downloaded font: http://127.0.0.1:8181/layui/font/iconfont.woff?v=240
doc:1 OTS parsing error: incorrect file size in WOFF header
doc:1 Failed to decode downloaded font: http://127.0.0.1:8181/layui/font/iconfont.ttf?v=240
doc:1 OTS parsing error: incorrect entrySelector for table directory
doc:1 Failed to decode downloaded font: http://127.0.0.1:8181/css/fonts/fa-solid-900.woff2
doc:1 OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
doc:1 Failed to decode downloaded font: http://127.0.0.1:8181/css/fonts/fa-solid-900.woff
doc:1 OTS parsing error: incorrect file size in WOFF header
doc:1 Failed to decode downloaded font: http://127.0.0.1:8181/css/fonts/fa-solid-900.ttf
doc:1 OTS parsing error: incorrect entrySelector for table directory

针对NB不清楚应该如何配置,请指教下

8 回复

页面其他功能都正常,就是字体没有加载

所有字体文件都在resources/static目录下,beetl根目录在resources/views目录下

配置如下后:

<resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>**/*.woff</exclude>
                    <exclude>**/*.woff2</exclude>
                    <exclude>**/*.ttf</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*.woff</include>
                    <include>**/*.woff2</include>
                    <include>**/*.ttf</include>
                </includes>
            </resource>
        </resources>

浏览器不报错了,但是路由还是有警告

[DEBUG] 00:05:10.449 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:114) - load properties from File[C:\working\shuxin.epei\im\target\classes\application.properties] [DEBUG] 00:05:11.282 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/layui/font/iconfont : NOT Action match
[DEBUG] 00:05:11.324 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [GET] path=/css/fonts/fa-solid-900 : NOT Action match
[DEBUG] 00:05:29.084 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:291) - batch acquisition of 0 triggers

字体文件显示有一点点不正常

需要用到resource filtering??

用了后图标可以显示了,但是还是报错,如果不用错误如上呀

需要用到resource filtering??

呵呵,今天怎么突然就好了!郁闷死了!

估计又是没有install的缘故!

添加回复
请先登陆
回到顶部