Custom fonts broken for html5 since latest openfl / lime update

Application stuck on preloader with following error message:

"Assets.hx:426: [Assets] There is no asset with an ID of "Intro  Regular""

It is because of

urls = [for (url in urls) Assets.getPath(url)];

in templates/haxe/ApplicationMain.hx. It returns null when asset no found, but html5 preloader expect font name, not null.

It was added in this commit:

Also I found similar line in lime templates.


I’m not creating issue in openfl or lime repo, because it is complex problem, related to application templates, resource generation and htm5 preloader.


P.S. For now I just comment out this line.

1 Like

Hi,

i’m having the same problem, it worked flawless with lime 2.0.3 and openfl 2.1.8.

Regards.

Thanks guys, this is fixed now, sorry for missing this, I’ll release a minor release today probably

Just a note about

I’m not investigate this deeply, but probably check for type == font is missing, so shouldn’t it be something like

for (i in 0...urls.length) {
    if (types[i] != AssetType.FONT) { // check added
        urls[i] = config.assetsPrefix + urls[i];
    }
}

Yep, you’re right – my fix broke once I added a “./” prefix. Forgot that fonts used the font name, not a path, but makes sense due to web fonts. Fixed right now, thank you :success:

Released, thank you! :slight_smile:

1 Like