Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18407] changed attributedString font property #6590

Merged
merged 1 commit into from
Jan 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,18 @@ public static String[] getFontProperties(KrollDict fontProps)
bFontSet = true;
fontProperties[FONT_WEIGHT_POSITION] = TiConvert.toString(fontProps, TiC.PROPERTY_FONT_WEIGHT);
}
if (fontProps.containsKey(TiC.PROPERTY_FONTFAMILY)) {
bFontSet = true;
fontProperties[FONT_FAMILY_POSITION] = TiConvert.toString(fontProps, TiC.PROPERTY_FONTFAMILY);
}
if (fontProps.containsKey(TiC.PROPERTY_FONTSIZE)) {
bFontSet = true;
fontProperties[FONT_SIZE_POSITION] = TiConvert.toString(fontProps, TiC.PROPERTY_FONTSIZE);
}
if (fontProps.containsKey(TiC.PROPERTY_FONTWEIGHT)) {
bFontSet = true;
fontProperties[FONT_WEIGHT_POSITION] = TiConvert.toString(fontProps, TiC.PROPERTY_FONTWEIGHT);
}
if (fontProps.containsKey(TiC.PROPERTY_FONTSTYLE)) {
bFontSet = true;
fontProperties[FONT_STYLE_POSITION] = TiConvert.toString(fontProps, TiC.PROPERTY_FONTSTYLE);
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/TiUIAttributedStringProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ -(void)addAttribute:(id)args

case AttributeNameFont:
attrName = NSFontAttributeName;
WebFont *strFont = [TiUtils fontValue:[value valueForKey:@"font"] def:[WebFont defaultFont]];
WebFont *strFont = [TiUtils fontValue:value def:[WebFont defaultFont]];
attrValue = [strFont font];
break;

Expand Down
5 changes: 3 additions & 2 deletions iphone/Classes/TiUIiOSAttributedStringProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ -(void)addAttribute:(id)args
switch ([type integerValue]) {

case AttributeNameFont:
attrName = NSFontAttributeName;
attrValue = [[TiUtils fontValue:value] font];
attrName = NSFontAttributeName;
WebFont *strFont = [TiUtils fontValue:value def:[WebFont defaultFont]];
attrValue = [strFont font];
break;

case AttributeNameParagraphStyle:
Expand Down