Questions tagged [textkit]

Text Kit is, collectively, a set of classes and protocols in iOS 7's UIKit framework that provide high-quality typographical services.

Text Kit, introduced in iOS 7, is a set of classes and protocols providing high quality typographical services including text layout, storage and display. It also enables direct control of typographical features such as kerning, ligatures, line break behaviour and justification. Text-related UIKit classes in iOS 7 - namely UITextView, UITextField and UILabel - are based on the Text Kit layout engine.

Allowing fine-grained control of fonts and styles through a mechanism Apple calls "Dynamic Type", Text Kit brings a much more refined an detailed system for text-handling to iOS.

272 questions
1
vote
1 answer

UITextKit and exclusionPaths: undependable indent when editing

I have a problem with UITextKit using exclusionPaths: when I place an image inside a TextView, that I’m editing, first everything looks fine: But when the „Done“-Button is tapped, it will look like this, the ident is wrong: This is the class to…
Ulli H
  • 1,748
  • 1
  • 19
  • 32
1
vote
1 answer

Swift Delegate in own class

I am currently trying to write my first Swift Mac application. Currently I have hard times refactoring some code into another class. Current Status: import Cocoa class TestClass: NSObject, NSTextStorageDelegate { @IBOutlet var codeTextView:…
dehlen
  • 7,325
  • 4
  • 43
  • 71
1
vote
1 answer

Text Kit: Upper case Math symbols in San Francisco

In Introducing the new system fonts, the following screen shot was shown. Which UIFontDescriptorFeatureSettingsAttribute is used to enable this behaviour?
1
vote
1 answer

How to change font in NSTextContainer

My application is setup as so. Custom UIView inside a ScrollView. The custom UIView is getting text generated on top of it with this code. CoreDavening.m draw function attStorage = [[NSTextStorage…
1
vote
0 answers

Fitting NSlayoutManager into UIView

I have set up a UIView with NSLayoutManager (TextKit) and the UIView is placed in a UIScrollView. Im having trouble resizing the UIView to the size of the text so that It can be scrolled. Currently the text fills the screen but the scrollView…
1
vote
1 answer

NSAttributedString: heading on non-paragraphs

I'm building a dictionary with a big UITextView with multiple NSAttributedString for each word. I'm trying to set a fixed space before lines like below but I can't set heading on the text starting by "L'ensemble" as it's not a paragraph (not…
Skoua
  • 3,373
  • 3
  • 38
  • 51
1
vote
0 answers

Removing characters from font

As far as I can tell from this WWDC doc, my code should work, but it doesn't: NSString *fontName = [@"MaisonNeue-" stringByAppendingString:@"Light"]; UIFont *originalFont = [UIFont fontWithName:fontName size:size]; UIFontDescriptor…
Mazyod
  • 22,319
  • 10
  • 92
  • 157
1
vote
2 answers

iOS UITextView generate a screenshot of the selected text - is it possible using TextKit or any other method?

In my app and using Objective-C I need to implement the following functionality if possible. I would like to know if it is possible to generate a screenshot of the selected text from a UITextView. I know it sounds like a weird question but it is an…
Wael
  • 489
  • 6
  • 19
1
vote
1 answer

How to modify NSTextAttachement 's position in uilabel?

As the picture says, I got two image NSTextAttachments in a label ,and the label has a red background color, If i want to move the image a little down in the label ,how to achieve this? (The image above had the bottom truncated because it was white…
ximmyxiao
  • 2,622
  • 3
  • 20
  • 35
1
vote
1 answer

Embed youtube video inside TextKit

I am trying to display a html page from a website on iPad. Instead of using UIWebview, I used Textkit so I can display the content in multiple columns. I used iOS7 Day-by-Day day 21 example as…
user890207
  • 509
  • 1
  • 6
  • 14
1
vote
1 answer

UIPageViewController/TextKit Multipage flow in SWIFT

Has anyone had any luck creating a multiple page view of document (one, NSTextStorage, one NSLayoutManager, and multiple NSTextContainers) in Swift. I'm having a lot of trouble finding example code not in objective C. Basically, I'm trying to…
user797892
  • 186
  • 1
  • 8
1
vote
1 answer

How to draw attributedString in BezierPath to an image?

I'm using TextKit to get something like the following example (first image): a text (attributedString) placed into an area defined by using BezierPath as set as ExclusionPaths to NSTextContainer. The orange area is the excluded area, so the text…
Dirk
  • 2,011
  • 1
  • 20
  • 25
1
vote
1 answer

Finding bounding rect for word at index in a UITextField

I have a UITextField with some words in it, and I want to figure out the bounding rect for a word at some index. It's better to give some visual example so I have made a sketch to show what I want. Let's say I want the bounding rect of "nice"…
chrs
  • 5,906
  • 10
  • 43
  • 74
1
vote
2 answers

Detecting touches on an underlying UITableViewCell and taps in attributed text of a UITextview

I use a UITextView that is attached to a UITableViewCell with a configuration as shown below: cell.topicAndDescriptionTextView = [[UITextView alloc] initWithFrame:frame]; cell.topicAndDescriptionTextView.tag =…
Jan Wilhelm
  • 111
  • 7
1
vote
1 answer

TextKit and VoiceOver

I've been following the iOS7 Day-by-Day multi-page TextKit tutorial, and ran into an issue with accessibility. The code for the tutorial is here: iOS7 Day-by-Day The problem is that each of the text views (one per column, two per "page") seems to…
user1459524
  • 3,613
  • 4
  • 19
  • 28