Author Topic: Minor GUI bugs in git master  (Read 2643 times)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Minor GUI bugs in git master
« on: 15 April 2011, 10:27:35 »
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

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Minor GUI bugs in git master
« Reply #1 on: 17 April 2011, 02:48:35 »
Picture at top has lang file encoded in ansi , second is in utf.


Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Minor GUI bugs in git master
« Reply #2 on: 18 April 2011, 02:12:42 »
No repair speed


Leñadores went blank

hailstone

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Minor GUI bugs in git master
« Reply #3 on: 29 April 2011, 06:11:26 »
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 ...} ).

Code: [Select]
width += widths[str[i]];
Code: [Select]
[6] = -31 'á'
[2] = -15 'ñ'

Although "Leñadores" works for me but "CPU (Fácil)" doesn't.
« Last Edit: 29 April 2011, 09:23:23 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minor GUI bugs in git master
« Reply #4 on: 29 April 2011, 06:26:04 »
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

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Minor GUI bugs in git master
« Reply #5 on: 29 April 2011, 06:35:47 »
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

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Minor GUI bugs in git master
« Reply #6 on: 30 April 2011, 01:13:27 »
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Minor GUI bugs in git master
« Reply #7 on: 30 April 2011, 02:03:58 »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Minor GUI bugs in git master
« Reply #8 on: 30 April 2011, 03:04:30 »
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Minor GUI bugs in git master
« Reply #9 on: 30 April 2011, 03:54:44 »
Oh... right... how do I do that? :look:

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Minor GUI bugs in git master
« Reply #10 on: 30 April 2011, 05:05:23 »
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

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minor GUI bugs in git master
« Reply #11 on: 30 April 2011, 06:40:16 »
In Notepad++:

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

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

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Minor GUI bugs in git master
« Reply #12 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. :)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minor GUI bugs in git master
« Reply #13 on: 30 April 2011, 20:03:39 »
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Minor GUI bugs in git master
« Reply #14 on: 30 April 2011, 20:08:04 »
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

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minor GUI bugs in git master
« Reply #15 on: 30 April 2011, 20:16:51 »
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

  • Local Moderator
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Minor GUI bugs in git master
« Reply #16 on: 1 May 2011, 01:51:43 »
vim can change file encoding (emacs should be able to as well). http://stackoverflow.com/questions/778069/how-can-i-change-a-files-encoding-with-vim
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

 

anything