mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Also detect fonts used in drawings in font collector
This commit is contained in:
parent
15d215f36d
commit
43d65b906b
@ -139,6 +139,8 @@ void FontCollector::ProcessDialogueLine(const AssDialogue *line, int index) {
|
||||
break;
|
||||
}
|
||||
case AssBlockType::DRAWING:
|
||||
used_styles[style].drawing = true;
|
||||
break;
|
||||
case AssBlockType::COMMENT:
|
||||
break;
|
||||
}
|
||||
@ -146,7 +148,11 @@ void FontCollector::ProcessDialogueLine(const AssDialogue *line, int index) {
|
||||
}
|
||||
|
||||
void FontCollector::ProcessChunk(std::pair<StyleInfo, UsageData> const& style) {
|
||||
if (style.second.chars.empty()) return;
|
||||
if (style.second.chars.empty() && !style.second.drawing) return;
|
||||
|
||||
if (style.second.chars.empty() && style.second.drawing) {
|
||||
status_callback(fmt_tl("Font '%s' is used in a drawing, but not in any text.\n", style.first.facename), 3);
|
||||
}
|
||||
|
||||
auto res = lister.GetFontPaths(style.first.facename, style.first.bold, style.first.italic, style.second.chars);
|
||||
|
||||
|
@ -127,6 +127,7 @@ class FontCollector {
|
||||
/// Data about where each style is used
|
||||
struct UsageData {
|
||||
std::vector<int> chars; ///< Characters used in this style which glyphs will be needed for
|
||||
bool drawing = false; ///< Whether this style is used for a drawing
|
||||
std::vector<int> lines; ///< Lines on which this style is used via overrides
|
||||
std::vector<std::string> styles; ///< ASS styles which use this style
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user