-
Notifications
You must be signed in to change notification settings - Fork 29
Wrong font color when using opacity #52
Comments
The pitfall is that opacity is separate for the text (\1a) and the shadow (\3a), so setting global opacity only works when both are the same value, not in general. |
The darkness comes from the text shadows being rendered behind the text. Actually the SVG version has the wrong color also. For example, Aegisub's default blue video background ( |
That ^ commit fixes it for SVG outlines, since it's possible to cut the original shape out from the composite outline. It's not so easy with text-shadow ... |
Maybe "possible way" to do this would be to implement outline via different CSS-property. Before trying disabling SVG I'm wondered "How did you implemented outline in plain CSS?". Anyway, thing with many text-shadows was pretty interesting. |
I remember I had at one point made a prototype that rendered every dialogue twice. The first one had only text-shadows and no color, and the second one had only color and no text-shadows. The text-shadows-only one was put into its own set of layer divs so that it would appear in the same position as the color-only one but behind it. I threw it away because it didn't seem necessary to justify it but maybe I should bring it back. That doesn't solve the problem still of the multiple text-shadows darkening themselves outside the text, which is for the same reason (many shadows overlapping). But maybe it's less of a problem because shadows usually tend to be dark so a darker shadow is not very noticeable. As for other properties besides text-shadow, I don't think there are any suitable ones. The closest is the text-stroke family of properties which aren't really suitable (see #39). |
By the way, does CSS renderer (with disabled SVG) have problems with other styles/effects? I mean is text outline is the only problem? And the reason why I interested in CSS renderer. I found out that libjass with disabled SVG is much faster and not lagging on some karaoke (although maybe that's because some effects are disabled, lol). I made (very) small research and seems canvas has plenty of features that required for various effects (including outline). There tools like this, but I don't think that it even necessary. I think canvas would be faster than inserting svg filters for each dialogue. Yes, I seen #13 but it's without any info. So I want to ask your opinion. You probably know something that I don't know about canvas. |
(Answered in #13) |
Actually, the two-div method would have the same problem (shadows behind translucent text) so it wouldn't make any difference. Only thing I can think of is that if primaryAlpha === outlineAlpha === shadowAlpha, then set alpha in the colors to 1 and use CSS |
…same value. This helps to avoid rendering translucent outlines or shadows behind translucent text for the common case where the alpha for primary, outline and shadow colors are the same value. Reported in #52
And that ^ commit fixes it for that case. |
libjass with enableSvg = true:
libjass with enableSvg = false: (notice that it darken than previous, it more noticeable on colored text)
Aegisub (libass):
Script:
Maybe just remove rgba from "color" and "text-shadow" and add "opacity". I tried it via debugger and seems like everything is okay.
For example replace:
to:
Or is there some kind of pitfall?
The text was updated successfully, but these errors were encountered: