diff --git a/AssFontSubset.Core/src/AssFont.cs b/AssFontSubset.Core/src/AssFont.cs index 2489cfc..a2e0a58 100644 --- a/AssFontSubset.Core/src/AssFont.cs +++ b/AssFontSubset.Core/src/AssFont.cs @@ -22,6 +22,21 @@ public static Dictionary> GetAssFonts(string file, out A var undefinedStyles = new HashSet(); foreach (var und in undefinedStylesTemp) { + var usedUndStylesEvents = ass.Events.Collection.Where(e => e.Style == und); + var notUsed = true; + foreach (var evt in usedUndStylesEvents) + { + if (evt.Text.Count == 0) continue; + foreach (var blk in evt.Text) + { + if (!AssTagParse.IsOverrideBlock(blk)) + { + notUsed = false; + } + } + } + if (notUsed) continue; + if (ass.Styles.Names.Contains(und.TrimStart('*'))) { // vsfilter ingore starting asterisk