Skip to content

[Android]Font Rendering in React native #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bhavikat6 opened this issue Mar 11, 2025 · 3 comments
Open

[Android]Font Rendering in React native #889

bhavikat6 opened this issue Mar 11, 2025 · 3 comments

Comments

@bhavikat6
Copy link

I have one cursive font. This font is visible outside of my TextInput and also outside of the text component in React native IOS but in Android, if the letter is curved on the left it is cropped from the left whether its TextInput or Text
I tried adding padding butthe font itself is cropping but it is only Android Can someone please help me

<TextInput textBreakStrategy="simple" style={[ { fontFamily: CUSTOM_FONT, textAlign: 'left', fontSize: 16, color: 'black', height: 50, width: 100, lineHeight: 25, textAlignVertical: 'top', includeFontPadding: false, padding: 0, } ]}
This is in Android
Image

Image

In IOS

Image
@bhavikat6
Copy link
Author

Hi Can someone aware how to fix it for Android?

@kushagras652
Copy link

Try to create a custom component which that adjusts based on platform

const CustomTextInput = (props) => {
const isAndroid = Platform.OS === 'android';

return (
<TextInput
textBreakStrategy="simple"
style={[
{
fontFamily: CUSTOM_FONT,
textAlign: 'left',
fontSize: 16,
color: 'black',
height: 50,
width: 100,
lineHeight: 25,
textAlignVertical: 'top',
includeFontPadding: false,
padding: 0,
paddingLeft: isAndroid ? 10 : 0, // Only add padding on Android
},
props.style,
]}
{...props}
/>
);
};
Hope this works

@bhavikat6
Copy link
Author

Hey @kushagras652 Thank you for feedback but padding also not working its not about TextInput overall in the application this letter is causing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants