| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
We were discussing whether this should be public or private. It could be
public, because the API is potentially useful, and is relatively simple.
On the other hand, the API is not necessarily final, and making it
public would prevent us from improving/fixing it.
Make it private for now - making it public later is much easier than
having to break the public API later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
While enums normally are ints on most systems, it isn't guaranteed. This
might also make C++ code fail to compile, since C++ doesn't allow
implicit conversion of ints to enums.
If the API user ever passed anything other than 0 or 1, compatibility
will still break, but I guess we have to live with this.
Also extend the doxygen.
|
|
|
|
|
|
|
|
| |
Add malloc checks with useful semantics and error checks in some
specific cases. This should hopefully make fontselect more robust.
The platform-specific font providers (DirectWrite/CoreText/FontConfig)
still need to be checked for proper memory management.
|
|
|
|
| |
Incomplete, leaks memory, but capable of rendering something.
|
|
|
|
|
|
| |
This allows client code to query libass for the font providers it was compiled
with. It can be useful for clients so that they can show selection interfaces
to their users.
|
|
|
|
|
|
|
|
|
| |
Allow the user of libass to select the font provider from ass_set_fonts. This
API change actually doesn't break client code which was passing `fc=1`; now
the same value will autodetect a usable font provider.
Also add an api to list available font providers as that is useful for client
code to show drop down menus with a font provider to choose from.
|
|
|
|
|
|
|
|
|
|
|
| |
Up until now fontselect used the face index to identify which font to load
from a font collection. While this pretty convenient when using something
freetype based like fontconfig, it seems to be somewhat freetype specific.
CoreText uses the PostScript name as the unique identifier of a font. This
commit allows to use that instead of the index to decide which face to open
with FT_New_Face. To use the PostScript name the provider must return a -1
index and the PostScript name.
|
|
|
|
|
|
|
| |
Add wrapper to the ASS_Renderer to create a font provider from
its internal font selector and shuffle some code around to export
everything that's needed for font providers to the public. Document
font provider functions.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Add tons of ASS_OVERRIDE_ flags, which control whether certain ASS_Style
fields are copied when doing selective style overrides with
ass_set_selective_style_override_enabled().
This comes with some cleanup. It should be fully backwards-compatible.
|
|
|
|
|
|
| |
Our public headers can be #included from C++. Hence, ass.h needs
an extern "C" guard to declare the correct linkage for functions.
ass_types.h only defines types, so it does not need a guard.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds 2 new API functions:
ass_set_selective_style_override()
ass_set_selective_style_override_enabled()
They can be used to force dialog text to use a specific ASS_Style. It
uses a fuzzy heuristic for that, and the quality of results may vary.
It does style overriding selectively and tries not to override things
that need explicit styling. The heuristic for that isn't set in stone
either, and can change with future libass versions.
Closes libass#88.
|
|
|
|
|
|
|
|
| |
This is somewhat similar to BorderStyle=3, but with a number of
differences. Mainly, this new BorderStyle doesn't create overlaps
within an event.
Closes #105.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Based on the patch by chadr123.
See google code issue #113.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was broken since commit f780146. For reasons why, read the commit
message of that commit. To make it short, we set the font size to
something large and constant (256), and scale the font outlines returned
by freetype to the size we need in order to get smooth animation and
accurate positioning.
Of course, this obviously breaks hinting. Fix hinting by not using the
hack mentioned above if hinting enabled.
To mitigate the issues caused by freetype grid fitting and extremely
bad ASS scripts (such as setting font size to very small values and
scaling them up with \fscx/y), we still adjust the font size such that
the font is never scaled in Y direction (only in X direction, because
the \fscx/y tags can change aspect ratio).
Also see google code issue #46.
|
|
|
|
| |
The ABI was broken and a new API function were introduced.
|
|
|
|
|
|
|
|
|
|
|
|
| |
ass_set_aspect_ratio() is confusing, because it takes a DAR and SAR
value, while libass just needs a single pixel aspect ratio. Introduce
ass_set_pixel_aspect(), which sets the pixel aspect ratio directly.
ass_set_aspect_ratio() is considered deprecated. There's no reason to
remove it, but hopefully directing users to ass_set_pixel_aspect() will
make for a simpler API.
Improve the doxygen and document what ass_set_margins() actually does.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ass_set_storage_size() overwrote the user-defined aspect ratio set with
ass_set_aspect_ratio(). Change it so that if ass_set_aspect_ratio() is
used, the ass_set_storage_size() parameters are not used for any aspect
ratio calculations. (The storage size is still used for calculating the
blur scale.) This simplifies the code as well, because the aspect ratio
is now centrally calculated in ass_start_frame().
Update the doxygen. Make it clear that ass_set_storage_size() will be
used for aspect ratio calculation, unless ass_set_aspect_ratio() is
used. Also mention what libass actually does with the dar and sar
parameters: it uses them to calculate a pixel aspect ratio, nothing
else.
Explicitly allow resetting the storage size with w=h=0. Document that
it's allowed to remove the user defined aspect ratio by setting a pixel
aspedct ratio of 0.
See issue 6.
|
|
|
|
| |
Patch by chrisburel, posted on Google code issue 31.
|
|
|
|
|
|
|
|
| |
\blur radius is not scaled from script to storage resolution
but is scaled from storage to display resolution. The same
applies to borders and shadows if ScaledBorderAndShadow is "no".
(If it is "yes", borders and shadows are scaled from script
to display resolution just like before.)
|
|
|
|
|
|
|
|
| |
This allows users to change the vertical position of normal subtitles.
MPlayer has such a feature as -sub-pos option using its internal
subtitle renderer.
Bump LIBASS_VERSION to indicate the API addition.
|
| |
|
|
|
|
|
|
|
| |
Add an API call, ass_set_shaper, and infrastructure to make shapers
selectable at runtime. Currently, this allows to switch between two
shapers: a SIMPLE shaper that maps to FriBidi and a COMPLEX shaper that
maps to HarfBuzz.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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).
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Now that libass never extracts fonts anymore, update documentation
accordingly.
|
| |
|
|
|
|
|
|
|
|
|
| |
Make sure that libass does not crash even if no default font is
provided. Additionally, fix crashes related to drawings in this and
possibly other unusual cases.
Document the default_path and default_family parameters of
ass_set_fonts.
|
| |
|
| |
|
|
|
|
|
|
| |
Rename all typedefs from the convention foo_bar_t, which can possibly
conflict with POSIX types, to FooBar (and ASS_FooBar for public
API typedefs). Fix formatting and stray comments while at it.
|
| |
|
|
|
|
| |
Use the correct terms (SAR/DAR) for the aspect ratio parameters.
|
|
|
|
|
| |
Remove useless _s suffix from struct names and remove struct name where
not needed (only the typedef'd struct is used). Clean up API headers.
|
|
|
|
|
|
| |
Instead of passing a pointer to a va_list, pass the va_list itself.
Additionally, use const char for the format string and use names in
the prototype that describe the arguments' meaning.
|
|
|
|
| |
Add a note to the docs regarding hinting method choice.
|
|
|
|
|
|
|
| |
For clarity, factor out bitmap copying into a function. Do not pad the
bitmap with stride in the last row; this can not by guaranteed anyway.
Add a comment about this peculiarity to the API documentation in ass.h
Idea by Evgeniy Stepanov.
|
|
|
|
|
|
|
|
|
|
|
| |
libass' cache was basically unmanaged; it would grow without any limits,
depending on how complex the subtitles are. Introduce a simple limiting
that resets the cache if certain limits are exceeded. The bitmap cache
is limited to approx. 50 MB size by default, while the glyph cache
allows storing up to 1000 glyphs by default. A few tests with rather
heavily softsubbed fansubs show that these limits are fine.
The API was extended with the function ass_set_cache_limits which allows
modification of these limits.
|
|
|
|
|
|
| |
Improve APi documentation; each function is properly documented now.
Add a new macro LIBASS_VERSION that encodes the version in a
hexadecimal format, similar to OpenSSL. Fix formatting of the headers.
|
|
|
|
|
|
|
| |
Add an argument to ass_set_fonts for controlling whether the fontconfig
font cache should be built/updated. Add a new function ass_fonts_update
to make it possible to update fonts later on.
Additionally, stop using FcConfigSetDefault for thread safety.
|
|
|
|
|
|
| |
It is often useful or necessary to pass custom data to a callback.
Add an argument to the callback registering function to pass a void
pointer object to the callback each time it is called.
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce functionality for providing a message callback that is used
for passing messages to the controlling application instead of simply
printing them to standard output. The function pointer to the callback
is stored in the ass_library_t instance. ass_msg needs access to it, so
in many places the library instance needs to be passed around now.
The default behavior is the old one: messages of MSGL_INFO or lower
are printed to the standard output, prefixed with "[ass]".
|
|
|
|
|
|
| |
read_file_recode is only used internally in ass_read_file and
shouldn't be exposed in the API. Remove the prototype from ass.h
and declare it static.
|
|
|
|
|
| |
Rename process_force_style to ass_process_force_style and make it
available in the DSO.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The most prominent ASS/SSA renderer (VSFilter) conveniently ignores the
real aspect ratio, and everyone seems to rely on that. This is fine
when the subtitles are rendered before anamorphic video is stretched
to its native aspect ratio, but results in wrongly stretched text with
native renderers (EOSD). It can be fixed by making libass aware of
the pixel ratio of the video. ass_set_aspect_ratio now requires an
extra argument that specifies the pixel ratio, which is just width /
height of the video after decoding.
Glyphs are stretched in x direction before transformation (rotation,
shearing), so there are still issues with transformed glyphs to be
fixed.
|
|
|
|
|
|
|
| |
Optionally pass a fontconfig config file to the fontconfig
initialisation.
This changes the public API.
|
|
|
|
|
|
|
|
|
| |
ass_set_fonts_ was wrapped through ass_set_fonts and ass_set_fonts_nofc
to either use fontconfig or not. This is not very useful, since a simple
parameter to ass_set_fonts_ can be used instead. Remove the wrapper
functions and rename the real function to ass_set_fonts.
This changes the public API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reindent complete source code (*.c, *.h) with indent, the exact command
line being:
indent -kr -i4 -bap -nut -l76 *.c *.h
From now on, new code should use (more or less) K&R style,
only spaces and no tabs, 4 spaces indent width. Avoid long lines.
Fix function declaration pointer spacing.
Remove spaces that were added to many function declarations by indent,
like some_func(foo_t * bar).
Fix indenting of macros in ass.c
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27531 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
conforming to the ASS spec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27530 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
| |
We already use LIBASS_ prefixes for the multiple inclusion guards.
Thus libass can be considered separate enough to warrant this.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26770 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26755 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
|
| |
A new function (ass_set_fonts_nofc) is introduced instead of an extra argument
to existing ass_set_fonts to keep binary compatibility with older versions of
the library.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26614 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26170 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25927 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|