Skip to content

Commit

Permalink
afs.core: fix TryCheckDuplicatFonts
Browse files Browse the repository at this point in the history
  • Loading branch information
MIRIMIRIM committed Aug 5, 2024
1 parent 0402bd2 commit 7f30305
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AssFontSubset.Core/src/SubsetByPyFT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ IEnumerable<IGrouping<string, FontInfo>> GetFontInfoFromFiles(string dir)
return fontInfoGroup;
}

bool TryCheckDuplicatFonts(List<FontInfo> fontInfos, out IEnumerable<IGrouping<string, FontInfo>> fontInfoGroup)
private bool TryCheckDuplicatFonts(List<FontInfo> fontInfos, out IEnumerable<IGrouping<string, FontInfo>> fontInfoGroup)
{
var dupFonts = false;
fontInfoGroup = fontInfos.GroupBy(fontInfo => fontInfo.FamilyNames[FontConstant.LanguageIdEnUs]);
Expand All @@ -86,12 +86,12 @@ bool TryCheckDuplicatFonts(List<FontInfo> fontInfos, out IEnumerable<IGrouping<s
fi.Weight,
fi.Index,
fi.MaxpNumGlyphs,
fi.FamilyNames
}).ToList();

if (groupWithoutFileNames.Count > 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;
}
}
Expand Down

0 comments on commit 7f30305

Please sign in to comment.