Skip to content

Commit

Permalink
feat(ios): set default font size to 14
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonelmy authored and zoomchan-cxj committed Feb 9, 2022
1 parent 462eae8 commit 0ac9398
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/sdk/component/text/HippyShadowText.mm
Expand Up @@ -42,6 +42,8 @@
CGFloat const HippyTextAutoSizeHeightErrorMargin = 0.025f;
CGFloat const HippyTextAutoSizeGranularity = 0.001f;

static const CGFloat gDefaultFontSize = 14.f;

@implementation HippyShadowText
// MTTlayout
static MTTSize x5MeasureFunc(
Expand Down Expand Up @@ -357,6 +359,10 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily
if (_fontSize && !isnan(_fontSize)) {
fontSize = @(_fontSize);
}
else if (nil == fontSize) {
//default font size is 14
fontSize = @(gDefaultFontSize);
}
if (_fontWeight) {
fontWeight = _fontWeight;
}
Expand Down

0 comments on commit 0ac9398

Please sign in to comment.