Custom Fonts in HTML Compiler app


Bryce Beattie

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?


DecSoft

Hello Bryce,

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.



Bryce Beattie
Thanks, I used the svg js version and fontawesome is working now.

Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.