mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Move font helpers to RCTFont
Reviewed By: majak Differential Revision: D3662804 fbshipit-source-id: 2c03a094a74c617c0d6172e327bd77d23d0d44c2
This commit is contained in:
committed by
Facebook Github Bot 2
parent
e30327cb13
commit
c5a44b7ca3
@@ -13,6 +13,7 @@
|
||||
#import "RCTConvert.h"
|
||||
#import "RCTShadowView.h"
|
||||
#import "RCTTextView.h"
|
||||
#import "RCTFont.h"
|
||||
|
||||
@implementation RCTTextViewManager
|
||||
|
||||
@@ -47,19 +48,19 @@ RCT_EXPORT_VIEW_PROPERTY(selectTextOnFocus, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(text, NSString)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontSize, CGFloat, RCTTextView)
|
||||
{
|
||||
view.font = [RCTConvert UIFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
|
||||
view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];
|
||||
}
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, RCTTextView)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused RCTTextView)
|
||||
{
|
||||
view.font = [RCTConvert UIFont:view.font withWeight:json]; // defaults to normal
|
||||
view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal
|
||||
}
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, RCTTextView)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused RCTTextView)
|
||||
{
|
||||
view.font = [RCTConvert UIFont:view.font withStyle:json]; // defaults to normal
|
||||
view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal
|
||||
}
|
||||
RCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextView)
|
||||
{
|
||||
view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName];
|
||||
view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];
|
||||
}
|
||||
RCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)
|
||||
RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, textView.dataDetectorTypes, UIDataDetectorTypes)
|
||||
|
||||
Reference in New Issue
Block a user