[Solved] Browser Error: Failed to decode downloaded font and OTS parsing error: Failed to convert *** font to ***

Last night, when I was doing something I was interested in, I found that the browser alarm failed to decode downloaded font and OTS parsing error: failed to convert * * * font to * * *.

However, I have never encountered this problem. After looking for the answer on the Internet for a while, I found a similar question. Some netizens guessed that the interceptor failed, so I checked Shiro’s interception configuration:

<property name="filterChainDefinitions">
                /assets/** = anon
                /css/** = anon
                /**= user

But this configuration is theoretically OK, so it’s not this problem.

After consulting some materials today, we found the possible reasons:

When Maven’s filter parses the font file, it destroys the binary file format of the font file, resulting in browser parsing errors.

The solution is: the font file does not need a filter, so we need to set it in the configuration (springboot is written in pom.xml):

            <!-- fonts file cannot use filter as the data structure of byte file will be changed via filter -->

After the configuration shown above, Maven does not parse the font file when compiling the project, the browser will not give an alarm, and the font can be displayed normally.

Similar Posts: