Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSMutableParagraphStyleMBS.addTabStop(tabstop as NSTextTabMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Adds tabStop to the receiver.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: The constructor.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.removeTabStop(tabstop as NSTextTabMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Removes the first text tab whose location and type are equal to those of tabStop.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setAlignment(alignment as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the alignment of the receiver to alignment.
Example:
dim n as NSParagraphStyleMBS = NSParagraphStyleMBS.defaultParagraphStyle
MsgBox str(n.alignment) // 4 = natural

dim m as NSMutableParagraphStyleMBS = n.mutableCopy
m.setAlignment NSParagraphStyleMBS.NSCenterTextAlignment
MsgBox str(m.alignment) // 2 = center
Notes:
alignment may be one of:

NSLeftTextAlignment
NSRightTextAlignment
NSCenterTextAlignment
NSJustifiedTextAlignment
NSNaturalTextAlignment

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setBaseWritingDirection(writingDirection as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the base writing direction for the receiver.
Notes: It can be NSWritingDirectionNaturalDirection, NSWritingDirectionLeftToRight, or NSWritingDirectionRightToLeft. If you specify NSWritingDirectionNaturalDirection, the receiver resolves the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, depending on the direction for the user's language preference setting.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setDefaultTabInterval(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the default tab interval for the receiver.
Notes: Tabs after the last specified in tabStops are placed at integral multiples of this distance. This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setFirstLineHeadIndent(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the distance in points from the leading margin of a text container to the beginning of the paragraph's first line to value.
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setHeaderLevel(level as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Specifies whether the paragraph is to be treated as a header for purposes of HTML generation.
Notes: Should be set to 0 (the default value) if the paragraph is not a header, or from 1 through 6 if the paragraph is to be treated as a header.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setHeadIndent(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the distance in points from the leading margin of a text container to the beginning of lines other than the first to value.
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setHyphenationFactor(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Specifies the threshold for hyphenation.
Notes: Valid values lie between 0.0 and 1.0 inclusive. The default value is 0.0. Hyphenation is attempted when the ratio of the text width (as broken without hyphenation) to the width of the line fragment is less than the hyphenation factor. When the paragraph's hyphenation factor is 0.0, the layout manager's hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setLineBreakMode(mode as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the mode used to break lines in a layout container to mode.
Notes:
The mode parameter may be one of:

NSLineBreakByWordWrapping
NSLineBreakByCharWrapping
NSLineBreakByClipping
NSLineBreakByTruncatingHead
NSLineBreakByTruncatingTail
NSLineBreakByTruncatingMiddle
See the description of lineBreakMode in the NSParagraphStyle class specification for descriptions of these values.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setLineHeightMultiple(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the line height multiple for the receiver.
Notes: The natural line height of the receiver is multiplied by this factor before being constrained by minimum and maximum line height. This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setLineSpacing(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the space in points added between lines within the paragraph to value.
Example:
// works for Labels, TextArea and TextFields

// control is either a textfield or a textview
dim n as NSTextFieldMBS = me.NSTextFieldMBS
dim v as NSTextViewMBS = me.NSTextViewMBS

// get text with attributes
dim a as NSAttributedStringMBS

if n<>Nil then
a = n.attributedStringValue
elseif v<>nil then
a = v.textStorage
end if

// get style
dim p as NSParagraphStyleMBS

try
p = a.attributeAtIndex(a.NSParagraphStyleAttributeName, 0)
catch ex as NSExceptionMBS
// we have none, so make one
p = new NSParagraphStyleMBS
end try

// modify it
dim m as NSMutableParagraphStyleMBS = p.mutableCopy
m.setLineSpacing 5

// add back to styled text
dim s as NSMutableAttributedStringMBS = a.mutableCopy
s.addAttribute(a.NSParagraphStyleAttributeName, m, new NSRangeMBS(0, s.length))

// and apply to control
if n<>Nil then
n.attributedStringValue = s
elseif v<>nil then
v.textStorage.setAttributedString s
end if
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setMaximumLineHeight(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the maximum height that any line in the paragraph style will occupy, regardless of the font size or size of any attached graphic, to value.
Notes:
Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. This value must be nonnegative.

Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setMinimumLineHeight(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the minimum height that any line in the paragraph style will occupy, regardless of the font size or size of any attached graphic, to value.
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setParagraphSpacing(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the space added at the end of the paragraph to separate it from the following paragraph to value.
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setParagraphSpacingBefore(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the distance between the paragraph's top and the beginning of its text content.
Notes: This value must be nonnegative.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setParagraphStyle(ParagraphStyle as NSParagraphStyleMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Replaces the subattributes of the receiver with those in ParagraphStyle.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setTabStops(tabStops() as NSTextTabMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Replaces the tab stops in the receiver with tabStops.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setTailIndent(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Sets the distance in points from the margin of a text container to the end of lines to value.
Notes:
If positive, this is the distance from the leading margin (for example, the left margin in left-to-right text). That is, it's the absolute line width. If 0 or negative, it's the distance from the trailing margin—the value is added to the line width.

For example, to create a paragraph style that fits exactly in a 2-inch wide container, set its head indent to 0.0 and its tail indent to 0.0. To create a paragraph style with quarter-inch margins, set its head indent to 0.25 and its tail indent to –0.25.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setTextLists(TextLists() as NSTextListMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 18.1 Yes No No Yes, macOS only No
Function: Sets the text lists containing the paragraph.

Feedback, Comments & Corrections

NSMutableParagraphStyleMBS.setTighteningFactorForTruncation(value as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Cocoa MBS MacCocoa Plugin 12.4 Yes No No Yes, macOS only No
Function: Specifies the threshold for using tightening as an alternative to truncation.
Notes: When the line break mode specifies truncation, the text system attempts to tighten intercharacter spacing as an alternative to truncation, provided that the ratio of the text width to the line fragment width does not exceed 1.0 + the value returned by tighteningFactorForTruncation. Otherwise the text is truncated at a location determined by the line break mode. The default value is 0.05. This method accepts positive and negative values. Values less than or equal to 0.0 result in not tightening.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCocoa Plugin.




Links
MBS Xojo Plugins