View Single Post
Old 06-12-2019, 05:43 PM   #126
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 876
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by frostschutz View Post
Is it possible for fbink --truetype to return an error when there was not enough space to render the text completely? Or for this info to be included in --coordinates?

What I'm actually trying to do is determine an optimal font size to render text to a given rectangle. But I can't do it reliably if fbink won't tell me whether the text fit or not.

It would also be interesting to get feedback on the number of times fbink decided to wrap.

Or maybe I'm going about UI design the wrong way... and I should just hardcode it. ;-)
It should be possible.

From memory, there's a measurement pass to test fit, and truncate if necessary. Just a matter of getting that information to the caller. Same with the number of lines.

(It's been a while since I implemented this, then NiLuJe has made changes to the code since, so I'm a bit fuzzy on exactly what's possible...)
sherman is offline   Reply With Quote