Skip to content

[Text] fontWeight='bold' cancels the fontStyle Century Gothic #20445

Closed
@badarshahzad

Description

@badarshahzad

This way the font style works

const styles = StyleSheet.create({
 subHeadingCss: {
    fontSize: 22,
    fontFamily: "century-gothic",
    color: "#3e4152"
  }
});

Century Gothic style work without bold

This way the font style is not work but the font itself become bold in other font family.

const styles = StyleSheet.create({
 subHeadingCss: {
    fontSize: 22,
    fontWeight: "bold",
    fontFamily: "century-gothic",
    color: "#3e4152"
  }
});

Century Gothic style not work with font weight bold

How I have expectations to behave like this mock-up.
mockup

How I add the font family in react native?

import React, { Component } from "react";
import { StyleSheet, Text, View, KeyboardAvoidingView } from "react-native";
import { Font } from "expo";
import AddToCartScreen from "./app/components/AddToCartScreen";

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = { loading: true };
  }

  async componentWillMount() {
    await Font.loadAsync({
      "century-gothic": require("./app/assets/fonts/CenturyGothic.ttf")
    });
    this.setState({ loading: false });
  }

  render() {
    if (this.state.loading) {
      //first load the text style then to render its necessary
      return (
        <View style={styles.container}>
          <Text
            style={{
              fontSize: 36,
              alignContent: "center",
              alignItems: "center"
            }}
          >
            loading font style ....
          </Text>
        </View> 
      );
    }
    return (
      <View style={styles.container}>
           <AddToCartScreen/>  
      </View>
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions