Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Skip unimportant info, fix #6 .
  • Loading branch information
GuiWonder committed Aug 1, 2024
1 parent 548f78a commit e2a835e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
- `-it` 斜体(Italic),可选,可使用 `-it y` 指定为斜体字体,`-it n` 指定为非斜体字体。如未指定,程序会使用输入字体的斜体属性。
- `-d` 字体保存目录(Output Directory),可选,如未指定,则使用当前目录。
- `-r` TTC 打包完成后移除 TTF,可选。

## 下载地址
可从 [Releases](https://github.com/GuiWonder/WeiFonts/releases) 页面下载。
## 鸣谢
- [FontTools](https://github.com/fonttools/fonttools)
- [AFDKO](https://github.com/adobe-type-tools/afdko/)
Expand Down
2 changes: 1 addition & 1 deletion files/weipingfang.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def buitotf(infile, outfile, mfile, i=-1):
fontm=ttLib.TTFont(mfile, fontNumber=i)
ftnm=fontm["name"].getDebugName(6)
inft=infile[ftnm.split('-')[-1]]
newft=ttLib.TTFont(inft, recalcTimestamp=False, recalcBBoxes=False, fontNumber=i)
newft=ttLib.TTFont(inft, recalcTimestamp=False, recalcBBoxes=False)
newft['OS/2'].achVendID=fontm['OS/2'].achVendID
newft['OS/2'].ulCodePageRange1=fontm['OS/2'].ulCodePageRange1
newft['head'].fontRevision=fontm['head'].fontRevision
Expand Down
2 changes: 1 addition & 1 deletion files/weiwei.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def buitotc(infile, outfile, mfile):

def buitotf(infile, outfile, mfile, i=-1):
fontm=ttLib.TTFont(mfile, fontNumber=i)
newft=ttLib.TTFont(infile, recalcTimestamp=False, recalcBBoxes=False, fontNumber=i)
newft=ttLib.TTFont(infile, recalcTimestamp=False, recalcBBoxes=False)
newft['OS/2'].achVendID=fontm['OS/2'].achVendID
newft['OS/2'].ulCodePageRange1=fontm['OS/2'].ulCodePageRange1
newft['head'].fontRevision=fontm['head'].fontRevision
Expand Down
18 changes: 13 additions & 5 deletions gui/WeiFonts/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ private void ThRun()
{
tabControl1.Enabled = true;
Cursor = Cursors.Default;
if (string.IsNullOrWhiteSpace(err))
if (err.Contains("Error:"))
{
MessageBox.Show(this, "处理完毕!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(this, err, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
MessageBox.Show(this, "出现错误!\r\n" + err, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(this, "处理完毕!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}));
}
Expand Down Expand Up @@ -254,9 +254,17 @@ private void LinkLabe_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e

else if (sender == linkLabelOutWei)
{
if (textBoxM.Text.ToLower().Trim().EndsWith("ttc"))
if (textBoxM.Text.ToLower().Trim().EndsWith(".ttc"))
{
saveFileDialog.Filter = "字体文件|*.ttc;*.otc;*.ttf;*.otf|所有文件|*.*";
}
else if (textBoxM.Text.ToLower().Trim().EndsWith(".otf"))
{
saveFileDialog.Filter = "字体文件|*.otf;*.ttf;*.ttc;*.otc|所有文件|*.*";
}
else if (textBoxM.Text.ToLower().Trim().EndsWith(".otc"))
{
saveFileDialog.Filter = "字体文件|*.ttc;*.ttf;*.otf;*.otc|所有文件|*.*";
saveFileDialog.Filter = "字体文件|*.otc;*.ttc;*.otf;*.ttf|所有文件|*.*";
}
else
{
Expand Down

0 comments on commit e2a835e

Please sign in to comment.