diff --git a/AssFontSubset.Core/src/SubsetByPyFT.cs b/AssFontSubset.Core/src/SubsetByPyFT.cs index 2467bfe..fed4d0b 100644 --- a/AssFontSubset.Core/src/SubsetByPyFT.cs +++ b/AssFontSubset.Core/src/SubsetByPyFT.cs @@ -72,7 +72,7 @@ IEnumerable> GetFontInfoFromFiles(string dir) return fontInfoGroup; } - bool TryCheckDuplicatFonts(List fontInfos, out IEnumerable> fontInfoGroup) + private bool TryCheckDuplicatFonts(List fontInfos, out IEnumerable> fontInfoGroup) { var dupFonts = false; fontInfoGroup = fontInfos.GroupBy(fontInfo => fontInfo.FamilyNames[FontConstant.LanguageIdEnUs]); @@ -86,12 +86,12 @@ bool TryCheckDuplicatFonts(List fontInfos, out IEnumerable 1) + }); + + foreach (var g in groupWithoutFileNames) { - _logger?.ZLogError($"Duplicate fonts: {string.Join('、', groupWithoutFileNames.SelectMany(x => x.Select(fi=>fi.FileName)))}"); + if (g.Count() <= 1) continue; + _logger?.ZLogError($"Duplicate fonts: {string.Join('、', g.Select(x => x.FileName))}"); dupFonts = true; } }