wentin / underlineJS

Pushing the boundary of browser typography rendering!
https://underlinejs.wentin.net
2.22k stars 80 forks source link

line-height: 1.4 not whole number with px unit #4

Closed wentin closed 9 years ago

wentin commented 9 years ago

solved, turn out they round the lineheight number when they render the text, which makes sense. But interesting fact is that they FLOOR rounded it, instead of regular rounded, so if you have get 33.6px, you get 33px, that apply to chrome. On firefox, they don't round the number at all. Also, interesting fact, on chrome/safari, the liga is supported on canvas, but not on firefox

wentin commented 9 years ago

Chrome floor rounded the line-height when it is not a whole number pixel image firefox doesn’t round the line-height when it is not a whole number px. also it doesn’t use ligature. Thank god there is no ligature under the text baseline, or wait is there? image

safari doesn’t round it either, good girl! image