Please don't work on your app around Keon and Peak just because they
are the only publicly available devices!

They are developer phones, so you really need to workaround its bug if
there are any.
If you come this far to dev-b2g, you should learn that you could
actually re-flash your phone with the latest open source codebase --
most of the quirk behavior should go away, and you should aim your app
to work with that build.


On Tue, May 21, 2013 at 6:15 AM, pancake <[email protected]> wrote:
> Didnt worked for me :/ peak and keon draw different physical font sizes.
>
> Is there any reliable way to identify the device model (or b2g target build) 
> from javascript? That will allow to load different css depending on device.. 
> That will look like fragmentation, but looks like there's no clear way to 
> solve this on all platforms.
>
> On May 16, 2013, at 17:55, pancake <[email protected]> wrote:
>
>> Thanks, I will try later at night.
>>
>> What would you suggest to get dpi-independent <canvas>?
>>
>> Scaling is not an option, but theorically, i can measure the size of a div 
>> containing a text in "rem" units, and use this as base to determine the size 
>> of the pixels.
>>
>> function getdpi() {
>>    var e = document.body.appendChild (
>>        document.createElement ('div'));
>>    e.style.width = '1rem';
>>    e.style.padding = '0';
>>    var v = e.offsetWidth;
>>    e.parentNode.removeChild(e);
>>    return v;
>> }
>>
>> I will have to time to do some tests tonight and see if that works..
>>
>> Another option would be to use SVG to get proper scaling of the ruler,
>> and that will probably render faster than using a canvas.
>>
>> On 05/16/13 14:42, Adán Sánchez de Pedro Crespo wrote:
>>> I achieve uniform size on PC, Keon and Peak by using these media queries
>>> in my CSS:
>>>
>>> @media screen and (orientation:portrait) {
>>>
>>>     html{
>>>
>>>         font-size: 5vw;
>>>
>>>     }
>>>
>>> }
>>>
>>> @media screen and (orientation:landscape) {
>>>
>>>     html{
>>>
>>>         font-size: 5vh;
>>>
>>>     }
>>>
>>> }
>>>
>>> @media only screen and (min-resolution: 90dpi) and (min-width: 540px){
>>>
>>>     html{
>>>
>>>         font-size: 150%;
>>>
>>>     }
>>>
>>> }
>>>
>>>
>>> Then you only have to change the units for everything to 'rem', which is
>>> relative to html tag's font size.
>>>
>>>
>>>
>>> _______________________________________________
>>> dev-b2g mailing list
>>> [email protected]
>>> https://lists.mozilla.org/listinfo/dev-b2g
>>
>> _______________________________________________
>> dev-b2g mailing list
>> [email protected]
>> https://lists.mozilla.org/listinfo/dev-b2g
>>
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g



--
Tim Guan-tin Chien, Engineering Manager and Front-end Lead, Firefox
OS, Mozilla Corp. (Taiwan)
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to