How to change the spacing / tracking of letters in the main text?

Perhaps this can also be set as "Is kCTKernAttributeName incorrect?"

I need to change the spacing / tracking of some text in iOS. (The font I use is too small for small sizes.) There are basic graphics routines that will change the spacing between characters, but these procedures do not handle Unicode. There are other main graphics routines that are defined in terms of glyphs, but they, like the world of resentment, do not, among other things, have protection from returning to system fonts for glyphs that are not in my font.

So the body text seems like a way to do this, and the body text supports kCTKernAttributeName on CFAttributedString. I think that this will do what I want, although it really is not kerning, since kerning is usually an attribute of a pair of characters, and it (from documents, it seems) uniformly adjusts the glyph for all glyphs, i.e. ., tracking.

If anyone knows, before I get off the pretty painful path to converting to a basic text API ...

+8
ios cocoa-touch cocoa core-text macos
source share
1 answer

The name kCTKernAttribute should do what you want. Setting it to a range of text adjusts the interorbital distance sequentially, regardless of the particular glyphs.

I think part of the problem is that kerning was apparently a virtual synonym for tracking (it still just โ€œadjusts the distance between letters or characters) in the text to be printedโ€ in the dictionary that ships with OS X) , and now only accepts pair kerning due to redundancy. An etymologist would probably be better placed to comment on this side of things ...

+4
source share

All Articles