Jamie Madill

Results 27 comments of Jamie Madill

OK I've narrowed this down to a difference in how troika-three-text loads TTF metrics vs how pdfkit uses [fontkit](https://github.com/foliojs/fontkit) to load TTF metrics. troika-three-text loads "os2" metrics preferentially, then falls...

> Are you saying just changing it to prefer the hhea metrics makes it render identically to fontkit? That's what I'm seeing. It only happens with specific fonts. In your...

Thanks for finding those references! I filed an issue against fontkit but there's been no response. Given your sources I suspect troika-three-text is doing the right thing, and fontkit is...

> > I'm pretty confident in pdfkit doing things "right" and this aligning with typesetting on the web as well. > > I'd still like to make it match browser...

I believe I was getting this error from empty strings: ' '. Will have to circle back to confirm.

I noticed in `getTextRenderInfo` in `TextBuilder.js`: https://github.com/protectwise/troika/blob/d23f360c4316fa782d351151062ea3b0c2629ca1/packages/troika-three-text/src/TextBuilder.js#L281 `lineHeight` is returned as ` lineHeight: result.lineHeight,`. But in `TypeSetter.js`: https://github.com/protectwise/troika/blob/d23f360c4316fa782d351151062ea3b0c2629ca1/packages/troika-three-text/src/Typesetter.js#L618 The callback is fired with `lineHeight` available in `fontData`. Is there a...

Ah, interesting, I wasn't aware of the fallback fonts for unicode. For my purposes I'm trying to compute the line height in troika-three-text to compare to PDF rendering library's line...