To participate, please log in to your Andromo App Maker account then come back here!

HTML archive: Css for fonts

edited February 2014 in General Discussion
I am making extensive use of html archive in my latest app.
In 3 html  archive activities I am using a css file which I link to all sub-pages. The css includes a google font which I want visible in all text pages.
Of course, the font itself is also inside the archive and I am calling it locally.
In browser all are OK, the font appears, in Andromo nothing.
Could you think of a possible reason for this and if it's something I can fix somehow?

Comments

  • Thanks @hendrixs!
    More or less it was what I had done. The only difference was my font was woff format (so I used a converter to turn it to ttf and changed the css). It worked on browser, didnt work inside Andromo still.
    So all in all, might be the particular font I chose but it has not worked yet for me.
    My css is:

    @font-face {
      font-family: 'Cagliostro';
      font-style: normal;
      font-weight: normal;
      src: local('Cagliostro'), local('Cagliostro'), url('font.ttf') format('truetype');
    }

    Any suggestions possibly?
  • edited February 2014
    This is what I have in my HTML file:

      <head>
        <meta content="text/html; charset=UTF-8" http-equiv="content-type">
        <meta name="viewport" content="width=device-width, user-scalable=no">
        <link href="http://fonts.googleapis.com/css?family=Average|Courgette" rel="stylesheet" type="text/css">
        <link rel="stylesheet" type="text/css" href="style.css">
      </head>

    And this is what I have in my CSS file:

    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: normal;
      src: local('Open Sans'), local('OpenSans'), url('Open_Sans/OpenSans-Regular.ttf') format('truetype');
    }

    @font-face {
      font-family: 'Oswald';
      font-style: normal;
      font-weight: normal;
      src: local('Oswald'), local('Oswald'), url('Oswald/Oswald-Regular.ttf') format('truetype');
    }

    body
    {
        font-family: 'Open Sans';   
        font-size: 14px;
    }

    Hope this helps.

    EDIT: the fonts should be located in their own folders where you keep the HTML and CSS file. Example:

    Working Folder
      Open_Sans (folder)
      Oswald (folder)
      index.html
      style.css 
  • Ahmm! I had the font in exactly the same folder as index and style.css. Maybe that's the reason why then.
     I will set my css as is yours.
    Thanks again mate, I will let you know if I find a way.
  • Sadly it did not work still :(
  • Sorry to hear that, I'm not sure how could I help you any further. :-( This is how I do it and it's OK. Maybe try doing this with the same fonts I used. You can download them for free from the internet.
  • Yup it's what I plan to do, replicate your css to see if it works and then try to change it in steps to reach to my plan.
    Thank you for your help.
  • You're welcome. :)
  • I kept trying and nothing worked on my smartphone LG L3 with Android 2.3.3.
    When I got pissed and quit the idea of fonts, I loaded the same apk in my emulator and the font showed :)
  • edited February 2014
    Can i just say something (might not be relevant but when I'm using HTML/CSS...)
    Sometimes, my app doesn't update even when i have downloaded a newer version to my phone BUT
    after i have gone to:
    Settings/Apps/MyApp/ - Clear cache etc   And then downloaded the newer App - It works!
    Again - This may not even be relevant but might be(?!?) 
    :)
  • Yup I have noticed it too. However, it wasnt my case this time, because the app reflected other changes I had made.
Sign In or Register to comment.