Android custom fonts in web scroller native control...

Paul Maguire me at paulmaguire.me
Fri May 31 06:27:48 EDT 2013


Hi all.

I'm hoping someone can point me in the right direction. I've posted this (and other Android-related issues) to the Android forum, but no replies and I can't seem to resolve it or find out any more info.

I am porting an iOS app to Android. I have many issues (of course). The first of these is the use of custom fonts in HTML used in a web scroller native control. I have successfully embedded the font in the app - it is .ttf - and it displays properly when used in the Livecode UI I have set up. Only in the web scroller does it fail.

Of course it works fine in iOS (sigh). I have tried the following in the styles in the HTML:

@font-face 
{
  font-family: "GROBOLD";
  src: url('fonts/GROBOLD.ttf');
}

... but fails too. It seems I have a pathname issue with Android. I'm using specialFolderPath("engine") eg.:

put (specialFolderPath("engine") & slash & "Media/footer.png") into tImageURL
put "<p><img src = "&QUOTE& tImageURL&QUOTE&" width = "&QUOTE&"50"&QUOTE&"></p>" into tS

... but this fails to display too, so the pathname is wrong. I don't understand! I notice from the Android .apk file structure that all my assets (including fonts) are contained in a folder called 'assets' - which doesn't exist in the iOS .app file, but adding this to the URL fails too.

Can anyone elucidate?

Kind regards,		Paul.



More information about the use-livecode mailing list