Page 1 of 1

Automatically use @font-face

Posted: Mon Nov 11, 2019 5:51 pm
by crispy68
Hey Pablo,

Ran across an issue with setting @font-face as 'Automatically use @font-face for non web-safe fonts'. I do have generate external CSS and global styles enabled.

Very simple to reproduce:

1. Insert a text object and change it to a non web-safe font that is not a google font either.
2. Set the @font-face as above.
3. Preview

In my case, when I previewed it the font was changed to something else. The font did not show correctly. It only seemed to work when I set the text object to either 'Enable Responsive Fonts' or if the Output Format was set to 'Use <p> tags'. If Output format is only set to 'default' and you don't enable responsive fonts, it doesn't work correctly.

The html in either case is the same. Here is what that looks like:

Code: Select all

<div id="wb_Text1"><span id="wb_uid0">Some text here</span></div>
In looking at the code, the CSS is different in each case:

Default:

Code: Select all

#wb_Text1{position:absolute;left:215px;top:256px;width:399px;height:54px;text-align:center;z-index:0;}
#wb_uid0{color:#404040;font-family:Bauhaus 93;font-size:48px;}
With responsive fonts:

Code: Select all

#wb_Text1{color:#404040;font-family:"Bauhaus 93";font-weight:normal;font-size:48px;}
#wb_Text1{position:absolute;left:215px;top:256px;width:399px;height:54px;text-align:center;z-index:0;}
#wb_uid0{color:#404040;}
When it works, it appears the font code is applied to the text object ID rather than the ID of the <span> tag that is generated.

Re: Automatically use @font-face

Posted: Mon Nov 11, 2019 6:16 pm
by Pablo
I am not sure if this related to responsive fonts, I think it's related to the selected font.
As documented in the help, the option 'Automatically use @font-face' does not work with all fonts. In some cases the font name cannot be looked up in the registry to locate the font data. Or it cannot be converted to other formats, due to corrupt or missing header info.

Re: Automatically use @font-face

Posted: Mon Nov 11, 2019 6:20 pm
by crispy68
Hey pablo,

Everything else works. It creates the correct at font face code in the global stylesheet. It creates the truetype and woff font and places it in the root folder.

It was only the CSS code that I noticed that was different. Everything else was exactly the same

Re: Automatically use @font-face

Posted: Mon Nov 11, 2019 6:25 pm
by Pablo
In that case, I need a demo project, so I can see the exact settings.

Re: Automatically use @font-face

Posted: Mon Nov 11, 2019 7:31 pm
by crispy68
sent to you privately.

Re: Automatically use @font-face

Posted: Mon Nov 11, 2019 9:35 pm
by Pablo
The issue is related to the name of the font.
I will investigate if I can find a workaround for this.