I have a subclass of UIButton
that uses a custom font. The problem is that capital letters don't show diaeresis.
Below there are images of the same button sample with and without the custom font. I set the title's background color to red to see what is going on.
Without custom font
With custom font
My UIButton
subclass overrides awakeFromNib
- (void)awakeFromNib
{
[super awakeFromNib];
UIFont *font = [UIFont fontWithName:@"TitilliumText22L-Bold" size:self.titleLabel.font.pointSize];
self.titleLabel.font = font;
}
Can anyone tell me what to do in order to show the diaeresis on top of capital letters?
Thanks.
I solved this problem by following this answer on the question shared by Bob https://stackoverflow.com/a/8314197/617787
The only thing to be aware of this solution (changing the "ascender" of the font file) is that the space between lines on multiline UILabels using this modified font will change as well, so you might use NSAttributedString to modify it in a per case basis.
Easy and best solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With