Skip to content

Commit 81b28ee

Browse files
committed
fix fonts dir
1 parent 8111124 commit 81b28ee

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Program.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ public static FontFamily GetFontFamily(string fontName)
5858
private static void Main(string[] args)
5959
{
6060
fontCollection = new PrivateFontCollection();
61-
foreach (string font in Directory.GetFiles("./fonts"))
61+
if (Directory.Exists("./fonts"))
6262
{
63-
fontCollection.AddFontFile(font);
63+
foreach (string font in Directory.GetFiles("./fonts"))
64+
{
65+
fontCollection.AddFontFile(font);
66+
}
6467
}
6568

6669
encoderInfo = GetEncoderInfo("image/jpeg");

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ https://github.com/mycard/ImgGen/wiki/效果预览
1515
文泉驿微米黑
1616
方正隶变_GBK
1717
MatrixBoldSmallCaps
18+
字体可安装至系统,也可放至fonts目录
1819

1920
生成卡图:
2021
在执行目录创建pico目录,放入对应密码的中间图规格的png或jpg图片,运行ImgGen.exe,即可在picn目录内生成卡图。

0 commit comments

Comments
 (0)