syndicodefront / infekt

The ultimate best NFO viewer, ever!
https://infekt.ws/
GNU General Public License v2.0
359 stars 19 forks source link

Line wrapping behavior and art #121

Closed pyrescene closed 2 years ago

pyrescene commented 7 years ago

I'm not completely satisfied by the line wrapping behavior yet. See https://github.com/syndicodefront/infekt/issues/105 and https://github.com/syndicodefront/infekt/issues/91

What I want from this feature is to wrap a really long line of text so I can easily read it. This works as expected.

image

Then there are some newer groups that have a really wide nfo. With wrap on it still shows nicely on my screen. (155 chars in example)

image

While the above all get displayed as expected, this smaller art doesn't. (141 characters including white space) Example files on https://www.srrdb.com/browse/group:sparood/1

image

This generated text, which could happen in a scene notice, doesn't wrap.

lorem.nfo.txt

Can the wrap magic be improved?

This is where it happens: https://github.com/syndicodefront/infekt/blob/ea93ae9cb28e9d7f8279562702dec234c536553d/src/lib/nfo_data.cpp#L453

Try using this heuristic instead: One of the lines that got wrapped, must be longer than 2*80 chars, ignoring trailing white space.

flakes commented 2 years ago

New algorithm (see commit) will be in next release.