Color codes are factored in for purposes of wrapping

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Color codes are factored in for purposes of wrapping

Re: Color codes are factored in for purposes of wrapping

by Graf Zahl » Sat Nov 05, 2022 3:27 am

Uh.
BreakLines does not measure characters, it measures screen units of the text's width. And surely it considers color control sequences, otherwise the console would look all screwed up!

Color codes are factored in for purposes of wrapping

by Accensus » Mon Jul 25, 2022 8:42 am

Unknown version. This was tested on 4.8.2, but I'm fairly certain it's nothing new.

It makes wrapping or automatically breaking colored strings completely useless. This is both the case for StatusBarCore::DrawString's wrapwidth argument and Font::BreakLines. If the break width is set to the 10th character in BreakLines, the string \c[Red]Bazinga\c- will get split at around "Baz" because, although invisible, the color codes count towards the characters.

Top