Fix .ass non-integer margin values
Fixes https://github.com/TypesettingTools/Aegisub/issues/443
"bad lexical cast" when parsing .ass file.
When the parser fails to parse an integer, it will now try to parse and round a float, if this also fails (eg. empty value) it defaults to 0.
While this PR improves parsing in some places, it's not complete. The main two issues are:
- It updates parsing for margins in dialogue lines but does not update the parsing of any other int values (dialogue layer numbers and various style fields)
- It does not fully match vsfilter/libass's parsing. For example, it does not recognize
&Hhexadecimals, and it incorrectly parses decimal numbers as floats with some rounding logic that will likely break in edge cases.
If integer parsing is updated, I'd like to make it fully match vsfilter/libass's parsing across all integer values. In fact, I think the best course of action is to just copy-paste the relevant libass code with a comment explaining the motivation and giving the proper copyright notices.
(In theory it's also possible to call libass directly to do the parsing, but that would need a fair bit of hacking to handle cases like comments, invalid styles, etc.)