Android Question Lollipop and Custom Fonts issue/crash

Discussion in 'Android Questions' started by ptp170, Feb 9, 2015.

  1. ptp170

    ptp170 Member Licensed User

    I've just spend an age tearing down my Play Store quiz games trying to figure out why they crash on Lollipop. No debug information was sent to the debugger so I ended up tearing the game apart until it worked.

    The issue appears to be the use of custom fonts.. The font I used was fine on every platform from Kitkat backwards.

    Lollipop seems to have a huge issue with this line..

    Dim fontMenuButtons As Typeface = Typeface.LoadFromAssets("font.ttf")
    If I remove the custom fonts from the game then it works perfectly but obviously only using the default system font.

    If I try other custom fonts some crash the game and some don't. The ones that don't crash simply aren't acknowledged and the default font is substituted.

    I have found this thread about the issue but it doesn't seem to have a proper solution.

    Does anyone have a way around this? There are hints in the above thread but I am struggling to make then work on my end..


    B4a v4.00
    Core v4.01
    Phone v2.26
    Last edited: Feb 10, 2015
  2. NJDude

    NJDude Expert Licensed User

    I have apps using custom fonts, no problems on Lollipop.

    What's the error? have you checked the logs?
  3. Peter Simpson

    Peter Simpson Expert Licensed User

    Hmm that's interesting. My Star Trek weather app uses multiple custom fonts and I too have no issues with Lollipop. I've done nothing to upgrade the app, it just worked on Android 5.x first time out.
  4. ptp170

    ptp170 Member Licensed User

    There are no errors reported as it crashes before the debugger has chance to connect.
    Even when I picked a custom font that allows the program to run nothing is reported back either on the filtered/unfiltered logs.

    Just as a side issue, I always used to get loads of data when logging in unfiltered mode... This doesn't happen anymore anymore for some reason...

    I've tried my games in the emulator as well using API21 and they mimic what my phone does also.

    Forgot to mention that I'm compiling using the Android.jar API 21. And that I've added the holo theme and minSDK11 to the manifest editor as recommended by Erel for Lollipop.

  5. Erel

    Erel Administrator Staff Member Licensed User

    Can you upload a small project that demonstrates this issue?
  6. ptp170

    ptp170 Member Licensed User

    Included three fonts with the project file. Uncomment each line accordingly to see behavior in lollipop...

    Attached Files:

  7. Erel

    Erel Administrator Staff Member Licensed User

    Peter Simpson and Cableguy like this.
  8. ptp170

    ptp170 Member Licensed User

    32 bit integer limit?

    I haven't got the first clue on how to compile OTS or FontTools for Windows even though I've given it a superficial try. :(
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice