React Native Custom Fonts // Pro Tip

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.พ. 2023
  • In this tutorial, we look at why you need to use custom font files with react native and how you can use custom font files for iOS and well and Android as simply as possible.
    Thanks to all the channel supporters, I can create this full course for React Professionals looking to quickly level up to React Native.
    -- React Native for Professionals --
    Complete Playlist for Subscribers (free 🤗): • Professional React Native
    Complete Playlist for Members (early release - no ads - 🙏🏻 for your support): • Members - React Native...
    🏷 #basarat #TypeScript #JavaScript #React #ReactNative #Tutorial
    👇 ❤️ Subscribe for MOORE ❤️ 👇
    th-cam.com/users/basaratali?su...
    🌹 Support 🌹
    Join: / basaratali
    ~
    / basarat
    github.com/basarat
    basarat.com/
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 56

  • @jonathanaplacador9803
    @jonathanaplacador9803 ปีที่แล้ว +21

    doesn't work

  • @Vincetroid
    @Vincetroid 11 หลายเดือนก่อน

    Thanks, it works, really straightforward. Do you think can also be done with babel?

  • @malhartrivedi8365
    @malhartrivedi8365 11 หลายเดือนก่อน

    Thanks, it works, it was really handy

  • @patresito
    @patresito 10 หลายเดือนก่อน +1

    My font wasn't working on Android and this is exactly why. Thanks a lot!

  • @gleamofcolor
    @gleamofcolor 8 หลายเดือนก่อน +3

    It doesn't work. It throws error the font family is not a system font family and suggest to use font..loadasync

  • @andrejkling3886
    @andrejkling3886 หลายเดือนก่อน +1

    All works very nice ... that´s great lesson 🔥💯 thank you

    • @basarat
      @basarat  หลายเดือนก่อน +1

      Thanks 🫰 it’s great to see your comments, keep em coming 🌹🔥

  • @starzzspace2003
    @starzzspace2003 4 หลายเดือนก่อน

    best explaanation , only content not time wasting. thanks you👌👌😃

  • @user-gj5mz4xo3o
    @user-gj5mz4xo3o ปีที่แล้ว +9

    doesnt work

  • @mymy3031
    @mymy3031 11 หลายเดือนก่อน +1

    what happens if we have 2 kind of fonts?

  • @crisbinjoseph-jt5me
    @crisbinjoseph-jt5me 2 หลายเดือนก่อน

    Thank you brother😊😊

  • @abdullahisa7547
    @abdullahisa7547 ปีที่แล้ว

    thaaaaaaaaaaaaaaaaaaaaaaaaaaankssss sooooo muuuuuuuuuuuuuuuchhhh works

  • @ajayvishwakarma2648
    @ajayvishwakarma2648 9 หลายเดือนก่อน

    Awesome Bro

  • @Lovepreet-xs5qi
    @Lovepreet-xs5qi ปีที่แล้ว

    Thank you Sir

  • @RVKAWAAA
    @RVKAWAAA 8 หลายเดือนก่อน

    thanks mate

  • @roadtrpr
    @roadtrpr 3 หลายเดือนก่อน

    Great. Font Size 60, now get the font sized on every type of screen, and handle phone font size systemsettings.
    That's what I want to know. On some screens 60 is too big, and on other its too small. I want the same proportion on every screen. Can anyone help me with that ?

  • @ibrahimali1926
    @ibrahimali1926 11 หลายเดือนก่อน

    bro its not wroking for bold fontweight only working for regular font

  • @zeeshanalikhan8258
    @zeeshanalikhan8258 ปีที่แล้ว +2

    Hi! How can one setup it globally? I tried this way but its not ideal because you have to manually type fontFamily for each Text Input. Please make tutorial to setup it once globally as default. I have seen package name "react-native-global-font" but that wasn''t useful in my case. TIA

    • @manuelcasares7270
      @manuelcasares7270 ปีที่แล้ว +1

      Just create a wrapper for that TextInput and add the fontFamily once

  • @ferwchi
    @ferwchi 8 หลายเดือนก่อน +1

    It worked on iOS, but not on Android. Am I missing any step? Like changing something in gradle or any other config file?
    The files are present on android/app/src/main/assets/fonts, but when I open Android Studio there's ANOTHER fonts folder on the same hierarchy level with some default fonts (I guess).

    • @pujadey2771
      @pujadey2771 5 หลายเดือนก่อน

      same here

    • @ferwchi
      @ferwchi 5 หลายเดือนก่อน

      ​@@pujadey2771 the way I solved it:
      Separate the tff font files by normal/lighter/bold/etc... before doing the assets stuff, and name them according to their font names, but replace the spaces with underscore or hyphen (stick with one for consistency) for example Inter-SemiBold.ttf
      Once they're included on android and ios, you create a theme or font file that exports the correct spelling for each platform:
      ```export default Platform.select({
      android: {
      ...
      INTER_SEMI_BOLD: 'Inter-SemiBold',
      INTER_BOLD ....
      ios: {
      INTER_SEMI_BOLD: 'Inter SemiBold',
      INTER_BOLD ...
      ```
      After that you can import these constants and use them on your typography file or wherever you want
      And here's a troubleshooting: if you done everything correct, but you still not getting your fonts on specific places, maybe you're using forbidden css properties, such as font-weight (that's why you split your font files on style and weight)

  • @chan-te6re
    @chan-te6re ปีที่แล้ว

    cool

  • @Reyescult
    @Reyescult ปีที่แล้ว

    Man, the 'Font Full Name' saved by bacon. Thank you!

    • @basarat
      @basarat  ปีที่แล้ว

      Thanks for the comment 🙏🏻 I’m glad to be of service 😊

  • @EntropyOnTheCrosshair
    @EntropyOnTheCrosshair 7 หลายเดือนก่อน

    fontFamily was not loaded through FontLoadAsync

  • @wiaanduvenhage3082
    @wiaanduvenhage3082 ปีที่แล้ว +4

    Hi! Thanks for the tutorial! But I'm getting an error "If this is a custom font, be sure to load it with Font.loadAsync. " So does this method not work anymore?

    • @user-gj5mz4xo3o
      @user-gj5mz4xo3o ปีที่แล้ว

      me too, did u fix this

    • @kuhupandit7616
      @kuhupandit7616 ปีที่แล้ว

      same here, do you know how to fix this?

    • @user-gj5mz4xo3o
      @user-gj5mz4xo3o ปีที่แล้ว

      @@kuhupandit7616 I ended up switching to flutter, its much better than react native anyways

    • @wiaanduvenhage3082
      @wiaanduvenhage3082 ปีที่แล้ว

      @@user-gj5mz4xo3o Hi, yes. Refer to my response from @kuhupandit7616

    • @luabfr
      @luabfr 11 หลายเดือนก่อน

      Can you share the answer? @@wiaanduvenhage3082

  • @rickcode22
    @rickcode22 3 หลายเดือนก่อน +1

    Sonora OS doesn't have the Full Name.

  • @saulesau6004
    @saulesau6004 8 หลายเดือนก่อน

    you're the best

    • @basarat
      @basarat  8 หลายเดือนก่อน +1

      Just the kind of validation I love waking up to ❤️. Thank you 🤗🌹

  • @ahmadnurahsan8162
    @ahmadnurahsan8162 7 หลายเดือนก่อน

    i cant do that on windows

  • @TalhaKhan-uy3qc
    @TalhaKhan-uy3qc ปีที่แล้ว

    Brother can you make videos of react-native by using class method ? I think its a bit better and simple than functional method.

    • @basarat
      @basarat  ปีที่แล้ว +7

      Thanks for the comment ❤️
      class components are not recommended for new React code!
      One big reason: The greatest feature of modern react aka Hooks are not supported by classes

    • @azharuddinmulla-pn2ym
      @azharuddinmulla-pn2ym 11 หลายเดือนก่อน

      yes, right but point of view most of the company having legacy code base project (class base component)@@basarat

  • @JohnSmith-co1zv
    @JohnSmith-co1zv 11 หลายเดือนก่อน +1

    Didn't work

  • @mohammadumar443
    @mohammadumar443 9 หลายเดือนก่อน

    bhai ap jaisi videos banai ho tou kya kya learn krna pary ga related to video editing ?

    • @basarat
      @basarat  9 หลายเดือนก่อน

      to set yourself for success you can get Final Cut Pro X (use a student bundle - one time payment for lifetime)
      alternatively you can use adobe premier (I have used this in a while as it is a monthly subscription)

  • @gobicorner
    @gobicorner ปีที่แล้ว

    brother please continue testing series on react native right after this

    • @basarat
      @basarat  ปีที่แล้ว +1

      Noted :) ❤️🌹

    • @gobicorner
      @gobicorner ปีที่แล้ว

      @@basarat pakka sir ? bcz codevolution , yours provide very good react content , but there is need to react native a lot .

    • @basarat
      @basarat  ปีที่แล้ว +1

      @@gobicorner Its all a matter of time. The Professional JavaScript course (which is scheduled after the current Professional React course) is a lot of work, because I've really raised my own personal standards 🤗. But, react native testing is definitely something I can share a lot about when I get the time 🌹

    • @gobicorner
      @gobicorner ปีที่แล้ว

      @@basarat thank you for reply..!!

  • @CosmoVision1
    @CosmoVision1 21 วันที่ผ่านมา

    doest work

  • @dcsalim4384
    @dcsalim4384 10 หลายเดือนก่อน +2

    Doesn't work 👎

  • @megatronskneecap
    @megatronskneecap 4 หลายเดือนก่อน

    This video doesn't work. If you're using expo you need to use expo-fonts.

  • @derboss66
    @derboss66 8 หลายเดือนก่อน

    Guys. This method is outdated.

  • @C5S6
    @C5S6 7 หลายเดือนก่อน

    dog

    • @basarat
      @basarat  7 หลายเดือนก่อน +1

      cat