facebook

How to auto-scale text across devices so that it looks good?

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #348441 Reply

    Mike Felker
    Participant

    I am creating a mobile website and the text box is infuriating me. If created with the iphone 4 template, all is good, but the text does not stretch out on iphone 5, samsung or any other device template regardless of what I enter in the auto-resize area. If I use a larger phone template, then it looks TERRIBLE on the iphone 4 template and other smaller sizes.

    How can I make it so that the scale font size auto scales up and down to match the screen area available to me?

    Mike

    #348445 Reply

    Code_A
    Member

    I have never tried this, but you should be able to handle this manually by scaling the font relative to the screen size.

    Here is how you set the font size (result would be your scaled value):

    $('#m1-screen-textArea1').css('font-size',result + "px");

    Here is how you get the window size:

    h=window.screen.height;
    w=window.screen.width;

    Now all you need to do is write a Resize function and call it from your documentReadyHandler to scale your font accordingly. Hopefully this helps/works. Like I said, I have not actually tried to do this.

    #348447 Reply

    Mike Felker
    Participant

    So no automated way to do this?

    Thanks for your suggestion. I’ll attempt it.

    Mike

    #348454 Reply

    Code_A
    Member

    I am not aware of an auto-scaling of the font option being an available in mobione, it is only for the widgets. I think this would need to be handled through code. If you can’t get it working then post back and I’ll try to put together a quick example.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to auto-scale text across devices so that it looks good?

You must be logged in to post in the forum log in