Questions tagged [nslayoutmanager]

Glyph layout engine in iOS and OSX

Responsible for converting characters drawn from NSTextStorage and laying them out as glyphs following the display/geometric constraints provided by one or more NSTextContainer.

120 questions
0
votes
0 answers

Is there any way to filter out certain ranges with NSLayoutManager?

We have an NSTextView that could possibly contains large amounts of text. I'm using it to replace an NSTableView, which was far too slow when it was generating thousands of rows. We also have an NSSearchField, which used to apply its predicate to…
0
votes
0 answers

Trouble aligning baselines of NSLayoutManager

I'm developing a custom UIView that renders text using a number of separate NSLayoutManager objects. (This view has text positioning requirements beyond what the built-in text view classes can support.) I'm having a hard time getting the correct…
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
0
votes
1 answer

Changes to NSTextView not reaching screen

I have an NSTextView backed by a text system I put together myself, along the lines of the "Assembling the Text System by Hand" section in the Text System Overview in the Cocoa documentation. It successfully displays the contents of the…
Becca Royal-Gordon
  • 17,541
  • 7
  • 56
  • 91
0
votes
1 answer

Text garbled when using NSTextContainer/NSLayoutManager with UITextView

I'm implementing paged text and so I'm using NSLayoutManager and NSTextContainer to create UITextViews for each page. The paging is working fine, but the text is garbled. When setting the same NSTextStorage on a vanilla UITextView it appears…
arsenius
  • 12,090
  • 7
  • 58
  • 76
0
votes
1 answer

NSLayoutManager behavior?

I have an NSLayoutManager, two NSTextContainers, and an NSTextStorage object. I add strings one by one to the textStorage object until the first textContainer is full, then I use the amount of text added to that textContainer draw a page in my book…
user714171
  • 363
  • 1
  • 3
  • 12
0
votes
1 answer

Attempting to Apply NSMutableParagraphStyle to new NSRange Failing

All, I'm tweaking an NSTextView to basically support insertion of boiler plate text and indenting. I'm running into a problem where the indenting of boiler plate text is applied to non-boiler plate text after I remove the boiler plate indenting…
John Gordon
  • 2,181
  • 5
  • 28
  • 47
0
votes
0 answers

Programmatically select text in UITextView, in layout manager which has multiple text containers

If there is only one TextContainer in the layout manager then OS will be handling the User interactions. But with multiple text containers in place, I read somewhere that its not out of the box. Here are some the things that I have already used with…
pavan309
  • 338
  • 1
  • 10
0
votes
0 answers

ensure layout in NSLayoutManager

I have a UITextView with lots of text. The scrolling is mostly smooth on iPhones 4, 5, and 6, but on the 6 Plus there is lots of stuttering. (I believe this is because the 6 Plus is underpowered for the amount of pixels it has to push around). I…
Casey Perkins
  • 1,853
  • 2
  • 23
  • 41
0
votes
1 answer

How to paint background of specific range of text in NSTextView

This is not a specific bug, its more about not knowing how to do something. I've an NSTextView and I need to paint the background of specific ranges of text when the user clicks on a specific part of the text view. I've tried this but I just get…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
0
votes
0 answers

iOS detect tapped character

Hello i gave a string that is: [102,103] [207] I have added TapGestureRecognizer to the string, and want to detect on which character user tapped, here is my code: - (void)handleTapFrom: (UITapGestureRecognizer *)recognizer { if…
Developer
  • 4,158
  • 5
  • 34
  • 66
0
votes
1 answer

Stop text from wrapping with NSLayoutManager

Given any arbitrary, one-line string, my goal is to render it into a bitmap representation. However, I have no means of finding out its dimensions beforehand, so I am reduced to getting the glyph range's bounding rect and resizing my canvas if it's…
Josh Matthews
  • 12,816
  • 7
  • 36
  • 39
0
votes
1 answer

iOS7 Type into UITextView with Line Spacing and keep formatting using TextKit

I came across this great example which helped me understand how I can achieve line spacing / paragraph spacing as you type inside a UITextView with iOS7, however there is a problem and I am hoping someone can help me with resolving an issue as I am…
Wael
  • 489
  • 6
  • 19
0
votes
1 answer

how to insert extra glyphs?

I want to an UITextView to switch between two display modes. In mode 1 it should show abbreviations and in the full word in mode 2. For example "Abbr." vs "abbreviation". What would be the best way to do this? Keeping in mind that some words can…
user965972
  • 2,489
  • 2
  • 23
  • 39
0
votes
1 answer

How to create skype like message window?

I am just trying to design skype like message window , for this I have taken the NSDrawer element. It contains : a table view on left, menu items on top, text field on right bottom and text view at central portion on right side. Using text view I…
Devarshi
  • 16,440
  • 13
  • 72
  • 125
-1
votes
1 answer

Calculating Text Height as per Apple Documentation

I followed this to try and determine the height of a container I would need before placing text in a CATextLayer. However, I am not getting the expected results. The returned NSRect is (0.0, 0.0, 0.0, 0.0). What am I doing wrong? func…
SouthernYankee65
  • 1,129
  • 10
  • 22
1 2 3 4 5 6 7
8