Use custom font in quasar app



  • i want to add my custom font in quasar project, i tried to do this following this guide
    add-custom-fonts-to-your-app/2 , but it does not work for me, please help

    i copied font file to themes/fonts

    //app.variables.styl
    @font-face
    font-family myfont
    src url(fonts/Chilanka-Regular.ttf)

    //Index.vue
    <style>
    .myclass {
    font-family: myfont;
    font-size: 30px
    }
    </style>

    whe use my class to an element, the font does not change

    Quasar CLI v0.6.2
    App running on Quasar v0.13.10



  • Did you look into the stylesheets that are generated using Chrome DevTools or something similar?
    Maybe your style definition gets overwritten by a definition with higher precedence.
    If the font could not be loaded you should also see a 404 error in the network tab.



  • ok, that was solved

    i forgot uncomment this in main.js
    require(./themes/app.${__THEME}.styl)


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.