[HTML5 - Lime 6 - Openfl 7] Could not generate web font


#1

Hi,
since I updated my dev environment I am receiving this warning at compile time

Warning: Could not generate *.eot web font for "../AAA.ttf"
Warning: Could not generate *.woff web font for "../AAA.ttf"
Warning: Could not generate *.svg web font for "../AAA.ttf"
Warning: Could not generate *.eot web font for "../BBB.ttf"
Warning: Could not generate *.woff web font for "../BBB.ttf"
Warning: Could not generate *.svg web font for "../BBB.ttf"
Warning: Could not generate *.eot web font for "../CCC.ttf"
Warning: Could not generate *.woff web font for "../CCC.ttf"
Warning: Could not generate *.svg web font for "../CCC.ttf"

In that directory the fonts are AAA.ttf, BBB.ttf and CCC.ttf.
This happens both when .svg, .woff and .eot versions already exist or not.
If the folder contains ttf only the other formats are not generated, but the app runs fine anyway in Chrome.

My app runs fine, the texts are ok, but I’d like to understand what the problem is and get rid of these warnings.


#2

It was a problem with me too , i often get these warning but don’t exactly know the reason some times i don’t get them some times they appear , may be something with font type.

I always use -final and -clean .

image


#3

The first time we run, we try to convert the TTF to WOFF, SVG and EOT for use on HTML5. If it fails, we print a warning. After the first time, we do not warn anymore.

Doing a -clean build forces the tools to process the TTF file again, in case the failure was due to something silly :slight_smile:

Not all fonts convert properly, and the tool we use is no longer in active development. Not sure if there’s a better command-line font converter that’s cross-platform and doesn’t require FontForge or some other big dependency


#4

I use an online service to convert my fonts from ttf.
I always use -clean: how do I inhibit the compiler from trying to convert the fonts?


#5

If you do not include them with your assets, it will not try to process them :wink:


#6

Ahah… are you k… uhm… and how would I embed them?


#7

The unoffical way to hack this would be to copy your generated webfonts into the “obj/fonts” folder where we put our temporary generated font files. These would be destroyed if you do a -clean build, however.

The only official way to do it would be to override your “index.html” template, and to manually add your Webfont CSS yourself. Anything else you need can be placed in your own “template” folder, and it should be copied as well

Like this:

<template path="templates" />

and create a folder called “templates/html5/template”. Anything you place in that folder will be copied to the final output directory. If you add an “index.html” file, it will override the default one we pull from the OpenFL “assets/templates/html5/template” directory


#8

Uh, ok! I will try this way, thank you Josh!