backslide icon indicating copy to clipboard operation
backslide copied to clipboard

Exporting includes empty base64 content for fonts

Open matclab opened this issue 6 years ago • 6 comments

I'm using font awesome. bs serve works like a charm (thank for this nice tool), but when exporting, the font css in the final html lokks like:

@font-face{font-family:'Font Awesome 5 Brands';font-style:normal;font-weight:normal;src:url('data:application/vnd.ms-fontobject;base64,');src:url('data:application/vnd.ms-fontobject;base64,')

The font is empty.

matclab avatar Nov 06 '18 13:11 matclab

Something effectively does not seems right 😄

I remember that is used to work though as I did the same thing and using Font Awesome 5 in my slides were not an issue at export.

https://github.com/remy/inliner is used to perform the inlining, either an update have broken it or latest PR merged here have broken it, I'll have a look.

In the meanwhile can you try with the feature/refactor branch to see if the issue is still present? See https://github.com/sinedied/backslide/issues/43#issuecomment-433311866 for how to install and use it.

sinedied avatar Nov 06 '18 14:11 sinedied

Before trying the feature/refactor branch, I tried with the docker to try reproducing the problem in a controlled environment, but docker run --rm -v $(pwd):/src taobeier/backslide export gives:

mime.getType(...) is not a function
mime.getType(...) is not a function
mime.getType(...) is not a function
mime.getType(...) is not a function
mime.getType(...) is not a function
mime.getType(...) is not a function
mime.getType(...) is not a function

Whereas serving via the docker worked well.

Images ans fonts are not included in the resulting html.

matclab avatar Nov 06 '18 15:11 matclab

feature/refactor branch neither produces an html file with the font embeded (the font awesome css doesn't seem to be included whereas it was in the master version).

matclab avatar Nov 06 '18 17:11 matclab

For info, having installed inliner 1.13.1 and doing:

bs export -l
inliner -n -m dist/201809-sécurité.html > res.html

worked well. Not using the -n (no compression) produces an invalid HTML.

matclab avatar Nov 08 '18 16:11 matclab

Sorry for the delay and thanks for the feedback, I will take a look. If it works with inliner directly it's good news, maybe it's just a matter of updating the version in backslide.

sinedied avatar Nov 14 '18 18:11 sinedied

Yes indeed, but note that it didn't work directly with inliner without the -n switch (no compression).

matclab avatar Nov 15 '18 07:11 matclab