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-14565] iOS: Fix default font-sizes (parity) #9182

Merged
merged 3 commits into from
Jul 13, 2017
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
8 changes: 2 additions & 6 deletions iphone/Classes/TiUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ +(WebFont*)fontValue:(id)value def:(WebFont *)def
{
WebFont *font = [[WebFont alloc] init];
font.family = value;
font.size = 14;
font.size = 17;
return [font autorelease];
}
return def;
Expand All @@ -1334,11 +1334,7 @@ +(WebFont*)fontValue:(id)value def:(WebFont *)def

+(WebFont*)fontValue:(id)value
{
WebFont * result = [self fontValue:value def:nil];
if (result == nil) {
result = [WebFont defaultFont];
}
return result;
return [self fontValue:value def:[WebFont defaultFont]];
}

+(TiScriptError*) scriptErrorValue:(id)value;
Expand Down
7 changes: 2 additions & 5 deletions iphone/Classes/WebFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
Provides access to the Text Style.
*/
@property(nonatomic, readonly) NSString *textStyle;

/**
Returns underlying font object.
@return The font
Expand All @@ -83,17 +84,13 @@
@return _YES_ if the update operation succeeded, _NO_ otherwise.
*/
-(BOOL)updateWithDict:(NSDictionary *)fontDict inherits:(WebFont *)inheritedFont;

/**
Indicates if the style specified by the string is a valid value for textStyle
@param theStyle The String to check
@return _YES_ is it is a valid value for textStyle, _NO_ otherwise
*/
-(BOOL)isValidTextStyle:(NSString*)theStyle;
/**
Returns table row font.
@return The table row font.
*/
+(WebFont *)tableRowFont;

/**
Returns the default text font.
Expand Down
25 changes: 8 additions & 17 deletions iphone/Classes/WebFont.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ -(void)dealloc

-(CGFloat) size
{
if (size < 4)
{
size=14;
}
return size;
if (size < 4) {
size = 17;
}
return size;
}

-(BOOL) isSizeNotSet
Expand Down Expand Up @@ -324,15 +323,15 @@ -(BOOL)updateWithDict:(NSDictionary *)fontDict inherits:(WebFont *)inheritedFont
+(WebFont *)defaultBoldFont
{
WebFont * result = [[self alloc] init];
result.size = 15;
result.size = 17;
result.isBoldWeight = YES;
return [result autorelease];
}

+(WebFont *)defaultItalicFont
{
WebFont * result = [[self alloc] init];
result.size = 15;
result.size = 17;
result.isItalicStyle = YES;
return [result autorelease];
}
Expand All @@ -341,24 +340,16 @@ +(WebFont *)defaultItalicFont
+(WebFont *)defaultFont
{
WebFont * result = [[self alloc] init];
result.size = 15;
result.size = 17;
return [result autorelease];
}

+(WebFont *)fontWithName:(NSString*)name
{
WebFont * result = [[[self alloc] init] autorelease];
result.family = [[name copy] autorelease];
result.size = 15;
result.size = 17;
return result;
}

+(WebFont *)tableRowFont
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why deleted ?

Copy link
Collaborator Author

@hansemannn hansemannn Jul 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused since the iOS 7 release was created, just a quick clean-up.

{
WebFont * result = [[self alloc] init];
result.isBoldWeight = YES;
result.size = 20;
return [result autorelease];
}

@end