@frostschutz: Okay, added some
various shenanigans, so -l, --linecount is now in an eval-friendly format instead when used with -t, --truetype, and it includes the amount of lines initially computed, the actual amount of lines rendering took, and whether that ended up truncating the string at one time or another.
You can also skip the rendering pass to make that cheaper, but this will *not* catch every possible truncation, especially with broken metrics.
c.f., the API docs for more details ;).
(For example, the same string, at the same size, can return
next_top=0;computed_lines=10;rendered_lines=0;trun cated=0; for a compute only run, but
next_top=0;computed_lines=10;rendered_lines=9;trun cated=1; for a full run, as truncation could only be detected at rendering time, because of broken font metrics.)
@sherman: I went with an extra optional struct pointer instead of changing the return type, as I figured this would be less annoying to wrap for FFI stuff, and less annoying to update for API users. And, incidentally, less annoying for the internal handling in fbink_printf ;).