Django - New fonts?

前端 未结 2 1527
慢半拍i
慢半拍i 2020-12-14 02:08

How do I install new fonts with Django? There is no mention of this in the documentations.

I have my fonts installed in the static folder as such fonts/abc.ttf

2条回答
  •  -上瘾入骨i
    2020-12-14 02:58

    I am using this option to avoid absolute path and/or css in html template:

    @font-face {
        font-family: 'HKGrotesk';
        font-style: normal;
        font-weight: bold;
        src: local('HKGrotesk'), url('/static/fonts/hk-grotesk/HKGrotesk-SemiBoldLegacy.otf') format('opentype');
    }
    

提交回复
热议问题