Questions tagged [nsparagraphstyle]
49 questions
1
vote
1 answer
Get NSParagraphStyle of UILabel
Is there any way to get the NSParagraphStyle of an UILabel instead of creating a new instance and settings every attribute?

Iulian Onofrei
- 9,188
- 10
- 67
- 113
1
vote
0 answers
UITextView, lineHeightMultiple below 1 clips text, clipsToBounds = false doesnt work
text is getting clipped in a UITextView when I set the lineHeightMultiple property to less than 1 in paragraphStyle attribute. setting the clipsToBounds = false for UITextView doesnt seem to have any effect.
I want something like this
Any kind of…

Padma
- 83
- 7
1
vote
0 answers
How to set and maintain attributes on subranges of text in NSTextView as user edits the text?
I'd like to have custom line wrapping behavior for subranges of text in my NSTextView. Specifically, I'd like lines that look like list items (start with zero or more characters of leading whitespace, then a bullet character, then a space, then a…

sam
- 3,399
- 4
- 36
- 51
1
vote
1 answer
Get right point of glyph in NSLayoutManager with linebreak-mode enabled
I'm trying to get an actual point of selected character in NSTextContainer:
func handleTouch(gestureRecognizer: UIGestureRecognizer) {
var location = gestureRecognizer.locationInView(self)
let startPoint =…

Jauzee
- 120
- 2
- 18
1
vote
1 answer
lineSpacing property inside UILabel doesn't work as expected
I am trying to create a custom UILabel class which will allow me to increase the line spacing on a UILabel. I know you can do this in IB with an attributed text string, however it doesn't work if you are using custom fonts. Here is my class…

jowie
- 8,028
- 8
- 55
- 94
0
votes
0 answers
How to distinguish between bullet list and number list from word document using python?
I am trying to deep copy contents from source.docx file to output.docx file. However, I am not getting exact paragraph style in destination document especially bullet list and number list is not getting displayed with text content.
My source.docx is…

Jasleen Kaur
- 3
- 5
0
votes
0 answers
How can I use NSParagraphStyle to create a bulleted list in UITextView?
I'm trying to support bulleted list formatting in a UITextView in my app. I've googled around and found various answers to questions (like here) that suggest using NSParagraphStyle. Right now to make a given line bullet-formatted, I'm prepending a…

Tom Hamming
- 10,577
- 11
- 71
- 145
0
votes
0 answers
Text Wrapping not happening as it should in NSTextField Attributed String
I am having an issue with text not wrapping correctly if there is a single quote, or macOS ASCII Extended Character #213 (shift+opt.+]) in a string.
Apple does not escape the media item title string when it is retrieved through the iTunesLibrary…

SouthernYankee65
- 1,129
- 10
- 22
0
votes
0 answers
Appearance contradicts Code, In Simple AttributedString NSParagraphStyle Displayed In UITextView
I'm trying to parse a markdown string manually and create an attributedString for UITextView
When I try to format code blocks, I found some weird bug that I can't solve. I've reduced the problem to this minimum amount of demo code. I hope someone…

Goatt
- 111
- 8
0
votes
1 answer
iOS why NSParagraphStyle resets the original text styles
I use UILabel's attributedText to load a HTML string, for example:
sometext
And I use NSParagraphStyle to change the line-height of all elements of this HTML. NSMutableParagraphStyle *paragraphStyle =…
Jaycee
- 23
- 5
0
votes
1 answer
NSTextField with condensed font line spacing…
I'm trying to understand how to properly display text with condensed line spacing in a text field. When I set paragraph style properties lineHeightMultiple, maximumLineHeight, and minimumLineHeight I can achieve the effect of condensing the lines,…

Larvell Jones
- 159
- 2
- 15
0
votes
0 answers
Swift 3 NSTextView with long line breaks when including tabs
I have a NSTextView to display long lines of numeric data, separated by tabs.
I cannot prevent the line break after a fixed length.
As a test. I use to Strings:
Displaying a long line of pure textA works fine:
TextB breaks the line after 9…

heimi
- 499
- 7
- 16
0
votes
0 answers
Can't change Paragraph attributes and String Attributes at the same time
I can get either the NSMutableParagraphStyle line spacing working OR the NSMutableAttributedString to be the correct font,color and size, but I can't get them both at the same time.
let style = NSMutableParagraphStyle()
style.lineSpacing = 5
let…

Nick
- 71
- 2
- 11
0
votes
0 answers
How to approach for creation of below Custom View?
I have a view as below. Which have dynamic image whose height can vary and the text on right side of image and below the image. Both text should come as paragraph as we see in textbook. So what is best approach to achieve this. Is it possible to…

Sanoj Kashyap
- 5,020
- 4
- 49
- 75
0
votes
1 answer
how to set NSMutableParagraphStyle firstLineHeadIndent for just first paragraph
I want set firstLineHeadIndent for only first paragraph for a multi-paragraph UILabel, how can I do
NSMutableParagraphStyle *paragraphStype = [[NSMutableParagraphStyle alloc] init];
paragraphStype.firstLineHeadIndent = 10.0f;
[att…

user2645382
- 21
- 5