Fonts.Avalonia.SourceHan
中文说明
Note: This project is entirely AI-generated. Not a single line of code was written manually.
Avalonia Source Han font integration project.
Project Structure
- Sans/ - Source Han Sans solution
- Serif/ - Source Han Serif solution
Variants: SC vs CN, J vs JP, K vs KR, TC vs TW, HC vs HK
The following variants apply to both Sans and Serif. According to the Source Han download documentation, SC includes a broader character set suitable for general-purpose Simplified Chinese usage, while CN is more focused on mainland China conventions. Similarly, J offers general-purpose Japanese support with a broader character set, while JP is targeted specifically at Japanese conventions. Likewise, K provides general-purpose Korean support with a broader character set, while KR is targeted specifically at South Korean conventions. Also, TC provides general-purpose Traditional Chinese support (including Hong Kong), while TW is targeted specifically at Taiwan, Province of China. And HC provides general-purpose Traditional Chinese support (including Hong Kong), while HK is targeted specifically at Hong Kong, China. Choose the variant that best fits your target audience.
Sans/SC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansSC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansSC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansSC.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/CN Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansCN |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansCN.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansCN.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/J Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansJ |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansJ.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansJ.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/JP Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansJP |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansJP.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansJP.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/TC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansTC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansTC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansTC.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/TW Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansTW |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansTW.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansTW.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/HC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansHC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansHC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansHC.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/HK Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansHK |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansHK.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansHK.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/K Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansK |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansK.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansK.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Sans/KR Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSansKR |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSansKR.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSansKR.Full |
Full |
ExtraLight / Light / Regular / Medium / Bold / Heavy |
Quick Start
SC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansSCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑体"
FontFamily="fonts:SourceHanSansSC#Source Han Sans SC" />
CN
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansCNFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑体"
FontFamily="fonts:SourceHanSansCN#Source Han Sans CN" />
J
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansJFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="こんにちは 源ノ角ゴシック"
FontFamily="fonts:SourceHanSansJ#Source Han Sans" />
JP
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansJPFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="こんにちは 源ノ角ゴシック"
FontFamily="fonts:SourceHanSansJP#Source Han Sans JP" />
TC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansTCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑體"
FontFamily="fonts:SourceHanSansTC#Source Han Sans TC" />
TW
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansTWFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑體"
FontFamily="fonts:SourceHanSansTW#Source Han Sans TW" />
HC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansHCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑體"
FontFamily="fonts:SourceHanSansHC#Source Han Sans HC" />
HK
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansHKFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源黑體"
FontFamily="fonts:SourceHanSansHK#Source Han Sans HK" />
K
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansKFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="안녕하세요 본고딕"
FontFamily="fonts:SourceHanSansK#Source Han Sans K" />
KR
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSansKRFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="안녕하세요 본고딕"
FontFamily="fonts:SourceHanSansKR#Source Han Sans KR" />
Preview
CN
| Base (WSL) |
Lite (WSL) |
Full (WSL) |
![CN Base WSL]() |
![CN Lite WSL]() |
![CN Full WSL]() |
TW
HK
JP
KR
Serif
Serif/SC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifSC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifSC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifSC.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/CN Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifCN |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifCN.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifCN.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/J Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifJ |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifJ.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifJ.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/JP Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifJP |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifJP.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifJP.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/TC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifTC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifTC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifTC.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/TW Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifTW |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifTW.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifTW.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/HC Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifHC |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifHC.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifHC.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/HK Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifHK |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifHK.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifHK.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/K Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifK |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifK.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifK.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Serif/KR Font Family
| Package |
NuGet |
Weights |
Fonts.Avalonia.SourceHanSerifKR |
Base |
ExtraLight / Light / Regular / Bold / Heavy |
Fonts.Avalonia.SourceHanSerifKR.Lite |
Lite |
Regular |
Fonts.Avalonia.SourceHanSerifKR.Full |
Full |
ExtraLight / Light / Regular / Medium / SemiBold / Bold / Heavy |
Quick Start
SC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifSCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋体"
FontFamily="fonts:SourceHanSerifSC#Source Han Serif SC" />
CN
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifCNFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋体"
FontFamily="fonts:SourceHanSerifCN#Source Han Serif CN" />
J
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifJFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="こんにちは 源ノ明朝"
FontFamily="fonts:SourceHanSerifJ#Source Han Serif" />
JP
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifJPFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="こんにちは 源ノ明朝"
FontFamily="fonts:SourceHanSerifJP#Source Han Serif JP" />
TC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifTCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋體"
FontFamily="fonts:SourceHanSerifTC#Source Han Serif TC" />
TW
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifTWFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋體"
FontFamily="fonts:SourceHanSerifTW#Source Han Serif TW" />
HC
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifHCFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋體"
FontFamily="fonts:SourceHanSerifHC#Source Han Serif HC" />
HK
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifHKFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="Hello 思源宋體"
FontFamily="fonts:SourceHanSerifHK#Source Han Serif HK" />
K
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifKFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="안녕하세요 본명조"
FontFamily="fonts:SourceHanSerifK#Source Han Serif K" />
KR
// Register fonts
AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithSourceHanSerifKRFont() // Common API for Base / Lite / Full
.StartWithClassicDesktopLifetime(args);
<TextBlock Text="안녕하세요 본명조"
FontFamily="fonts:SourceHanSerifKR#Source Han Serif KR" />
Preview
CN
| Base (WSL) |
Lite (WSL) |
Full (WSL) |
![CN Base WSL]() |
![CN Lite WSL]() |
![CN Full WSL]() |
Usage Recommendations
- Base is recommended for most use cases — it supports the widest range of font weights.
- If you only need Regular and Bold weights (no weight variation), use Lite for a smaller assembly size.
- Use Full only when other variants don't meet your requirements.
Installation
Install .NET SDK
Download and install the .NET SDK from the official .NET website.
Verify installation:
dotnet --version
Add NuGet Package
dotnet add package Fonts.Avalonia.SourceHanSansSC
Or add the corresponding Serif package:
dotnet add package Fonts.Avalonia.SourceHanSerifSC
For other language variants, replace SC with the desired variant code (e.g. CN, J, JP, TC, TW, HC, HK, K, KR).
For other editions:
- Base (default):
Fonts.Avalonia.SourceHanSansSC
- Lite:
Fonts.Avalonia.SourceHanSansSC.Lite
- Full:
Fonts.Avalonia.SourceHanSansSC.Full
Requirements
- .NET 8 SDK
- Avalonia 11.2+
Acknowledgments
Built with the assistance of CodeBuddy CN.