Skip to content

Commit

Permalink
改进遇到未知字体的流程
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeroblast committed Jan 26, 2022
1 parent 8022848 commit 3222ccf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/EpubBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ string ProcEmbed(string uri)
{
Font_Section font_Section = (Font_Section)section;
string name = "embed" + Util.Number(resid) + font_Section.ext;
if (font_Section.ext == null)
{
Log.log("[Warn] The referred font file is unrecognized: "+name);
}
link = "../Fonts/" + name;
font_Section.comment = name;
fonts.Add(font_Section.data);
Expand Down
5 changes: 4 additions & 1 deletion src/ProcessSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,10 @@ public Font_Section(Section section) : base(section)
case "true":
case "\0\x1\0\0":
ext = ".ttf"; break;
default: throw new Exception("Error at dump font.");
default:
ext = null;
Log.log($"[Warn] unknown font header: 0x{data[0]:X}{data[1]:X}{data[2]:X}{data[3]:X}");
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace UnpackKindleS
{
public class Version{public static string version="20211115";}
public class Version{public static string version="20220126";}
}

0 comments on commit 3222ccf

Please sign in to comment.