How to include external font in Avalonia application without installing it
I try to use a kind of Chinese fonts HGDH_CNKI.TTF
. I put it into sbid/Assets/Fonts/
(my project name is sbid).
And then I try it like this, I use:
<Button Command="{Binding AddProtocol}" FontFamily="/Assets/Fonts/HGDH_CNKI.TTF#HGDH_CNKI">新协议</Button>
or
<Button Command="{Binding AddProtocol}" FontFamily="avares://sbid/Assets/Fonts/HGDH_CNKI.TTF#HGDH_CNKI">新协议</Button>
It still doesn’t work. Is there any other steps I need to do?
I found that Avalonia do no support Chinese font family. I change the font family of the .ttf
file to English by using FontCreator. Everything is ok.