TSMessages icon indicating copy to clipboard operation
TSMessages copied to clipboard

Customize button font via design.json

Open jkrzemie opened this issue 12 years ago • 5 comments

All fonts can be nicely configured via the design.json file aside from the button which was hardcoded to a bold system font of size 14.0.

jkrzemie avatar Sep 27 '13 10:09 jkrzemie

This would be better if we added an option to fall back on [UIFont preferredFontForTextStyle:UIFontTextStyleBody] if the user's OS supports dynamic text sizing.

getaaron avatar Sep 27 '13 15:09 getaaron

@getaaron Yes, that would make sense. TSMessages needs more updates for better iOS 7 support/design, like new icons and no font shadow. @jkrzemie The code does not work when I set a font family and no font size. Also the default values of the configuration file should match the default design.

KrauseFx avatar Sep 28 '13 15:09 KrauseFx

Isn't it true for all fonts? I reused existing code which goes smth like this both for title & content labels:

CGFloat fontSize = [[current valueForKey:SOME_FONT_SIZE] floatValue];
NSString *fontName = [current valueForKey:SOME_FONT_NAME];
if (fontName != nil) {
    [SOME_LABEL setFont:[UIFont fontWithName:fontName size:fontSize]];
} else {
    [SOME_LABEL setFont:[UIFont boldSystemFontOfSize:fontSize]];
}

jkrzemie avatar Oct 10 '13 16:10 jkrzemie

When we change something in the font system, we should use the proper iOS 7 API as @getaaron mentioned. I have not yet tested how TSMessageView behaves when the text height changes.

KrauseFx avatar Oct 10 '13 19:10 KrauseFx

Hi, will this be merged to the main repo? It would be nice to be able to set a font of the title / subtitle even if it wasn't tested

JanC avatar May 16 '14 11:05 JanC