Comments (7)
-
Correct, functional headers and normal metadata headers should only be specified once with the correct value, but
!
may appear multiple times.
;
comments are used by generators/editors and often stripped and replaced on resave; e.g. Aegisub will discard any;
lines when loading a file and then later add its own on saving. If;
comments were used for custom metadata, all added metadata would be lost just by resaving the file from an editor.!
headers on the other hand are preserved. -
Any current renderer has no issues with timestamps up to 596 hours and from my testing muxers (ffmpeg and mkvtoolnix) also appear to handle multi-digit hours well.
I was not aware of Aegisub limiting timestamps like this before; thanks for bringing this up! As it turns out old libass (9beeecc 2015) also rejected multi-digit hours. That said, there seems to be no real reason for keeping this limit around and arch1t3cht/Aegisub#104 partially fixes this in Aegisub.
Do you know of any more programs which fail to handle multi-digit hours? If not, I’ll just add a note about this to the guide which will hopefully soon become irrelevant. -
Using
Encoding
/\fe
to get a particular fallback font is a terrible idea and in practice not portable and thus broken. For one regardless of whether\fe
is involved or not, fallbacks fonts are always a bit iffy as it relies on no better match being present on the system (e.g. a subber may have a modified variant of the actually specified font installed). Then fallback selection also can depend on the system’s configured locale as seen e.g. in #550 (comment) . Furthermore, even if the locale matches and the same fonts are installed, fallback logic depends on the system font provider and thus will differ depending on the OS and player configuration.
To top it of, fallback fonts are not (always) recognised by font collector tools and often not attached to the published mkv, making it straight up impossible to reproduce the desired outcome on a system without the intended fonts.
And for\fe
specifically, libass currently doesn’t support it at all (see #662) and MPC-HC ISR and xy-VSFilter also handle this property a bit differently.
While unfortunately some exiting releases do abuse fallback semantics and\fe
, this really should not be done and no new such files created. As the guide already says, if you want a particular font, just specify its actual name viaFontName
/\fn
.
(tangentially related: see also #42 for another issue, which is hard to fix because fallback expectations are involved)
from libass.
3. To top it of, fallback fonts are not (always) recognised by font collector tools
Actually, Aegisub FontCollector doesn't even care about the Encoding
, so it cannot detect the real used font if the encoding isn't 1.
I don't know any FontCollector that care about it. Probably because libass doesn't emulate it, so pretty much "no one" knows how it exactly works.
from libass.
- Correct, functional headers and normal metadata headers should only be specified once with the correct value, but may appear multiple times.
comments are used by generators/editors and often stripped and replaced on resave; e.g. Aegisub will discard any lines when loading a file and then later add its own on saving. If comments were used for custom metadata, all added metadata would be lost just by resaving the file from an editor. headers on the other hand are preserved.!``;``;``;``!
- Any current renderer has no issues with timestamps up to 596 hours and from my testing muxers (ffmpeg and mkvtoolnix) also appear to handle multi-digit hours well.
I was not aware of Aegisub limiting timestamps like this before; thanks for bringing this up! As it turns out old libass (9beeecc 2015) also rejected multi-digit hours. That said, there seems to be no real reason for keeping this limit around and Don’t truncate parsed times >=10h arch1t3cht/Aegisub#104 partially fixes this in Aegisub.
Do you know of any more programs which fail to handle multi-digit hours? If not, I’ll just add a note about this to the guide which will hopefully soon become irrelevant.- Using / to get a particular fallback font is a terrible idea and in practice not portable and thus broken. For one regardless of whether is involved or not, fallbacks fonts are always a bit iffy as it relies on no better match being present on the system (e.g. a subber may have a modified variant of the actually specified font installed). Then fallback selection also can depend on the system’s configured locale as seen e.g. in
Encoding``\fe``\fe
Take track language into account when performing font fallback #550 (comment) . Furthermore, even if the locale matches and the same fonts are installed, fallback logic depends on the system font provider and thus will differ depending on the OS and player configuration.
To top it of, fallback fonts are not (always) recognised by font collector tools and often not attached to the published mkv, making it straight up impossible to reproduce the desired outcome on a system without the intended fonts.
And for specifically, libass currently doesn’t support it at all\fe
(see Support \fe aka font Encoding in Style #662) and MPC-HC ISR and xy-VSFilter also handle this property a bit differently.
While unfortunately some exiting releases do abuse fallback semantics and , this really should not be done and no new such files created. As the guide already says, if you want a particular font, just specify its actual name via /.\fe``FontName``\fn
(tangentially related: see also \h fallback messes up positioning #42 for another issue, which is hard to fix because fallback expectations are involved)
- Kainote also behaves similarly to Aegisub. BTW, why is the upper limit 596?
\h
really bad. After reading this issue, I learned that libass will fallback toU+0020
(but I don’t know if this conversion still exists now). When using CJK font, I recommend usingU+3000
withfscx
instead of\h
,U+2003
maybe an option for Latin fonts
from libass.
- Kainote also behaves similarly to Aegisub. BTW, why is the upper limit 596?
Thanks! Welp, guess Kainote could up its limit then too.
EDIT: it seems Kainote’s parsing code already accepts multi-digit hours and the only limits I spotted were for negative times. If the input boxes don’t allow entering multi-digit hours, it appears to fortunately be only an UI issue unlike with Aegisub.
The 595
limit for hours comes from classic VSFilters (and in some parts libass to emulate this) handling timestamps internally as a 32-bit number denoting milliseconds. Everything < 596h can be represented with this, but between 566h and 567h the value overflows 32 bits.
\h
really bad. I learned that libass will fallback to U+0020 (but I don’t know if this conversion still exists now)
libass git master no longer sometimes subsitutes \h
with a regular space U+0020. Apart from older libass doing this substitution, there’s nothing special about \h
and the remaining problem in #42 is just about the sample subs using a font without \h
and expecting a very particular fallback. Which is hard to impossible to solve and subs should never rely on font fallback (which is the same with \fe
fallback).
I guess if there’s an advantage to {\fscx150} {\fscx}
it’s almost every font having a glyph for U+0020, but in comparison less fonts having a glyph for \h
.
from libass.
\h
really bad. I learned that libass will fallback to U+0020 (but I don’t know if this conversion still exists now)libass git master no longer sometimes subsitutes
\h
with a regular space U+0020. Apart from older libass doing this substitution, there’s nothing special about\h
and the remaining problem in #42 is just about the sample subs using a font without\h
and expecting a very particular fallback. Which is hard to impossible to solve and subs should never rely on font fallback (which is the same with\fe
fallback). I guess if there’s an advantage to{\fscx150} {\fscx}
it’s almost every font having a glyph for U+0020, but in comparison less fonts having a glyph for\h
.
But U+0020
at the beginning of the line will not be rendered… Such as after \N
BTW, override tags do not declare values as equivalent to default values, is this behavior correct or is it just a fallback that should be avoided? Some are counterintuitive, e.g. \b
=\b0
from libass.
But U+0020 at the beginning of the line will not be rendered… Such as after \N
Yep, but as long as the font actually has a glyph for \h
(U+00A0), there is no problem with using \h
. Just never rely on fallback glyphs.
BTW, override tags do not declare values as equivalent to default values, is this behavior correct or is it just a fallback that should be avoided?
\b
is not the same as \b0
. It resets boldness to what was declared in the Style’s Bold
field.
Many other tags (e.g. \fscx
) do the same when called with no arguments. This is established ASS behaviour and I’m not aware of any issues with it (for tags which support this, of the top of my head most should).
from libass.
BTW, override tags do not declare values as equivalent to default values, is this behavior correct or is it just a fallback that should be avoided?
\b
is not the same as\b0
. It resets boldness to what was declared in the Style’sBold
field. Many other tags (e.g.\fscx
) do the same when called with no arguments. This is established ASS behaviour and I’m not aware of any issues with it (for tags which support this, of the top of my head most should).
I understand, logically it is initialized to style.
from libass.
Related Issues (20)
- Rendering: Wrong font used for mpv OSD on Fedora 39+ HOT 2
- Multiple \pos tags in one line, any way to use them? HOT 2
- Inline fallback fonts should be sized to main font’s EM height, not line height
- How to blend ASS_Image to a rgba bitmap HOT 5
- Rendering: natural line break punctuation position in RTL languages HOT 2
- Consider adding SHSTK support HOT 4
- [DirectWrite] Does not select the right font when 2 fonts have similar attributes HOT 4
- API to discard older events from memory HOT 2
- Rendering: Different case for a non-ASCII character doesn't find the font
- Rendering: Difference in font size with Roboto Medium in VSFilter and libass HOT 3
- checkasm struggles with PIC on (64-bit) Haiku HOT 13
- Separate muxed/memory fonts from system fonts
- build: Windows 10 + msys2 (with winiconv): passing argument 2 of 'iconv' from incompatible pointer type HOT 2
- warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argumentbuild: HOT 3
- Rendering: Incorrect font variant being selected HOT 13
- Overhaul fontselect: individual, cached, full-detail queries HOT 6
- Rendering: Start Delay Issue in libass Rendering Karaoke Subtitles HOT 10
- Discuss: -ffast-math and other math optimization flags HOT 10
- How to select Cascadia Mono font? HOT 8
- [DirectWrite] libass doesn't always find a fallback font HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libass.