UIFont(MBStringSizing) Category Reference
| Declared in | UIFont+MBStringSizing.h |
|---|
Measuring whole pixels with word wrapping
– sizeString:maxWidth:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidthParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeightParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSizeParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
Measuring fractional pixels with word wrapping
– sizeString:maxWidth:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSize fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
Measuring whole pixels with a specific line break mode
– sizeString:maxWidth:lineBreakMode:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth lineBreakMode:(NSLineBreakMode)lineModeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
lineMode |
The line break mode to use for measuring the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:lineBreakMode:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight lineBreakMode:(NSLineBreakMode)lineModeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
lineMode |
The line break mode to use for measuring the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:lineBreakMode:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSize lineBreakMode:(NSLineBreakMode)lineModeParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
lineMode |
The line break mode to use for measuring the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
Measuring fractional pixels with a specific line break mode
– sizeString:maxWidth:lineBreakMode:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth lineBreakMode:(NSLineBreakMode)lineMode fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
lineMode |
The line break mode to use for measuring the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:lineBreakMode:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight lineBreakMode:(NSLineBreakMode)lineMode fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
lineMode |
The line break mode to use for measuring the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:lineBreakMode:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSize lineBreakMode:(NSLineBreakMode)lineMode fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
lineMode |
The line break mode to use for measuring the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
Measuring whole pixels with a specific paragraph style
– sizeString:maxWidth:paragraphStyle:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth paragraphStyle:(nonnull NSParagraphStyle *)styleParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
style |
The paragraph style for the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:paragraphStyle:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight paragraphStyle:(nonnull NSParagraphStyle *)styleParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
style |
The paragraph style for the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:paragraphStyle:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSize paragraphStyle:(nonnull NSParagraphStyle *)styleParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
style |
The paragraph style for the text. |
Return Value
The size required to draw the text string, with the width and height components rounded up to the nearest integer (whole-pixel) value.
Declared In
UIFont+MBStringSizing.h
Measuring fractional pixels with a specific paragraph style
– sizeString:maxWidth:paragraphStyle:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth paragraphStyle:(nonnull NSParagraphStyle *)style fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
style |
The paragraph style for the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxWidth:maxHeight:paragraphStyle:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxWidth:(CGFloat)maxWidth maxHeight:(CGFloat)maxHeight paragraphStyle:(nonnull NSParagraphStyle *)style fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxWidth |
The maximum width allowed for the text. If |
maxHeight |
The maximum height allowed for the text. |
style |
The paragraph style for the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h
– sizeString:maxSize:paragraphStyle:fractional:
Calculates the size of the bounding rectangle required to draw a given text string in the font represented by the receiver.
- (CGSize)sizeString:(nonnull NSString *)str maxSize:(CGSize)maxSize paragraphStyle:(nonnull NSParagraphStyle *)style fractional:(BOOL)allowFractionalSizeParameters
str |
The text string to measure. |
|---|---|
maxSize |
The maximum size allowed for the text. If |
style |
The paragraph style for the text. |
allowFractionalSize |
If |
Return Value
The size required to draw the text string.
Declared In
UIFont+MBStringSizing.h