MantisBT - Zandronum
View Issue Details
0001566Zandronum[All Projects] Bugpublic2013-11-04 00:552018-09-30 23:18
Catastrophe 
Torr Samaho 
normalminoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
1.2 
2.02.0 
0001566: Custom colors in name bugs CTF flag display.
How the name normally appears:'http://puu.sh/587bF [^]'
Name with custom color:'http://puu.sh/5876h [^]'

This even happens if you play in a server without the color mod loaded:'http://puu.sh/587sj.png [^]'
1. Start an offline skirmish in CTF with this mod loaded:'http://static.best-ever.org/wads/newtextcolours1_126.pk3 [^]'
2. Set your name to any of the custom colors. For example, \c[N8], will set your name to Neon Cyan.
3. Pick up the enemy flag.
No tags attached.
child of 0001490closed Torr Samaho Backport ZDoom 2.5.0 
Issue History
2013-11-04 00:55CatastropheNew Issue
2013-11-04 23:21DuskRelationship addedrelated to 0001567
2013-11-04 23:21DuskRelationship deletedrelated to 0001567
2013-11-06 14:15DuskNote Added: 0007514
2013-11-06 14:45DuskNote Added: 0007515
2013-11-06 14:45DuskAssigned To => Dusk
2013-11-06 14:45DuskStatusnew => acknowledged
2013-11-06 14:45DuskAssigned ToDusk =>
2013-11-06 14:45DuskResolutionopen => backport later
2013-11-06 14:45DuskNote Edited: 0007515bug_revision_view_page.php?bugnote_id=7515#r4193
2013-11-10 14:51DuskNote Added: 0007530
2013-11-10 14:55DuskNote Edited: 0007530bug_revision_view_page.php?bugnote_id=7530#r4201
2013-11-10 14:55DuskRelationship addedchild of 0001490
2013-11-10 14:55DuskStatusacknowledged => resolved
2013-11-10 14:55DuskFixed in Version => 2.0
2013-11-10 14:55DuskResolutionbackport later => fixed
2013-11-10 14:55DuskAssigned To => Torr Samaho
2013-11-10 14:55DuskTarget Version => 2.0
2018-09-30 23:18Blzut3Statusresolved => closed

Notes
(0007514)
Dusk   
2013-11-06 14:15   
Doesn't look like there's much we can do about this, it seems to stem from incorrect return values from FFont::StringWidth() when long-form color codes are present:


CCMD (strlen)
{ if (argv.argc() == 2)
        Printf ("length: %d\n", SmallFont->StringWidth (argv[1]));
}


Quote

]strlen "blargh"
length: 48
]strlen "\cUblargh"
length: 48
]strlen "\c[Dark Gray]blargh"
length: 53
(0007515)
Dusk   
2013-11-06 14:45   
FFont::StringWidth() returns the correct value in latest ZDoom.


// the test console command needs to be different in ZDoom because the console doesn't auto-colorize strings there
CCMD (strlen)
{ if (argv.argc() == 2)
        Printf ("length: %d\n", SmallFont->StringWidth (strbin1 (argv[1])));
}


(0007530)
Dusk   
2013-11-10 14:51   
(edited on: 2013-11-10 14:55)
the issue was fixed in this commit:'https://github.com/rheit/zdoom/commit/f014b8f98b471d54b1caafd3a41c579a6e60bd96 [^]'

EDIT: and this commit has been backported. Indeed the issue is resolved in 2.0.