Hi, 

I just found the source of my problem with kerning. It indeed happens only in 
JavaScript.

A few functions use int64_t casts when scaling coordinates from font-space to 
user-space. This wreaks havoc on Emscripten, because JavaScript doesn't have an 
integer type big enough to hold a 64-bit integer.

Would it be sufficient to use int32_t in these cases instead? IMO it's not 
likely that (coordinate * scale) is ever going to be larger than 2 billion. Am 
I missing something?

Here are the problematic lines:

https://github.com/behdad/harfbuzz/blob/master/src/hb-font-private.hh#L177
https://github.com/behdad/harfbuzz/blob/master/src/hb-font-private.hh#L182
https://github.com/behdad/harfbuzz/blob/master/src/hb-font-private.hh#L450
https://github.com/behdad/harfbuzz/blob/master/src/hb-ot-layout-common-private.hh#L798

-- 
Lorant

_______________________________________________
HarfBuzz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to