Closed JuhQ closed 9 years ago
Thanks for submitting. I need to either decide to come up with a strategy for predicting when this would occur (any diacritic above a capital letter) or develop a way to understand the real extent of a rendered piece of text. But I'll fix it!
Jip. +1
Same thing with spanish accentuated chars.
Beware that some characters have diacritics below. Here are some Turkish chars.
I guess, you should measure character heights. This may be a good start: http://stackoverflow.com/questions/1134586/how-can-you-find-the-height-of-text-on-an-html-canvas
Fixed as of https://github.com/geelen/typeslab/pull/7
Thanks for letting me know about this!
Jey, much better. I just found some small special case: For those characters there is no font-combination where all letters are included and the ť hangs out.
Yeah, that's a different bug - canvas has a measureText
function which is supposed to give me a real width of the rendered text, but it doesn't. I might use the same logic for depth checking as I do for width-checking, shouldn't be too hard, but I won't have time to fix it for a while. Anyone feel like throwing a PR at me? The lines in question are here: https://github.com/geelen/typeslab/blob/master/src/lib/models/line-metrics.js#L15-L25
I'd love to avoid calculating the depth twice, but I don't see how. In the use-case above, the line doesn't need to be resized, just shifted left. Maybe that case is easier to deal with...
It seems that the line height is wrong when using scandinavian characters, ä, ö, å for example.