Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Patch for Font class  (Read 3133 times)

0 Members and 1 Guest are viewing this topic.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Patch for Font class
« on: February 14, 2009, 09:56:55 pm »
I've recently found out that the Euro sign is not printed out. The reason is that some wrong codepoints are used for ourDefaultCharmap. I've corrected the failing values.

Also, I've implemented a replacement glyph for invalid codepoints. That means, when you try to print out a glyph that wasn't loaded through the charset, that glyph gets printed out instead of just nothing, like it is currently.

Patch: http://pitload.org/get/1628

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Patch for Font class
« Reply #1 on: February 14, 2009, 10:04:35 pm »
Quote
I've recently found out that the Euro sign is not printed out. The reason is that some wrong codepoints are used for ourDefaultCharmap

Why are you talking about "wrong codepoints"? The euro sign is not in the default charset on purpose.

Quote
Also, I've implemented a replacement glyph for invalid codepoints. That means, when you try to print out a glyph that wasn't loaded through the charset, that glyph gets printed out instead of just nothing, like it is currently.

Yeah, I should probably add that in SFML 2.0 ;)

Thanks
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Patch for Font class
« Reply #2 on: February 14, 2009, 10:12:37 pm »
Quote from: "Laurent"
Why are you talking about "wrong codepoints"? The euro sign is not in the default charset on purpose.

Well, the problem is, that SFML is using Unicode everywhere, but still referencing to ISO-8859-1 charsets per default. That means you get problems when working for example with TextEvent.Unicode. You can't just display the proper character. IMHO this should work for at least latin-1.

Your default charset just includes ISO-8859-1, which is just outdated. At least ISO-8859-15 should be supported, thus providing the Euro sign. Together with Unicode support everywhere in SFML, the proper codepoints should be changed to use their Unicode equivalents.

Quote
Quote
Also, I've implemented a replacement glyph for invalid codepoints. That means, when you try to print out a glyph that wasn't loaded through the charset, that glyph gets printed out instead of just nothing, like it is currently.

Yeah, I should probably add that in SFML 2.0 ;)

SFML 2.0? That's a quickfix?! :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Patch for Font class
« Reply #3 on: February 14, 2009, 10:30:09 pm »
Quote
SFML is using Unicode everywhere, but still referencing to ISO-8859-1 charsets per default

Quote
IMHO this should work for at least latin-1.

ISO-8859-1 is latin-1. ISO-8859-15 is latin-9.

Quote
Your default charset just includes ISO-8859-1, which is just outdated. At least ISO-8859-15 should be supported, thus providing the Euro sign

ISO-8859-15 is indeed an update of ISO-8859-1, so yes, I think I should update it in SFML as well. Thanks for the tip.

Quote
SFML 2.0? That's a quickfix?!

Like I said, SFML 1.5 will mostly be bug fixes release. Moreover, I plan to do more changes to strings and fonts in SFML 2.0, so this one will just be part of it ;)
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Patch for Font class
« Reply #4 on: February 14, 2009, 10:40:17 pm »
Quote
ISO-8859-1 is latin-1. ISO-8859-15 is latin-9.

Oops, yeah, that's right.

Quote
Quote
SFML 2.0? That's a quickfix?!

Like I said, SFML 1.5 will mostly be bug fixes release. Moreover, I plan to do more changes to strings and fonts in SFML 2.0, so this one will just be part of it ;)

Okay, nice to hear changes about strings. I just thought that displaying an "invalid character glyph" would be more helpful than just displaying nothing, since maybe the underlying application is storing the characters, but they don't get displayed, which can lead to errors.

 

anything