TomThorpe / TTRangeSlider

A slider, similar in style to UISlider, but which allows you to pick a minimum and maximum range.
MIT License
968 stars 204 forks source link

Wrong font on iOS 13 #99

Closed tdimeco closed 4 years ago

tdimeco commented 5 years ago

Hi,

There is a small issue on iOS 13 GM: The font of the min/max labels seems to be set to Times New Roman instead of the system default one, San Francisco.

iOS 12: ios-12

iOS 13: ios-13

Using rangeSlider.minLabelFont or rangeSlider.maxLabelFont has no effect.

Also, the console prints the following message:

CoreText performance note: Client called CTFontCreateWithName() using name ".SFUI-Regular" and got font with PostScript name "TimesNewRomanPSMT". For best performance, only use PostScript names when calling this API.
CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.

Thank you.

ghost commented 4 years ago

+1

immago commented 4 years ago

Fix: remove .fontName

-(void)setMinLabelFont:(UIFont *)minLabelFont{
    _minLabelFont = minLabelFont;
    self.minLabel.font = (__bridge CFTypeRef)_minLabelFont;
    self.minLabel.fontSize = _minLabelFont.pointSize;
}

-(void)setMaxLabelFont:(UIFont *)maxLabelFont{
    _maxLabelFont = maxLabelFont;
    self.maxLabel.font = (__bridge CFTypeRef)_maxLabelFont;
    self.maxLabel.fontSize = _maxLabelFont.pointSize;
}
TomThorpe commented 4 years ago

Thanks - If people can confirm this works and someone wants to PR it I'll be happy to approve it 👍

tdimeco commented 4 years ago

CATextLayer.font documentation prohibits the use of UIFont. But it actually seems to work. However, in the sample Demo, the $ character is missing in iOS 13. Maybe it's related to the use of UIFont?

iOS 12

iOS 12

iOS 13

iOS 13
tdimeco commented 4 years ago

The missing $ caracter is actually an issue with the iOS simulator, so forget about it ;)

Alasker commented 4 years ago

Thanks - If people can confirm this works and someone wants to PR it I'll be happy to approve it 👍

Tested on iPhoneXr running iOS13.3.1. Problem visible before the fix, gone after applying it.

TomThorpe commented 4 years ago

Thanks - I’ve merged that PR

tdimeco commented 4 years ago

Thanks! :-) Maybe a 1.0.7 version should be released?