News:

If you like the game and can afford to, please donate to support MegaGlest.

Main Menu

Minor GUI bugs in git master

Started by John.d.h, 15 April 2011, 10:27:35

John.d.h

The recent revisions to the GUI look fantastic and things seem to be running more smoothly for me, but here are a few little hiccups I've noticed:

Just another place where the diacritics aren't working:

(Should be Leñadores)

And the orange down arrow seems to be missing.


silnarm

Picture at top has lang file encoded in ansi , second is in utf.


Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

No repair speed


Leñadores went blank

hailstone

#3
If the diatric is outside of the [extended] ASCII range (0-255) it gets read/stored as negative (or at least the ones I saw are). This means that when it comes time to get the width for the character in FontMetrics::getTextDiminsions it throws off the x position with an invalid value ( m_pos = {x=-1073741681 y=3 w=-1073741681 ...} ).

width += widths[str[i]];

[6] = -31 'á'
[2] = -15 'ñ'


Although "Leñadores" works for me but "CPU (Fácil)" doesn't.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

How would we fix it? Would using UTF-8 encoding solve the problem?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

will

Quote from: Omega on 29 April 2011, 06:26:04
How would we fix it? Would using UTF-8 encoding solve the problem?

Shocking if the system isn't utf-8 already wouldn't you say?

hailstone

Quote from: Omega on 29 April 2011, 06:26:04
How would we fix it? Would using UTF-8 encoding solve the problem?
The problem was actually a little different to what I thought. The reason why it was negative was because it was stored as a char in a string which goes -128 to 127 so any of the extended characters, above 127, were becoming negative. It is now casted to unsigned char (0 to 255) in that place and it works.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

John.d.h


silnarm

Quote from: John.d.h on 30 April 2011, 02:03:58
Quote from: hailstone on 30 April 2011, 01:13:27
it works.
Does it?

Yep  ;) The FontMetrics are correct now, everything is nicely centred, nothing has been pushed off the screen by dodgy indexing into the character widths array (the negative numbers hailstone mentioned).

Save that file as ascii, not utf!
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

Oh... right... how do I do that? :look:

silnarm

Depends... your favourite text editor may have an encoding menu, or encoding as a submenu of some other menu... or it might be an option on the save dialog (try save as..).  Or of course it may not have it anywhere... most would these days though, at least you would think.

Last resort, there is GNU 'recode'.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

In Notepad++:

Encoding > Encode in ANSI
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

Awesome! ;D

It turns out that gedit doesn't do ANSI, so I'm running Notepad++ on WINE, and that converts it just fine.  I've pushed the recoded Magitech language files, so I guess that means this problem is fixed. :)

Omega

Quote from: John.d.h on 30 April 2011, 20:00:03
Awesome! ;D

It turns out that gedit doesn't do ANSI, so I'm running Notepad++ on WINE, and that converts it just fine.  I've pushed the recoded Magitech language files, so I guess that means this problem is fixed. :)
You know, Notepad++ is open source, you could just compile it for linux and experience the awesomeness. :thumbup:
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

Quote from: Omega on 30 April 2011, 20:03:39
You know, Notepad++ is open source, you could just compile it for linux and experience the awesomeness. :thumbup:
No can do.  It uses Windows-specific libraries. :(  It runs flawlessly on WINE as far as I can tell, though.

Omega

Quote from: John.d.h on 30 April 2011, 20:08:04
Quote from: Omega on 30 April 2011, 20:03:39
You know, Notepad++ is open source, you could just compile it for linux and experience the awesomeness. :thumbup:
No can do.  It uses Windows-specific libraries. :(  It runs flawlessly on WINE as far as I can tell, though.
Really? My bad, sorry.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

hailstone

Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/