字体问题
This commit is contained in:
parent
2b047b3d18
commit
81ecb93aa5
@ -24,6 +24,8 @@ using OnceMi.AspNetCore.OSS;
|
|||||||
using QuestPDF;
|
using QuestPDF;
|
||||||
using QuestPDF.Infrastructure;
|
using QuestPDF.Infrastructure;
|
||||||
|
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace YD_Event.Web.Core;
|
namespace YD_Event.Web.Core;
|
||||||
|
|
||||||
public class Startup : AppStartup
|
public class Startup : AppStartup
|
||||||
@ -171,8 +173,9 @@ public class Startup : AppStartup
|
|||||||
option.ImageOption.InterferenceLineCount = 2; // 干扰线数量
|
option.ImageOption.InterferenceLineCount = 2; // 干扰线数量
|
||||||
|
|
||||||
option.ImageOption.FontSize = 36; // 字体大小
|
option.ImageOption.FontSize = 36; // 字体大小
|
||||||
// 使用系统安装的中文字体,避免使用 Lazy.Captcha.Core 内置字体(可能不兼容 Linux)
|
// 在 Linux 下,Lazy.Captcha.Core 的 DefaultFontFamilies 初始化可能会失败
|
||||||
option.ImageOption.FontFamily = DefaultFontFamilies.Instance.Kaiti;
|
// 这里直接使用 SkiaSharp 加载系统字体(Dockerfile 中已安装 fonts-wqy-zenhei)
|
||||||
|
option.ImageOption.FontFamily = SKTypeface.FromFamilyName("WenQuanYi Zen Hei");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 中文使用kaiti,其他字符可根据喜好设置(可能部分转字符会出现绘制不出的情况)。
|
* 中文使用kaiti,其他字符可根据喜好设置(可能部分转字符会出现绘制不出的情况)。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user