Giter Site home page Giter Site logo

API Addition: "Strict Mode" about libass HOT 5 OPEN

rcombs avatar rcombs commented on May 27, 2024
API Addition: "Strict Mode"

from libass.

Comments (5)

rcombs avatar rcombs commented on May 27, 2024

Actually, after some further discussion, this sort of thing probably makes a lot more sense at the authoring-tool level than at the renderer.

from libass.

 avatar commented on May 27, 2024

Well, I doubt Aegisub actually parses ASS tags to a large extend - mostly it just generates and displays them, but the user is free to add whatever he wants. Also, subtitle creators (the one who use insane scripts etc.) probably would like to test whether their script does something stupid.

So this actually would make sense?

from libass.

rcombs avatar rcombs commented on May 27, 2024

Heh, I was mostly thinking about fonts, but yeah, there are plenty of other ways to be invalid that we could check in-renderer.

from libass.

 avatar commented on May 27, 2024

The problem with this is that we don't have any strict parsing anywhere.

from libass.

rcombs avatar rcombs commented on May 27, 2024

A specific case where this comes up (merging from #425):

When working in Aegisub, it's possible to enter a font name that will appear to work on your machine, but won't if the font is muxed. Example:

  • The copy of MS PGothic that ships on macOS is non-PostScript, has fullnames MS PGothic and MS Pゴシック, and PostScript name MS-PGothic
  • When searching for MS-PGothic, we won't match the font because the fullnames don't match and it's non-PostScript
  • We then call default_provider->funcs.get_fallback, passing in MS-PGothic
  • On macOS, CoreText helpfully returns MS PGothic
  • We then search for MS PGothic and end up with the font we'd been looking for to begin with

This is hazardous, since it's possible to enter a font name, think everything is perfectly fine, mux it, and then be informed too late that it doesn't work on systems that don't have it installed (or that do, but are on a different platform).

When in strict mode/authoring mode, we should either explode and draw tofu if matching the requested font name fails, or pass Arial to default_provider->funcs.get_fallback. The latter would be simpler to implement, but the former would be more robust.

from libass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.