Small number 9 instead of Apostrophe?

  1. ‹ Older
  2. 5 years ago

    Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    This is an excellent question. After some research, it appears that the apostrophe character is expressed in UTF-8 as E2 80 99, and prints this character: ’ instead of the tick mark '. Modern text editors / word processors such as Word, Pages, etc will auto-change ' to ’, as the typography is more pleasant that way.

    The problem this introduces is that the apostrophe character was not included in the original ASCII character set, so it is must be interepreted as UTF-8. This should be all well and good, as Xojo has good support for multiple encodings.

    Now, as to your question: I'm storing this string as a constant, where it appears there is no way to define the encoding. This means that in the IDE when laying out the window, if I set the value of the label to be #THE_NAME_OF_THE_CONSTANT it goes ahead and wires up the label to show the value of the named constant, with the incorrect character shown as I can only assume it is not encoding things correctly.

    At runtime, I suppose I could re-set all the labels by running the constants through a defineEncoding() call, but why should I have to?

    Is there really no way to define an encoding on a string constant?

  3. Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    Hmm, even when I explicitly set the label's text to be the result of defineEncoding(CONSTANT_NAME, Encodings.UTF-8) I still get the wrong character showing there.

    If I put a breakpoint on the define encoding call, I can see that the constant seems to think it is already using the UTF-8 encoding, (before being passed to defineEncoding(), so something else must be going on here.

  4. Norman P

    2 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...
    Edited 5 years ago

    A really tiny sample & bug report would be interesting to peek through
    Platform ?
    etc
    Sounds like this should be really reproducible

  5. Michel B

    2 Apr 2014 Pre-Release Testers RubberViews.com

    @Kimball L I set the value of the label to be #THE_NAME_OF_THE_CONSTANT it goes ahead and wires up the label to show the value of the named constant, with the incorrect character shown as I can only assume it is not encoding things correctly.

    Instead of a constant, what happens if you set the value as plain text ?

  6. Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    @Norman P - here is the constant definition from the IDE:

    -image-

    Note that the apostrophe character there (in the what's next?) is NOT just a tick mark, but is an actual apostrophe character, as discussed above.

  7. Norman P

    2 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    Well not sure about the font but cutting a sentence from pages
    Something funky with ‘something’ is going on
    from Pages & pasting it into the value of the constant & using it shows the same as in Pages

  8. Norman P

    2 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...
    Edited 5 years ago

    OK I typed that exact same phrase into a little test here &, except for the font setting, things are fine.

    What if you use a font like System ? Does it work fine ?
    That would lead me to suspect the font somehow

    EDIT : Scratch that
    Installed all the fonts here on OS X 10.8.5 and things just work like I'd expect
    No superscripted 9's here

  9. Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    I think I'm beginning to agree with you Norm - I thought I'd seen this with other fonts, but I've tried several dozen now and have not been able to reproduce it on anything but the Ubuntu font. Even Ubuntu Mono does it correctly.

    Dang. The decision maker really wanted to use this font. I'll have to hunt for something else that is close and still handles baseline and leading correctly (nearly none that I've tried do so - see here: https://forum.xojo.com/5353-some-fonts-clipped-in-labels/p1#p72369 )

  10. Norman P

    2 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    Odd I tried all three variants but not tons of sizes and got no little 9's in any trials

  11. Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    Really? Could be as stupid as I need to re-download the Ubuntu font?

  12. Norman P

    2 Apr 2014 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    No idea - what font style & size were you trying ?
    Any adornments like Bold Italic Underline etc ?

  13. Kimball L

    2 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    I'm just using the Ubuntu font plain. No adornments, and it happens at all sizes. Seems to be happening in other apps as well, such as Notepad and Pages. Even after re-installing the font.

    How odd.

    Well, bottom line: We can't use the Ubuntu font. We'll try others instead... which leads me to my latest bug report:
    Feedback Case #32967

  14. Bill G

    2 Apr 2014 Pre-Release Testers
    Edited 5 years ago

    Just a thought - have you turned off Smart Quotes in the system preferences?
    Apple symbol > System preferences… > Keyboard > Text > Uncheck “Use smart quotes and dashes”

    (edit: I just read other fonts aren't doing it - never mind, this probably isn't it.)

  15. Michel B

    3 Apr 2014 Pre-Release Testers RubberViews.com

    I just looked at it with FontLab.

    The Ubuntu font is using OpenType Glyph substitution. In other words, it switches the apostrophe to the upper nine internally. It is a bug in the font itself.

    Unfortunately, there is no workaround.

    The only way would be to remove the OpenType instructions and generate a new font that you would then use instead, but that would require permission from the copyright owner.

  16. Peter T

    3 Apr 2014 Pre-Release Testers, Xojo Pro Oakland, CA USA

    I agree with Michel. Before I looked at his reply, I also opened the font with FontLab Studio. I didn't find the Opentype substitution behavior that he did, but noticed another issue with a bunch of glyphs in this font, including the superscript 9, when I opened it:
    -image-
    Notice that the glyph has a caption with a red background and yellow text. This is what the FontLab docs have to say about that indicator:

    A strong red caption with yellow text of a cell means that the character has some naming conflict: one name is used for different glyphs or the glyph’s Unicode codepoint does not correspond to its name. You should usually correct either the glyph name or the Unicode codepoint for glyphs with red captions.

  17. Kimball L

    3 Apr 2014 Pre-Release Testers, Xojo Pro Meridian, ID, USA

    Holy nice research, batman! Thanks to both @Peter T and @Michel B for the FontLab info. Off I go to find another font.

  18. Michel B

    3 Apr 2014 Pre-Release Testers RubberViews.com
    Edited 5 years ago

    @Peter T I didn't find the Opentype substitution behavior that he did

    Your get the OpenType panel which shows the substitution tables by clicking the OpenType icon. I use the Windows version :

    -image-

    Glyph substitution is a wonderful technology which took over 5 years to be used transparently for Roman text by Windows and Mac OS X. It is the result of common work between Apple, Adobe and Microsoft within the OpenType project. The first version was present in Windows Vista but the only program making use of it was Adobe InDesign. For instance, ae can be replaced automatically by æ without having to code anything in a text field. The internal coding of the font takes care of it. I have devised handwriting fonts where all ligatures between upper ending characters such as b, o, v, w and following characters are automatically managed by the font itself.

    Until that dreadful superscript 9 bug, I thought glyph substitution was kind of a graal. Now it appears that as any technology, it is a double edged sword that can be used for goofs :/

  19. Peter T

    3 Apr 2014 Pre-Release Testers, Xojo Pro Oakland, CA USA

    @Michel B Until that dreadful superscript 9 bug, I thought glyph substitution was kind of a graal. Now it appears that as any technology, it is a double edged sword that can be used for goofs :/

    As OpenType and other font technologies have implemented more and more logical functionality, they have become, in effect, programs. As such, they are subject to developers' errors.

    As far as I can tell, the problem here is entirely down to the creator(s) of this font introducing some bugs in the program that is the Ubuntu font.

  20. Michel B

    3 Apr 2014 Pre-Release Testers RubberViews.com

    @Peter T As OpenType and other font technologies have implemented more and more logical functionality, they have become, in effect, programs. As such, they are subject to developers' errors.

    Yes indeed, internal programming means bug. The Ubuntu font one is the most obnoxious I have ever seen. How could have they released it with such a blunder is beyond belief. Seems they did not even take time to beta test it. And what font designer can be as stupid as to mixup quoteright &u2019 with ninesuperior &u2079 ? The guy needs help...

  21. Peter T

    3 Apr 2014 Pre-Release Testers, Xojo Pro Oakland, CA USA

    ...stupid as to mixup quoteright &u2019 with ninesuperior &u2079

    I guess with the UI font they were using in their font creation tool, the one and the seven look alike ;P

or Sign Up to reply!