0

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?

LauZyHou
  • 137
  • 1
  • 2
  • 11
  • I doubt that your font is called `HGDH_CNKI` please double-check how the font family is called. Also, make sure to add the font as AvaloniaResource. – Benedikt Schroeder Jul 09 '20 at 17:06

1 Answers1

1

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.

LauZyHou
  • 137
  • 1
  • 2
  • 11