devine icon indicating copy to clipboard operation
devine copied to clipboard

Improvements for fonts detection

Open kannarima opened this issue 1 year ago • 2 comments

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

kannarima avatar Apr 03 '24 07:04 kannarima

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.

moi15moi avatar May 01 '24 12:05 moi15moi

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)

hazylumkun avatar Jan 03 '25 13:01 hazylumkun