Re: Vertically Centered Colon
Re: Vertically Centered Colon
- Subject: Re: Vertically Centered Colon
- From: Alex Zavatone <email@hidden>
- Date: Mon, 28 Nov 2016 12:07:22 -0600
I have old iOS attributed strong code that explicitly handles superscripting specific characters in an NS attributed string from the baseline by a % of the character height or by a fixed pixel amount.
Let me know if you want it.
Sent from my iPhone
> On Nov 28, 2016, at 10:42 AM, Alastair Houghton <email@hidden> wrote:
>
>> On 28 Nov 2016, at 16:18, Gerriet M. Denkmann <email@hidden> wrote:
>>
>>
>>> On 28 Nov 2016, at 22:13, Eric E. Dolecki <email@hidden> wrote:
>>>
>>> You could probably use an attributed string and add an attribute for the last colon: NSBaselineOffsetAttributeName
>>
>> Yes; but this would be some rather desperate work-around.
>>
>> I was rather thinking of UIFontDescriptorFeatureSettingsAttribute with some Feature type from SFNTLayoutTypes.h (in CoreText).
>> I tried a few types, but no success so far.
>
> The problem you’ve got is that unless the font has a feature that specifically allows you to change *any* colon (as opposed to a colon between two numerals), you aren’t going to be able to do it by turning on an OpenType feature. Even if you can, there doesn’t appear to be a standard feature code for this, so you’d be reliant on Apple not changing it in the future.
>
> What you *could* do instead is get Core Text (or Cocoa Text) to lay out a string e.g. "12:00”, then grab the glyph for the centred colon directly from that string and use it explicitly, e.g. by attaching a kCTGlyphInfoAttributeName attribute to your string with the value set to an appropriately constructed CTGlyphInfoRef.
>
> Kind regards,
>
> Alastair.
>
> --
> http://alastairs-place.net
>
>
> _______________________________________________
>
> 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
_______________________________________________
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