Hi,
Trying to get fonts working in JS. Now I should be able to edit the produced
HTML after it been generated to add fonts I need, but is there a way to link or
@import fonts by referring to it the MXML?
Just for giggles I tried the following:
<fx:Style>
@import url('https://fonts.googleapis.com/css?family= Roboto');
</fx:Style>
And I get a stack trace error like so Error: Internal error in ABC generator
subsystem, when generating code for:
/Users/justinmclean/IdeaProjects/FlexJSTest/src/FontFace.mxml:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
…
Not that I expected that to work.
I also tried:
<fx:Style>
@font-face {
src: url("https://fonts.googleapis.com/css?family=Roboto");
fontFamily: Roboto;
}
</fx:Style>
And got this rather strange error:
WARNING:
/Users/justinmclean/IdeaProjects/FlexJSTest/target/javascript/bin/js-debug/FontFace.js:39:
WARNING - attempted re-definition of type FontFace
found : function (new:FontFace): undefined
expected: function (new:FontFace, string,
(ArrayBuffer|ArrayBufferView|null|string), FontFaceDescriptors=): ?
FontFace = function() {
It seems you can’t call your main file FontFace.mxml.
Re-nameing it mean it can compile but the font fails to download with the error:
index.html:1 Failed to decode downloaded font:
https://fonts.googleapis.com/css?family=Roboto
index.html:1 OTS parsing error: invalid version tag
Anyone got JS font to work in a FlexJS application?
Thanks,
Justin