Help - Search - Members - Calendar
Full Version: $len2() problem
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
Lyx
Greetings,

i was sent a bug-report of my playlist-formatting string. However, after thinking about it and checking my string, i'm not sure if the problem is maybe a bug in $len2()

Another possiblility would be that the font that user uses is screwed up.

Screenshot:
http://www.hydrogenaudio.org/forums/index....=post&id=183910

the column before the tracknumber-column is wrongly aligned.
I am using $len2 to pad the artist and albumname manually(i have to do this for various reasons), so the error clearly can only happen at that location in the code.... it looks like this:

QUOTE
// adjust Artist/Album-column's width
$puts(artist-album_width,$sub($get(artist-album_width),$len2($get(artist))))


So, to me it appears that most of those doublewith chinese characters get counted correctly, but char ALT+149 (a small filled circle/bullet) gets counted as double-width character, although its only single-width.

Users setup:
System: Windows XP
Language: Chinese GB2312
"Display"---"Double-width characters in title formatting"---"Count
double-width characters and ambiguous characters as two regular
characters"

- Lyx
Lyx
hmm, is this the problem?:

"Display"---"Double-width characters in title formatting"---"Count
double-width characters and ambiguous characters as two regular
characters"
Lyx
death cleared it up.... thanks.

- Lyx
anza
Perhaps you could tell us what was the solution? Just in case someone has this problem later.
Lyx
The problem simply are ambiguous characters. ALT+149 is one. According to the unicode specs, this "bullet" is sometimes singlewidth and sometimes doublewidth, depending on the font used.

If in the setup the following option is choosen:
"Double-width characters in title formatting"---"Count double-width characters and ambiguous characters as two regular characters"

Then if the choosen font has ALT+149 as a singlewidth-character, it will be counted falsely as TWO characters - hence the display-error.

The errors in the other screenshot happened, because the artist/albumname contains doublewidth characters which are not supported by the given font. So, these characters get displayed as a singlewidth "?" but get counted as doublewidth.


SOLUTION: there was none. Options are changing to a GUI with real columns, not using ambiguous characters in the tags and not using columns at all.

- Lyx
kode54
Or using a more complete font. :B
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.