Giter Site home page Giter Site logo

Comments (10)

PierBover avatar PierBover commented on May 5, 2024 2

@benjick no, sorry.

from nativebase.

PierBover avatar PierBover commented on May 5, 2024 1

Including custom font is easy.

  1. Create a fonts folder in the project root.

  2. Add this to package.json

  "rnpm": {
    "assets": [
      "fonts"
    ]
  }
  1. rnpm link

You already have a similar procedure when installing the react-native-vector-icons dependency without the need of modifying package.json so something cleaner could be achieved.

from nativebase.

sankhadeeproy007 avatar sankhadeeproy007 commented on May 5, 2024 1

Sounds cool. Will try it out and hopefully publish it with our next release. Appreciate the help. Thanks!

from nativebase.

sankhadeeproy007 avatar sankhadeeproy007 commented on May 5, 2024

Just setting the font as a variable won't be of much help. We'll have to include the .ttf file separately for each custom fonts. So that is not something we're looking to support in the near future. However if you do need a different font, this article might be of some help.
https://medium.com/@dabit3/adding-custom-fonts-to-react-native-b266b41bff7f#.mzhtf14we

from nativebase.

PierBover avatar PierBover commented on May 5, 2024

Thanks I know how to include and use custom fonts.

What I'd like to know is how to apply that font to all NativeBase widgets.

from nativebase.

sankhadeeproy007 avatar sankhadeeproy007 commented on May 5, 2024

Provided you use all the <Text> components from native-base for your app. You can define the font-family in Components/Widgets/Text.js.

from nativebase.

PierBover avatar PierBover commented on May 5, 2024

Oh ok, I was hoping there was a way to do that from the theme.

Maybe you could mark this as a feature request?

from nativebase.

sankhadeeproy007 avatar sankhadeeproy007 commented on May 5, 2024

There is already a custom font request. Since we want native-base to work out of the box, we can have a font variable, but how do you suggest we deal with the problem of manually adding font files?

from nativebase.

sankhadeeproy007 avatar sankhadeeproy007 commented on May 5, 2024

Same as #23

from nativebase.

benjick avatar benjick commented on May 5, 2024

@PierBover Doesn't seem to link the fonts in iOS (0.41), got another solution you're aware off?

from nativebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.