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
0
votes
1 answer

How do I set fixed distance between characters using TextKit

I use TextKit to draw a long text. Paragraph alignment is NSTextAlignmentJustified, hyphenationFactor is on. Usually it works great, but sometimes I see the line like this: "L o n g t e x t". Is there a way to draw such lines as "Long____text"?…
Alex
  • 1,155
  • 1
  • 8
  • 12
0
votes
1 answer

how to set a UITextView's text to be bolded and not clickable

I have the following HTML in a UITextView and would like to render it into a UITextView is my body for the note food item - more item stuff;` Let me add: it's currently showing as blue and underlined and not clickable. I…
timpone
  • 19,235
  • 36
  • 121
  • 211
0
votes
1 answer

NSAttributedString: How to display a line with different attribute and indent

How to split a string "5 + Bonus Ball" like: I'll be assigning this attributed string to label.
Hitesh Savaliya
  • 1,336
  • 13
  • 15
0
votes
4 answers

How to do Tag/Label/Text View?

I want to do something like this view (I don't know even name it) but I don't know where to start to do it the most efficient (the most less amount of code) way. I want to do this tag/label/text with same functionality like Apple Mail has. Facebook…
user500
  • 4,519
  • 6
  • 43
  • 56
0
votes
0 answers

Calculate intrinsicContentSize of UILabel, with exact precision

How can I use boundingRectWithSize:options:attributes:context: to return exactly the same size than intrinsicContentSize of a UILabel? For example, if I use it like below, I get differences of up to 1 pixel: const CGSize maxSize =…
hpique
  • 119,096
  • 131
  • 338
  • 476
0
votes
1 answer

iOS 7 Text Kit is skipping text in layout

I have a strange problem with new iOS 7 Text Kit. I created a very simple program to demonstrate. It reads the contents of a file which contains numbers 1 - 300 in a single column. It than displays the text one "page" at a time following taps on a…
RMH
  • 801
  • 2
  • 8
  • 17
0
votes
1 answer

Change the height of a row after the Ui has been displayed

In monotouch.dialog is it possible to alter the height of a row after the Ui has been displayed? The reason for this is that the UI is drawn and then once some text is passed back from a service I am populating a TextViewElement which uses Text Kit…
user156888
0
votes
1 answer

Concatenated NSAttributedString not rendering with correct formatting

I render a chunk of text in a NSAttributedString, already formatted with attributes that render correctly, into a multicolumn, multipage format using TextKit as follows: NSUInteger lastRenderedGlyph = 0; CGFloat currentXOffset = 0; float width =…
user2709279
  • 353
  • 1
  • 3
  • 15
0
votes
1 answer

NSAttributedString relative font-size custom attribute

In CSS, you have the font-size property that can be used to specify font sizes relative to the rest of the text. What would it take to implement a custom relative font-size attribute in iOS (requiring only iOS 7 compatibility)? Are there any…
EthanB
  • 4,239
  • 1
  • 28
  • 46
0
votes
1 answer

TypeKit vs NSAttributedString - can I use TextKit as a replacement for NSAttributedString when creating styled labels?

I want to style a label. Nothing crazy, just some coloring, changing of font-sizes for specific words, etc. I can do this with NSAttributedString, but would it be possible/better to do in TextKit, newly introduced with iOS 7? I've looked around, but…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
0
votes
1 answer

Change size of text in UITextView based on content of NSString

I am trying to load a UITextView with content from instances of a NSManagedObject subclass (verses in a Bible reader app). My UITextView is loaded by iterating through the verses in a selected chapter and appending each consecutive verse. NSArray…
Jeff Lewis
  • 135
  • 4
  • 11
-1
votes
1 answer

iOS full texteditor implementation example

I want to implement a technical editor and it on macOS i use NSTextInput and Core Text to do all the text stuff myself. But i can't find the NSTextInput equivalent on iOS? Are there examples how to avoid using WebKit or TextKit?
Lothar
  • 12,537
  • 6
  • 72
  • 121
-1
votes
3 answers

How to make link, phone number clickable (Same behaviour as in textview) in a custom view where i draw text?

I made a view and draw text on it and i want that if any text contains link(Hyperlink) or Phone Number It would be clickable (Same Behaviour As in Text View) So how to Achieve it ? Code For View In which i am Drawing Text :- class…
Amey
  • 795
  • 8
  • 31
-1
votes
1 answer

[TextKit]Why some special characters could make Chinese characters thinner and smaller

That happens on TextKit. But everything is all right when I use CoreText. The rich text in the debug window of Xcode also has the same issue. So, is it a bug of TextKit? Is there any solution in addition to replace TextKit by CoreText?
Swain
  • 21
  • 5
-1
votes
1 answer

How to decide where soft line-breaks occur with TextKit?

I'm trying to define where soft line breaks occur within my text, and the NSLayoutManagerDelegate method layoutManager(_:shouldBreakLineByWordBeforeCharacterAt:) seems like the place to start. My problem is it's not getting called, although my other…
mattsven
  • 22,305
  • 11
  • 68
  • 104
1 2 3
18
19