mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
adjust font size to make text fit within constrained size
# Conflicts: # AsyncDisplayKit/ASTextNode.mm
This commit is contained in:
@@ -58,6 +58,7 @@ struct ASTextKitAttributes {
|
||||
NSLineBreakMode lineBreakMode;
|
||||
/**
|
||||
The maximum number of lines to draw in the drawable region. Leave blank or set to 0 to define no maximum.
|
||||
This is required to apply scale factors to shrink text to fit within a number of lines
|
||||
*/
|
||||
NSUInteger maximumNumberOfLines;
|
||||
/**
|
||||
@@ -82,9 +83,13 @@ struct ASTextKitAttributes {
|
||||
*/
|
||||
CGFloat shadowRadius;
|
||||
/**
|
||||
The minimum scale that the textnode can apply to fit long words in constrained size.
|
||||
An array of scale factors in descending order to apply to the text to try to make it fit into a constrained size.
|
||||
*/
|
||||
CGFloat minimumScaleFactor;
|
||||
NSArray *pointSizeScaleFactors;
|
||||
/**
|
||||
The currently applied scale factor. Only valid if pointSizeScaleFactors are provided. Defaults to 0 (no scaling)
|
||||
*/
|
||||
CGFloat currentScaleFactor;
|
||||
/**
|
||||
A pointer to a function that that returns a custom layout manager subclass. If nil, defaults to NSLayoutManager.
|
||||
*/
|
||||
@@ -112,8 +117,10 @@ struct ASTextKitAttributes {
|
||||
[shadowColor copy],
|
||||
shadowOpacity,
|
||||
shadowRadius,
|
||||
minimumScaleFactor,
|
||||
layoutManagerFactory
|
||||
pointSizeScaleFactors,
|
||||
currentScaleFactor,
|
||||
layoutManagerFactory,
|
||||
layoutManagerDelegate,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -124,7 +131,8 @@ struct ASTextKitAttributes {
|
||||
&& maximumNumberOfLines == other.maximumNumberOfLines
|
||||
&& shadowOpacity == other.shadowOpacity
|
||||
&& shadowRadius == other.shadowRadius
|
||||
&& minimumScaleFactor == other.minimumScaleFactor
|
||||
&& [pointSizeScaleFactors isEqualToArray:other.pointSizeScaleFactors]
|
||||
&& currentScaleFactor == currentScaleFactor
|
||||
&& layoutManagerFactory == other.layoutManagerFactory
|
||||
&& CGSizeEqualToSize(shadowOffset, other.shadowOffset)
|
||||
&& _objectsEqual(exclusionPaths, other.exclusionPaths)
|
||||
|
||||
Reference in New Issue
Block a user