I'm trying to use fontawesome and one other custom font in an app I'm building in HTML Compiler. If I use the fontawesome's cdn link
link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous"
things work fine when I test in all browsers and in the HTML Compiler preview, but I'd rather embed the font in a local manner, like:
link rel="stylesheet" href="./css/all.css"
This second link works in all browsers I can test, but not when I use the HTML Compiler preview. Any idea what's going on, or if it is possible to get it to work somehow?
Certain protocol used by HTML Compiler (which, on the other hand, allows the program to work with non extracted files) don't allows to use local resources like custom fonts, in this case.
We have two possibilities here:
- Use a remote URL for the CSS and fonts: the provided CDN URL, or your own app's server URL.
- Use the Font Awesome SVG flavor, which works like a charm also in HTML Compiler apps.
In my opinion the second possibility can be better, since the resources remain locals, that is, the SVG JS file is compiled and used without problems by HTML Compiler without extract it to the user's computer. However, the second possibility can be also take in consideration.
Thanks, I used the svg js version and fontawesome is working now.
Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.