PF.UI.Fonts.LXGW 1.0.0

dotnet add package PF.UI.Fonts.LXGW --version 1.0.0
                    
NuGet\Install-Package PF.UI.Fonts.LXGW -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PF.UI.Fonts.LXGW" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PF.UI.Fonts.LXGW" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PF.UI.Fonts.LXGW" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PF.UI.Fonts.LXGW --version 1.0.0
                    
#r "nuget: PF.UI.Fonts.LXGW, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PF.UI.Fonts.LXGW@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PF.UI.Fonts.LXGW&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PF.UI.Fonts.LXGW&version=1.0.0
                    
Install as a Cake Tool

PF.UI.Fonts.LXGW

可选字体包:内嵌霞鹜文楷(LXGW WenKai)3 个字重,用于覆盖 PF.UI.ResourcesGlobalFontFamily 键,实现 PF.UI 组件库的全局换字体。

霞鹜文楷是基于 FONTWORKS Klee One 派生的开源中文字体,融合仿宋与楷体特征,笔锋柔和、 手写感强,适合追求"书卷气/温润"视觉风格的项目。与 PF.UI.Fonts.SourceHan 的思源黑体(中性、现代)形成互补,按需二选一即可。

不需要霞鹜文楷的项目不需要引用本包——PF.UI.Resources 已内置 GlobalFontFamily 默认值 (Microsoft YaHei UI, Segoe UI),767 处内置样式均已绑定该键,装或不装本包只是"用哪个字体" 的区别,不影响功能。

安装

dotnet add package PF.UI.Fonts.LXGW

App.xamlApplication.Resources.MergedDictionaries 中,于 PF.UI.Resources 主题字典 之后追加一条:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/PF.UI.Resources;component/Themes/Default.xaml" />
            
            <ResourceDictionary Source="pack://application:,,,/PF.UI.Fonts.LXGW;component/Fonts/LXGW.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

后加入的字典在 WPF 中优先级更高,因此顺序必须晚于主题字典,否则不生效。

PF.UI.Fonts.SourceHan 互斥:两者都覆盖同一个 GlobalFontFamily 键,同一应用内只应 引用其一(后合并的字典会覆盖前者,行为不可预期)。

字重对照

霞鹜文楷是单一字体族(LXGW WenKai),内含 3 个字重,通过 FontWeight 选取, 不要为每个字重建单独的 FontFamily 键:

FontWeight OpenType 数值 对应字重
Light 300 LXGW WenKai Light
Normal 400 LXGW WenKai Regular
Medium 500 LXGW WenKai Medium
<TextBlock Text="示例文字" FontFamily="{DynamicResource GlobalFontFamily}" FontWeight="Medium" />

霞鹜文楷没有 Bold(700)/Black(900)字重。若样式设置 FontWeight="Bold",WPF 会在 LXGW WenKai 族内取最接近的可用字重(Medium,500),不会报错;但视觉上不会比 Medium 更粗。 需要粗体强调的场景,思源黑体(PF.UI.Fonts.SourceHan,含 Bold/Heavy/Black)更合适。

许可

本包内嵌的霞鹜文楷字体文件按 SIL Open Font License 1.1 分发,随包附带 LICENSE-OFL.txt。字体文件未做任何修改(未子集化、未改名)。 基于 FONTWORKS Klee One 派生。字体文件未经任何修改,直接取自官方发布版(v1.522)。

体积

3 个字重原始 ttf 文件合计约 75MB(未子集化)。如需更小体积,需要自行裁剪字符集并重新构建, 但请注意 OFL 对 "Reserved Font Name"(本字体保留名 '霞鹜'、'霞鶩'、'落霞孤鹜'、'落霞孤鶩'、 'LXGW')的限制——字体一旦被修改(含子集化),需要遵守 LICENSE-OFL.txt 中关于 Reserved Font Name 的附加许可条款,详见 LICENSE-OFL.txt 顶部声明。

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 108 7/31/2026

v1.0.0 - 初始版本:霞鹜文楷 3 字重(LXGW WenKai:Light/Regular/Medium,SIL OFL 1.1,基于 Fontworks Klee One),随包附带 LICENSE-OFL.txt