Skip to content

How to add a custom font-family of google fonts like Poppins? #580

Discussion options

You must be logged in to vote

To add a google font, here are the recommended steps:

  1. Create a font package:
    Check out this link to know more.
    The created package will look somewhat similar to this repository
  2. Add this package as a dependency to your package
    To achieve this, add -- fastn.dependency: fifthtry.github.io/roboto-font in FASTN.ftd of your package.
  3. In the module, where you want to use this font, let's say in index.ftd. Add the following code:
    -- import: fifthtry.github.io/roboto-font/assets
    
    -- ftd.type dtype:
    size.px: 40
    weight: 900
    font-family: $assets.fonts.Roboto
    line-height.px: 65
    letter-spacing.px: 5
    
    -- ftd.text: Hello World
    role: $dtype
    

In case you don't want to create a font package:

  • In FASTN.ftd

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Arpita-Jaiswal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant