| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Split up the combined event parsing and layout loop into two passes.
State information needed for layout are duplicated in GlyphInfo
structures.
|
| |
|
|
|
|
|
|
|
|
| |
Prepare for run-based rendering. In the parser, increment a run id
according to relevant style changes (color, border, shadow, etc.) to
mark the points where a new bitmap needs to be started. Modify the line
wrapper to increment the run ids of each glyph after a break.
Add functions to calculate the render size of runs for rasterization.
|
|
|
|
|
|
| |
This horrible bug was introduced by commit c13cb2.
Pointed out by uau.
|
|
|
|
|
|
| |
Use the alpha channel, not the red channel. Fixes commit f92830.
Original patch by lachs0r.
|
|
|
|
|
|
| |
Cache ascender/descender so they don't have to be queried every frame
for every glyph. This also makes it possible to more uniformly handle
drawings and glyphs.
|
| |
|
| |
|
|
|
|
|
|
| |
Similarly to the glyph cache, subclass the bitmap cache to allow both
outline bitmaps and clipping mask bitmaps to coexist in the same cache
in a much cleaner way.
|
|
|
|
|
|
|
|
| |
The bitmap hash key duplicated a lot of information the glyph hash
key already saves. The subclassing introduced recently complicates
this even more. Modify the hash key to utilize a pointer to the glyph
hash value instead, which is faster and more flexible. Make sure to
always empty the bitmap cache when the glyph cache is emptied.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Glyphs and drawings have wildly different hash keys. Subclass the hash
keys of glyphs and drawings in a new, unified outline cache. This also
fixes some issues with drawings in the glyph cache. Now, the textual
description of the drawing is included in the key (the hash value isn't
really good enough, especially not fnv32) and the baseline offset is
saved as well.
|
| |
|
|
|
|
|
| |
Add stride support to the basic bitmap type used for low-level
rasterization.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This finally gets rid of the nasty hack that manipulated a glyph
we somehow got from FreeType. Simplifies drawing handling a bit and
decouples drawing code from all font handling and related (fontconfig,
etc.) code.
|
|
|
|
|
|
|
|
|
| |
This introduces functions to use and copy pointered outline objects
easily and uses these instead of glyphs everywhere.
Previously the glyph cache was abused for caching vector clipping masks,
but this isn't possible anymore (nor desirable), thus vector clipping
cache has been disabled for the moment.
|
|
|
|
|
| |
This covers rasterization, filtering and blending for one
render item.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libass can render both regular glyphs (extracted from a font) and
drawings, which are inserted into an existing glyph so far. This is a
rather crude hack. However, it is necessary, as the renderer only works
with FT_Glyphs. The obvious solution is to work on the underlying
outlines directly instead.
This is the first step to make this possible: change the basic
rasterizer to use the outline-specific rasterization functions. There
are more advantages:
- It's more efficient. The bitmap can be directly rendered into the
bordered target bitmap.
- This should make it easier to adapt the renderer to run-based
rendering later on (the pixels are ORed into the target)
The higher-level rendering code still needs to be adjusted.
|
|
|
|
|
|
|
| |
Only try to remove any further whitespace in front of a line if the
first character of the line (the break character) is whitespace.
Addresses Issue 35.
|
| |
|
|
|
|
|
|
|
|
| |
- less code, cleaner
- decoupled from ASS_Library
- better data encapsulation
- simpler interface
- avoids a nasty hack
|
| |
|
| |
|
| |
|
|
|
|
| |
Use 50% alpha for the shadow. Looks nicer and is just like VSFilter.
|
|
|
|
|
| |
Track if we already parsed a fade or a alignment tag and ignore all
further tags.
|
|
|
|
|
|
|
|
| |
After font reselection, loop through all charmaps if no glyph can't be
found until we hopefully find one that works. If we get here at all, the
font is seriously broken, so this is unlikely to harm anything.
This improves the last resort charmap fallback introduced in 96057d.
|
|
|
|
| |
VSFilter always matches style names case sensitive.
|
|
|
|
|
|
| |
Make the "Default" style, useful as a fallback and required by few
scripts for proper rendering, actually do something sensible. Font,
sizes, et cetera are set up mostly like VSFilter.
|
|
|
|
|
| |
Yet another VSFilter idiosyncracy: when the glyph fill is invisible
(alpha 0xFF) and there is no border, do not render any shadow.
|
|
|
|
|
|
| |
MPlayer is able to use this configuration with the -nofontconfig flag;
this fixes crashes in case no font is available. Fixes a crash at uninit
as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wrap_lines_smart() got stuck if there was a long line without spaces
followed by a hard linebreak. When the loop got to the '\n' character
the hard linebreak was not handled because the line was already over
wrap length and soft linebreak handling had precedence. Then at the
end of the loop body the code noted that the hard linebreak hadn't yet
been handled, and the same glyph needed to be reprocessed for that.
However, the soft linebreak code hadn't actually done anything because
there was no space to break at, and thus the loop repeated from the
exact same state forever.
Handle this by removing the check for an additional hard linebreak
after a soft linebreak, which stepped back by one char. This is a
very marginal case and shouldn't really matter in practice.
Original patch and parts of this message by uau.
|
|
|
|
|
|
| |
In hope to make libass as useful as possible, relicense libass to ISC, a
simplified 2-clause BSD license. All contributors who provided
non-trivial changes have granted their permission for this.
|
|
|
|
|
|
|
| |
These forms can be used to add or subtract a value from the
current font size instead of setting a new font size. Animations
are supported, but not recommended, as they won't be fluid due to
grid-fitting/hinting.
|
|
|
|
|
|
| |
It looks like VSFilter only ever wraps on spaces, even if the line
length is going to overflow. We should do that as well.
Fixes a pretty confusing problem with scrolling vertical text.
|
| |
|
| |
|
|
|
|
|
| |
The useless "if (foo) free(foo)" idiom is all over the place, just
get rid of it finally...
|
| |
|
| |
|
|
|
|
|
|
| |
Delay allocation of the "faux" glyph until a drawing is parsed.
This helps with fixing a (pretty bad) memory leak and also reduces frame
overhead a little.
|
|
|
|
|
| |
strcasecmp/strncasecmp needs strings.h according to POSIX, so add this
include where these occur.
|
| |
|
|
|
|
|
| |
Increment shared library revision (due to API additions) and autoconf
version.
|
|
|
|
|
|
| |
If we're already after the font reselection stage and a glyph cannot be
found in a font, try again with the first charmap as a last resort.
This is needed for old "symbol" fonts, for example.
|
|
|
|
| |
This is more irritating than it helps and can seriously spam output.
|
|
|
|
|
|
| |
Similar to regular glyphs, check the bounding box of the clip mask and
refrain from rendering humongous masks, which can take up considerably
memory.
|
| |
|
| |
|
| |
|
|
|
|
| |
Gets rid of another forward declaration.
|
|
|
|
|
| |
Cosmetical simplifications, fix whitespace where useful, remove
deprecated comments.
|
| |
|
| |
|
|
|
|
| |
These are included by ass_render.h already.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now that bitmap glyphs (for vector clip masks) are stored in the glyph
cache, make sure it cannot grow indefinitely easily. Similar to the
bitmap cache, track approximate size of the cached elements and reset
if the cache exceeds a certain limit.
Also, reduce default bitmap cache size to 30 MB as we have essentially
two bitmap caches now. That's still plenty in all use cases where
caching matters.
|
|
|
|
|
| |
Free clip vector drawing if multiple clip vectors appear in a single
line. (In this case the last clip vector is used.)
|
| |
|
| |
|
|
|
|
|
|
| |
Use extremes of all points fed to the parser, instead of only points
that are added to the outline.
Fixes a rendering problem reported on IRC and should fix Issue #7.
|
|
|
|
|
| |
Cache pre-rasterized vector clip masks, big speedup if vector clipping
is used extensively.
|
|
|
|
| |
Gets rid of a few forward declarations.
|
|
|
|
|
|
|
|
|
|
| |
PAR correction so far merely applied a horizontal scaling factor to
glyphs right after loading. This screws up transformed text,
unfortunately.
It's a much better approach to typeset text without correction and scale
everything at the very end. In MPlayer, an EOSD rendering now looks
exactly the same as a video filter rendering (except for more sharpness
in the EOSD case).
|
|
|
|
| |
Limit context printed after parsing errors to 30 characters
|
| |
|
| |
|
|
|
|
|
| |
The glyph is inserted into the cache and freed upon cache reset,
so it shouldn't be freed alongside the drawing.
|
|
|
|
|
| |
Let's loop over everything and not just the outline check. *sigh*
Fixes a crash reported by lachs0r on IRC.
|
| |
|
|
|
|
|
|
|
|
|
| |
Do not copy glyphs when it isn't really needed.
Profiling with valgrind's callgrind showed that FT_Glyph_Copy takes a
big fraction of the rendering time (~40%) for "simple styled softsubs"
cases. It turned out that glyphs are duplicated much more often than
is necessary. Reducing the number of copies cuts down the rendering
time for the "simple styled softsubs" case by about 70%!
|
|
|
|
|
|
|
|
| |
Reverse "outside" contours with wrong winding correction, require
that a contour is "inside" for considering its removal; Move this
hack into ass_font.c, where it belongs.
Initial patch by uau.
|
|
|
|
|
|
|
|
| |
Only match outline fonts and take slant and weight into consideration.
This matches all font faces which have at least the slant/weight that is
requested. This fixes issue 23; however, corner cases can be constructed
in which wrong fonts will be matched, if multiple slant/weight variants
of the same font exist, but that is very unlikely in practice.
|
|
|
|
|
| |
The last point wasn't included in cbox calculation, sometimes triggering
removal of inside contours when it wasn't needed.
|
|
|
|
| |
Fix for previous commit.
|
|
|
|
|
|
| |
Add a function to flush all events in a track and increment
LIBASS_VERSION to indicate the addition.
Initial patch by Aurelien Jacobs (aurel AT gnuage DOT org).
|
|
|
|
| |
This allows |