Why is it that the line height of the last line of text (in any quote with 3 or more lines) is greater than the line height of the above lines?
The issue is replicable at www.UXQuotes.com
Because Flash is weird. Now that doesn't help much, but Flash text rendering does have a few issues…
Related
I've a weird problem that faces me. I've a UILabel contains text of multiple lines and I'm using bullet in the first line "•".
But my problem is that the second line is not aligned with first character after the bullet.
I measured it and found that width of the bullet is a little bit bigger tan width of normal space.
Is there any trick for that?
the issue is concerning font attributes. Get into the difference of monospaced fonts and proportional fonts, then you will know why there's a difference between space and bullet in your font
https://en.wikipedia.org/wiki/Monospaced_font
easy solution and maybe really an option for you is to use a monospaced font.
Okay, I found a powerful answer by using NSParagraphStyle.
https://wingoodharry.wordpress.com/2016/04/10/bullet-point-list-ios-swift/
I am having trouble getting the text in the text area to span full width. Somehow it just won't stretch even if I adjust the number of columns.
Am I missing something?
EDIT: Problem solved. See my comment below.
Is there a property that will apply the proper character spacing to have all the text on each line in an NSAttributedString butt up against the bounds like in a book, (including the final line which I know isn't done in books)? I know kerning can be adjusted, but that won't dynamically adjust on a per line basis. Any help would be appreciated. Also NSTextAlignmentJustified and NSTextAlignmentNatural get close, but won't apply the effect to the last line of text.
The only option is to use NSTextAlignmentJustified. Last line is never justified, because NSTextAlignmentJustified refers to Left Justification mode, as it is the standard case.
For more information you can take a look at Typographic Alignment on wikipedia : http://en.wikipedia.org/wiki/Typographic_alignment
I'm working on an app where I need all lines of text to be Justified alignment. The app will display 2 lines of text over the top of an image, creating an Advert like feeling to the picture. The problem is that both these lines of text need to be justified, but the 2nd line of text will never be justified. Or if I draw both lines separately then neither will be justified.
If you specify kCTJustifiedTextAlignment in CoreText or NSJustifiedTextAlignment on NSTextField/View all but the last line of text are justified. The last line is aligned naturally.
Is there a way to force the final line of a textfield or textview to be justified, so fill the width of the view?
I've thought about using CTLine to draw each line separately, and specifying something on those to make all of them justified, but I'm not sure how to go about that either.
Thanks
Thanks to omz's comment I stumbled across CTLineCreateJustifiedLine, which gives me just what I wanted. I'd still be interested if someone has a solution using a Cocoa Control (NSTextView), but i'd be surprised if there was anything tbh.
CTLineRef line = CTLineCreateWithAttributedString((__bridge CFAttributedStringRef)attString);
line = CTLineCreateJustifiedLine(line, 1.0, dirtyRect.size.width);
CTLineDraw(line, context);
CFRelease(line);
I'm using sifr 3 and trying to fit h1's on a single line but within a set width of 400px. By default, if there's too much text, it drops onto the next line. I've used forceSingleLine: true but then the text just stretches across the 400px width. Is there a method which will resize the text to fit in the width AND stay on a single line?
Thanks
This was the behavior of sIFR 2, which resulted in inconsistent font sizes. This has been fixed in sIFR 3, so what you're trying to achieve is only possible in sIFR 2.
But what about the sIFR3 attribute "fitExactly", then?