mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-29 21:25:00 +00:00
Fix fontWeight and fontStyle
This commit is contained in:
@@ -14,10 +14,8 @@
|
||||
NSString * fontSize_;
|
||||
NSString *fontFamily;
|
||||
enum FontStyle fontStyle;
|
||||
NSString * fontStyle_;
|
||||
NSDictionary * fontData;
|
||||
enum FontWeight fontWeight;
|
||||
NSString * fontWeight_;
|
||||
NSString *fontFeatureSettings;
|
||||
enum FontVariantLigatures fontVariantLigatures;
|
||||
enum TextAnchor textAnchor;
|
||||
|
||||
@@ -9,7 +9,7 @@ enum FontWeight FontWeightFromString( NSString* s )
|
||||
{
|
||||
const NSUInteger l = sizeof(FontWeightStrings) / sizeof(NSString*);
|
||||
for (NSUInteger i = 0; i < l; i++) {
|
||||
if ([s isEqualToString:FontWeightStrings[i]]) {
|
||||
if ([[s capitalizedString] isEqualToString:FontWeightStrings[i]]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,9 @@
|
||||
{
|
||||
NSString *fontFamily = topFont_->fontFamily;
|
||||
NSNumber * fontSize = [NSNumber numberWithDouble:topFont_->fontSize];
|
||||
NSString * fontWeight = topFont_->fontWeight_;
|
||||
NSString * fontStyle = topFont_->fontStyle_;
|
||||
|
||||
NSString * fontWeight = [FontWeightToString(topFont_->fontWeight) lowercaseString];
|
||||
NSString * fontStyle = FontStyleStrings[topFont_->fontStyle];
|
||||
|
||||
BOOL fontFamilyFound = NO;
|
||||
NSArray *supportedFontFamilyNames = [UIFont familyNames];
|
||||
|
||||
Reference in New Issue
Block a user