FontAwesome - Failed to decode downloaded font
Similar to the maven-war-plugin
usage, if you are using maven-resources-plugin
you need to specify that font files extensions shouldn't be filtered :
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
Got the solution from this SO answer.
I had the same problem, and finally managed to solve it. It may help someone.
I have quite a large .htacces file, with a lot of RewriteCond
's and RewriteRule
's, and also used the following line to filter some folders from those conditions:
RewriteRule ^(css|functions|js|media|tpl|vendor)($|/) - [L]
Upon adding the fonts folder (simply called fonts, and located in public_html/), the problem was solved.
RewriteRule ^(css|fonts|functions|js|media|tpl|vendor)($|/) - [L]
Note that this line should be fairly at the top of your .htaccess file to work.
I'm just answering this for later viewers. If you are working with a maven-war-plugin make sure you exclude the .woff
and .ttf
files in the filtering or maven will make the files corrupt.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<webResources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<targetPath />
<filtering>true</filtering>
<excludes>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/*.ttf</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
The problem isn't with your HTML or CSS code... It must be with the font files or the server,
because normal font files should contain codes and can be downloaded when opened in browser like this : https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0
While your files looks empty without any code even when downloaded: http://devcomlink.kunena.dev-monkeys.com/components/com_kunena/template/devcomlink/fonts/font-awesome/fontawesome-webfont.eot?v=4.3.0
Try to replace the files ...