Two methods for programmatically adding a bulleted list to an NSTextView:
Method 1:
The following links led me to this first method, but its overly circular motion if you don't want to use some special non-Unicode character for the bullet:
This requires: (1) a subclass layout manager that replaces the marker marker for some arbitrary character; and (2) the paragraph style with firstLineHeadIndent, the tab is slightly larger than this indent, and headIndent for wrapped lines that combine the two.
The layout manager is as follows:
Assign the layout manager to the text view in your awakeFromNib viewport / view controllers, for example:
- (void) awakeFromNib {
And then add a method something like this:
- (void) addProgressTickerLine:(NSString *)string inStyle:(uint8_t)uiStyle {
Check this:
NSString *sTicker = NSLocalizedString(@"First normal line of ticker should wrap to left margin", @"First normal line of ticker should wrap to left margin"); [self addProgressTickerLine:sTicker inStyle:kTickerStyleNormal]; sTicker = NSLocalizedString(@"Indented ticker line should have bullet point and should wrap farther to right.", @"Indented ticker line should have bullet point and should wrap farther to right."); [self addProgressTickerLine:sTicker inStyle:kTickerStyleIndent]; sTicker = NSLocalizedString(@"Try a second indented line, to make sure both line up.", @"Try a second indented line, to make sure both line up."); [self addProgressTickerLine:sTicker inStyle:kTickerStyleIndent]; sTicker = NSLocalizedString(@"Final bold line", @"Final bold line"); [self addProgressTickerLine:sTicker inStyle:kTickerStyleBold];
You get the following:

Method 2:
But the bullet is a regular Unicode char, in hexadecimal format 2022. Thus, you can put it in a string directly and get an exact measurement, for example:
NSString *stringWithGlyph = [NSString stringWithUTF8String:"\u2022"]; NSString *stringWithGlyphPlusSpace = [stringWithGlyph stringByAppendingString:@" "]; NSSize sizeGlyphPlusSpace = [stringWithGlyphPlusSpace sizeWithAttributes:[NSDictionary dictionaryWithObject:self.fontIndent forKey:NSFontAttributeName]]; self.fWidthGlyphPlusSpace = sizeGlyphPlusSpace.width;
Therefore, there is no need for a custom layout manager. Just indent paragStyle as above and add a text line to the line containing the line return + bullet char + space (or + tab, in which case you still want this tab to stop).
Using a space, this led to a denser result:

Want to use a character other than a bullet? Here is a good Unicode graph: http://www.danshort.com/unicode/