devine
devine copied to clipboard
Improvements for fonts detection
Describe the solution you'd like
- Font can be changed in dialogue section, so it can be good to check also in dialogue section for fonts used
- It can be good to take only required variant instead of take all (for example only take bold variant if normal and italic are not used)
- Sometimes, variant used not exist (for example bold used but only normal exist) but nothing is write in the ASS specs so it have to fallback to normal if bold not exist I think
I suggest you to use this package to handle the font selection: https://github.com/moi15moi/FontCollector
There is currently a pre-release of the 3.0.0. If you have any suggestion, feel free to open a issue.
maybe you can modify dl.py : #659:
override_pattern = re.compile(r"\{[^}]*\\fn([^\\}]+)[^}]*\}")
#663:
if line.startswith("Dialogue: "):
overridden_fonts = [font_name.strip() for font_name in override_pattern.findall(line)]
font_names.extend(overridden_fonts)