9

I have an iOS app which uses fixed width font label extensively.

After changing to the iOS 7 sdk and build target 6.1, all the label automagically replace occurences of three punctuation marks with an ellipsis character. This breaks a lot of stuff and looks weird, since the ellipsis character is not present in the font I use, and iOS sees fit to use one from a different font.

How do I stop this behaviour?

Ibmurai
  • 932
  • 7
  • 11
  • Interesting find, I can reproduce too. Should be probably reported. Funny that for truncate tail they do not replace ellipsis with single character. – paiv Nov 19 '13 at 19:43
  • I'm not sure it uses single character for ellipsis (how do you check?), but the style is different for those dots, that's for sure. – paiv Nov 19 '13 at 19:50
  • So I was looking at a similar problem, but cannot reproduce this one. Please provide the exact string. Note I'm using the latest "Under NDA" version of Xcode/iOS, but the deploy target is 6.1. So, a string, its set in IB or in code? In code with system font all looks fine (no changes). – David H Dec 05 '13 at 22:17
  • So I tried setting the Font to Courier, and set the string in IB and also in code - when I read it out its always using periods. – David H Dec 05 '13 at 22:38

4 Answers4

2

This is a ligature, and iOS seems to replace them automatically (like fl becomes ). Seems like there are some options to disable them, see this question: Adjoining "f" and "l" characters

Community
  • 1
  • 1
Cyrille
  • 25,014
  • 12
  • 67
  • 90
1

One way around this is to replace the ASCII periods with a unicode 2024 character ("ONE DOT LEADER"). It looks exactly like a period but should not get converted automatically.

What you could do if this is widespread is to change all your UILabels to a subclass, MyLabel, and intercept messages to set the text, look for three dots, and if found change them to the unicode character above.

Yeah, this is a big PITA but I know of no other workaround.

EDIT

Another idea - find an open source UILabel (there must be at least one) and use it.

David H
  • 40,852
  • 12
  • 92
  • 138
  • 1
    Or insert a zero-width space between the dots? (U+200B) – Cyrille Nov 19 '13 at 21:41
  • @Cyrille Hah - good suggestion! In the end its having to monitor and change the text which makes this a true PITA. – David H Nov 19 '13 at 22:09
  • @Cyrille I've been considering that, but I just hate workarounds like that. We must be able to disable this behaviour! ;) if not, your solution is what I will go with. You should make a real answer with your answer so I can mark it as the answer. Answer. :) – Ibmurai Nov 27 '13 at 06:02
1

Alternative number three: insert a zero-width space (U+200B) between the dots.

(Posted as an answer per request of the OP)

Cyrille
  • 25,014
  • 12
  • 67
  • 90
0

Another alternative : the ellipsis is a true character of its own. Why don't you try to add it yourself in your font (with Fontlab, FontForge or Glyphs) at the same width than the other characters?

Cyrille
  • 25,014
  • 12
  • 67
  • 90