• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Vertically Centered Colon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vertically Centered Colon


  • Subject: Re: Vertically Centered Colon
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 29 Nov 2016 01:13:18 +0700

> On 29 Nov 2016, at 00:40, Quincey Morris <email@hidden> wrote:
>
> On Nov 28, 2016, at 07:01 , Gerriet M. Denkmann <email@hidden> wrote:
>>
>> But in my case I have “21:37:44” where ““21:37” is bold and “:44” is thin.
>
> a. Are you using an attributed string whose text is “21:37:44”, or two unattributed strings?

One attributed string, where the first 5 chars have NSFontAttributeName = boldFont and the last 3 have
NSFontAttributeName = thinFont.

> b. You have a — I don’t know exactly what to call it — “logical” or “consistency” problem inherent in this situation, because it’s not obvious which font the second “:” should be in. I’m not suggesting you’re incapable of making a decision, but that your actual problem is a consequence of this underlying ambiguity. What would you do if the “:” glyphs were radically different in the two fonts?

UIFont *boldFont = [ UIFont systemFontOfSize: pointSize  weight: UIFontWeightLight ];
UIFont *thinFont = [ UIFont systemFontOfSize: pointSize  weight: UIFontWeightUltraLight ];

I just assume that the glyphs, coming form the same family, are somewhat consistent.

> c. Where does the colon character come from in the first place? Specifically, you’re using a formatted time string, which could be expected to come from (say) a DateFormatter. How do you know there are going to be any colons at all, let alone two of them?

They indeed come from an NSDateFormatter:
timeFormatter = [ [ NSDateFormatter alloc ] init];
timeFormatter.dateFormat = @"HH:mm:ss";

> Given that you work so much with non-Latin scripts, I find it surprising that you would make assumptions about how a time is represented. (Again, of course, you may have decided this is the correct approach for your scenario, but it strikes me as worth commenting on.)
>
> What I’m suggesting is that perhaps you should treat this as something like a code smell, and re-evaluate whether changing fonts in the middle of the time string is a good idea.

The effect I am after is: hours and minutes should be emphasized, the seconds should not.
Maybe I could use the same font with different colours: black versus light gray or something like this.

But right now I am still trying to implement Alistairs suggestion.


Kind regards,

Gerriet.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Vertically Centered Colon (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Vertically Centered Colon (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Vertically Centered Colon
  • Next by Date: Re: Vertically Centered Colon
  • Previous by thread: Re: Vertically Centered Colon
  • Next by thread: Re: Vertically Centered Colon
  • Index(es):
    • Date
    • Thread