[webkit-help] How does mobile webkit's auto text resizing algorithm work?

Toby Ho airportyh at gmail.com
Fri Aug 17 07:57:58 PDT 2012


Thanks! I am checking it out.


On Thu, Aug 16, 2012 at 3:08 PM, Antonio Gomes <tonikitoo at gmail.com> wrote:
> See https://bugs.webkit.org/show_bug.cgi?id=84186 and
> http://jwir3.wordpress.com/2012/07/30/font-inflation-fennec-and-you/
> John seems to be following the algorithm in the later.
> On Wed, Aug 15, 2012 at 10:28 PM, Toby Ho <airportyh at gmail.com> wrote:
>> Hello all,
>> I am currently investigating how the auto text resizing on mobile
>> webkit works, more specifically iOS. My end goal is to reverse
>> engineer the algorithm using Javascript, so that I can on a desktop
>> webkit browser mimic what it should look like on the device.
>> My current approach is black box testing, but this has not been very
>> fruitful as of yet: it seems I keep uncovering more layers of
>> complexity. Here are some things I have found so far:
>> 1. there's a correlation between the final font-size and the container's
>> width
>> 2. there's also a correlation with the length of text, for example, in
>> one test, when the length of the paragraph cross the threshold ~165
>> characters, the font size increases by 1 or 2 pxs
>> 3. it also depends on the number of elements on the page that has
>> text. For example, there's only one element on the entire page with
>> text in it, then the auto resizing doesn't seem to kick in at all
>> 4. when you have multiple elements on the page with text, the final
>> font size seems to be determined by a combination of the widths and
>> the lengths of the texts within all the elements
>> If someone could give me more detail or guidance on how this algorithm
>> works, or at least where to dig deeper, I'd greatly appreciate it.
>> Thanks,
>> Toby
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo/webkit-help
> --
> --Antonio Gomes

More information about the webkit-help mailing list