I have created a custom renderer as i wanted to use "SF Pro Display" font and using UIFont.SystemFontOfSize(size , weight) i get output as .SFUI-weight .Below is the code i used for custom font -
var descriptor = new UIFontDescriptor().CreateWithFamily("SF Pro Display");
if ((attributes & FontAttributes.Bold) != 0)
{
var traits = (UIFontDescriptorSymbolicTraits) 0;
traits = traits | UIFontDescriptorSymbolicTraits.Bold;
descriptor = descriptor.CreateWithTraits(traits);
Control.Font = UIFont.FromDescriptor(descriptor, (nfloat) label.FontSize);
}
Here the problem is FontAttributes and UIFontDescriptorSymbolicTraits only provide options as Bold,Italic and i wanted Semibold ,Medium ,regular also .I have gone through some similar question but solution are in Swift and those in-build methods are not in C#.By above code i get output SFProDisplay-Bold similarly i want for SFProDisplay-Medium etc.
Went through this below links, How can I get weight of a UILabel? iOS - How to detect whether a font is bold/black/heavy...?
Actually, I cannnot find addingAttributes method for FontDescriptor. So you may try the following code as an alternative:
Hope it works for you.