Trouble getting the Android Version of my game to use a custom font

● ARCHIVED · READ-ONLY
Started by Blackheart 6 posts View original ↗
  1. So I have been testing out Android exporting trough Intel XDK and I export it fine for the most part, (few graphical glitches since I'm using Yanfly Engine) but my main issue is that I have a custom font that works fine on PC, it even works fine on the Intel XDK Android Emulator but when I put it into an apk file and try to run the app on my phone my custom font does not work and it defaults to the typical GameFont you get normally,

    I have set the custom font using YEP Core Engine and have placed the TrueType font file of my font in the fonts folder in my www folder for my Intel SDK project folder and changed the Gamefont file to to say this
     

    @font-face {
        font-family: GameFont;
        src: url("ice_pixel-7.ttf");
    }
    of which the ice_pixel-7.ttf is my font's filename which to the best of my knowledge seems to be the way to include my font with my game along with putting the file in that folder, but it just doesn't seem to work on my phone, does anyone have any clue what I seem to be missing?
  2. Out of curiosity, what happens when you put a copy of the font next to the index folder or include a font/PATH in the source? Is it just me or its looks like that's not looking at the fonts folder.

    I'm not 100%.

    It's also possible that that font is not compatible on mobile devices. I ran into to that issue a lot on construct 2, even if the included font was in my system.

    I'm in the process of making a video for compiling your apk the manual method that should be releasing soon. If you don't get a concrete awnser by then, maybe try it the other way
  3. Blackheart said:
    So I have been testing out Android exporting trough Intel XDK and I export it fine for the most part, (few graphical glitches since I'm using Yanfly Engine) but my main issue is that I have a custom font that works fine on PC, it even works fine on the Intel XDK Android Emulator but when I put it into an apk file and try to run the app on my phone my custom font does not work and it defaults to the typical GameFont you get normally,

    I have set the custom font using YEP Core Engine and have placed the TrueType font file of my font in the fonts folder in my www folder for my Intel SDK project folder and changed the Gamefont file to to say this

    of which the ice_pixel-7.ttf is my font's filename which to the best of my knowledge seems to be the way to include my font with my game along with putting the file in that folder, but it just doesn't seem to work on my phone, does anyone have any clue what I seem to be missing?
    The problem is that you're calling it "GameFont" You need to put the name of the font there.

    /* @font-face kit by Fonts2u (http://www.fonts2u.com) */ @font-face {font-family:"Ice Pixel-7";src:url("ice_pixel-7.eot?") format("eot"),url("ice_pixel-7.woff") format("woff"),url("ice_pixel-7.ttf") format("truetype"),url("ice_pixel-7.svg#Ice_Pixel-7") format("svg");font-weight:normal;font-style:normal;}So if you look at the package shipped with it, you'll notice the font name is "Ice Pixel-7"
  4. While I'm at it... read the license.

    EULA-==-

    The font Ice Pixel-7 is freeware for home use only.
    FREEWARE USE (NOTES)-=================-

    Also you may:

    * Use the font in freeware software (credit needed);

    * Use the font for your education process.

    COMMERCIAL OR BUSINESS USE

    -========================-

    Please contact us ($24.95).

    You may:

    * Include the font to your installation;

    * Use one license up to 100 computers in your office.

    AUTHOR

    -====-

    Sizenko Alexander

    Style-7

    http://www.styleseven.com

    Created: December 13 2012
  5. @KisaiTenshi

    So do I just need to rename the font-family to Ice Pixel-7 or do I need the whole Style Sheet document to be named Ice Pixel-7 or both?

    And also yeah I know it says for home use only, its mainly a placeholder but I wanted it there for stylistic consistentcy and formatting purposes for the time being
  6. Blackheart said:
    @KisaiTenshi

    So do I just need to rename the font-family to Ice Pixel-7 or do I need the whole Style Sheet document to be named Ice Pixel-7 or both?

    And also yeah I know it says for home use only, its mainly a placeholder but I wanted it there for stylistic consistentcy and formatting purposes for the time being
    You can just put "Ice Pixel-7" on that line, eg:

    @font-face {font-family:"Ice Pixel-7";src:url("ice_pixel-7.ttf");}Like... in theory you could rename it to "GameFont" like you did earlier, but that would only replace the supplied game font, and wouldn't make it switchable. I guess I need the entire context of what you're trying to do. Like this is valid too:

    @font-face {font-family:"Ice Pixel-7";src:url("ice_pixel-7.ttf");}@font-face {font-family:"GameFont";src:url("mplus-1m-regular.ttf");}In YEP_CoreEngine, you need to add "Ice Pixel-7" before GameFont.

    eg

    Ice Pixel-7, GameFont, Verdana, Arial, Courier NewThen the game tries Ice Pixel-7, before it tries GameFont