From 3222ccf831c8002d26f99e61c196e5022594ff53 Mon Sep 17 00:00:00 2001 From: Aeroblast <15964528+Aeroblast@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=81=87=E5=88=B0=E6=9C=AA?= =?UTF-8?q?=E7=9F=A5=E5=AD=97=E4=BD=93=E7=9A=84=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/EpubBuilder.cs | 4 ++++ src/ProcessSection.cs | 5 ++++- src/version.cs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/EpubBuilder.cs b/src/EpubBuilder.cs index 5bda1ed..035f84b 100644 --- a/src/EpubBuilder.cs +++ b/src/EpubBuilder.cs @@ -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); diff --git a/src/ProcessSection.cs b/src/ProcessSection.cs index 1bc1a6f..7015227 100644 --- a/src/ProcessSection.cs +++ b/src/ProcessSection.cs @@ -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; } } } diff --git a/src/version.cs b/src/version.cs index 6c01189..8a0178f 100644 --- a/src/version.cs +++ b/src/version.cs @@ -1,4 +1,4 @@ namespace UnpackKindleS { - public class Version{public static string version="20211115";} + public class Version{public static string version="20220126";} } \ No newline at end of file