Search code examples
androidiosreactjsreact-nativenative

React Native Custom Font Extra Padding


I am using a custom font (Cairo) for both Android & IOS. The font rendered with an extra padding for both platforms like the following

sample one

When I tried to set lineHeight=[fontSize] I got the following

sample two

I tried to set lineGap=0 following this article: Consistent font line height rendering but I find that it's already ZERO

Also tried the paddingTop solution but it's not working at all just shift the text down with the bottom space like the above images

Hope anyone can help :)


Solution

  • I ended up doing something like that:

    fontSize: 15,
    lineHeight: 15 * 1.4,
    height: 15
    

    Unconvinced with a solution like that but it's the only thing that makes it work o_O

    If I get a better solution I will update the question :)