Skip to content
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

@expo-google-fonts/lato letter 'g' is cut off at the bottom #95

Open
w3liang opened this issue Apr 11, 2023 · 3 comments
Open

@expo-google-fonts/lato letter 'g' is cut off at the bottom #95

w3liang opened this issue Apr 11, 2023 · 3 comments

Comments

@w3liang
Copy link

w3liang commented Apr 11, 2023

I upgraded my EXPO SDK to EXPO 47 and found that all the letter 'g' is cut off at the bottom, only in Android, I am using a Pixel 4a device, you can reproduce this using the below codes.
Screenshot_20230411-115426_Original

import React, { useState, useEffect } from 'react';
 
import { Text, View, StyleSheet } from 'react-native';
import AppLoading from 'expo-app-loading';
import {
  useFonts,
  Lato_100Thin,
  Lato_100Thin_Italic,
  Lato_300Light,
  Lato_300Light_Italic,
  Lato_400Regular,
  Lato_400Regular_Italic,
  Lato_700Bold,
  Lato_700Bold_Italic,
  Lato_900Black,
  Lato_900Black_Italic,
} from '@expo-google-fonts/lato';
 
export default () => {
  let [fontsLoaded] = useFonts({
    Lato_100Thin,
    Lato_100Thin_Italic,
    Lato_300Light,
    Lato_300Light_Italic,
    Lato_400Regular,
    Lato_400Regular_Italic,
    Lato_700Bold,
    Lato_700Bold_Italic,
    Lato_900Black,
    Lato_900Black_Italic,
  });
 
  let fontSize = 24;
  let paddingVertical = 6;
 
  if (!fontsLoaded) {
    return <AppLoading />;
  } else {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_100Thin',
          }}>
          Lato Thin g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_100Thin_Italic',
          }}>
          Lato Thin Italic g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_300Light',
          }}>
          Lato Light g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_300Light_Italic',
          }}>
          Lato Light Italic g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_400Regular',
          }}>
          Lato Regular g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_400Regular_Italic',
          }}>
          Lato Italic g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_700Bold',
          }}>
          Lato Bold g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_700Bold_Italic',
          }}>
          Lato Bold Italic g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_900Black',
          }}>
          Lato Black g
        </Text>
 
        <Text
          style={{
            fontSize,
            paddingVertical,
            // Note the quoting of the value for `fontFamily` here; it expects a string!
            fontFamily: 'Lato_900Black_Italic',
          }}>
          Lato Black Italic g
        </Text>
      </View>
    );
  }
};

package.json

{
  "dependencies": {
    "prop-types": "^15.6.2",
    "@expo-google-fonts/lato": "^0.2.3",
    "expo-app-loading": "~2.1.1",
    "expo-font": "~11.0.1"
  }
}
@xxxifan
Copy link

xxxifan commented Apr 11, 2024

includeFontPadding: false

@oskarzimmerman
Copy link

includeFontPadding

Where do i add this?

@oskarzimmerman
Copy link

oskarzimmerman commented May 27, 2024

includeFontPadding

Where do i add this?

Its a property on Text style:

<Text style={{
  includeFontPadding: false,
}}></Text>

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

3 participants