| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Its only use was removed in commit b63d8931.
|
| |
|
|
|
|
|
| |
The ass_func_template.h entry was removed with commit c22a4ff9.
utils.asm is really new.
|
|
|
|
|
|
| |
As pointed out in #198. This is certainly just a typo.
Fixes #198.
|
|
|
|
|
|
|
|
|
|
|
| |
There is no real value in it. ENCA only works in some cases and I
can't find any information about software that integrates libass
which relies on it or users that rely on ENCA support in case the
interface is exposed directly (e.g. in MPlayer).
If there is still a wish to have charset detection integrated into
libass (it is out of scope, IMHO), a better library like uchardet
should be used for that.
|
|\
| |
| | |
MSVC/ICL and general header fixes
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As before, this does not add any build system support:
a config.h file and a project must still be manually created
(or the compiler can be run manually instead of using a project).
Signed-off-by: Grigori Goronzy <greg@kinoho.net>
Signed-off-by: Oleg Oshmyan <chortos@inbox.lv>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This way, #include "config.h" is consistently the very
first thing the compiler sees when compiling any file.
Some source files currently don't use anything defined in config.h,
but it's easier and less error-prone to include it now to anticipate
possible future changes in those files, config.h or other headers.
|
| | |
|
| | |
|
|/
|
|
| |
It was needed for UTF16BE -> UTF8 only, which is trivial to implement.
|
|
|
|
| |
WINBOOL is MingW-specific.
|
|
|
|
|
| |
MSVC requires the calling convention to be grouped with the identifier when
defining a callback type.
|
|
|
|
|
|
|
|
|
|
| |
This is more robust and simpler. The bearing calculations initially
were bugged, but getting rid of them completely seems better. It is
consistent with other text renderers as well. To simplify things, also
move striking before the additional scale is applied and get rid of the
half-pixel overlapping thing; it is not needed with additive blending.
Fixes #193.
|
|
|
|
|
| |
This seems to cause issues on MSVC. Considering that even most Unix OSes
hate PATH_MAX and don't really honour it, using 4096 is just as good.
|
|
|
|
|
|
|
|
| |
OS or platform-specific locale independent functions are painful to
use and/or not available, so roll our own. Not great but the least
painful and least intrusive.
v2: fix indexing, use static inline
|
|
|
|
|
|
| |
Passing NULL as argument to %s format specifiers when using the printf
fasmily of functions is not allowed. While some libcs handle it, other
libcs will simply crash.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Also fixes the build on OSX under some circumstances (weird and
inconsistent rules for the inline keyword in C).
|
| |
|
|
|
|
|
| |
MSGL_V is usually for far noisier messages, such as those printed per
subtitle event.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another consequence of the trickiness in this code. This codepath for
opaque_box=1 assumes both bm_o and bm_g are set, but if memory
allocation fails somewhere, bm_o could be non-NULL, but bm_g NULL, which
then would result in a crash when accessing bm_g.
Possibly this code could be cleaned up to look much nicer (and not have
dozens of hidden, obscure bugs), but for now this fixes the potential
crash found by Coverity.
Fixes CID 146125.
|
|
|
|
| |
Fixes CID 146421.
|
|
|
|
| |
Fixes CID 146124.
|
|
|
|
|
| |
Also move the argument parsing part to the top of the function. IT's
easier to read this way.
|
|
|
|
|
|
|
|
|
|
| |
The logic here is pretty complicated. The caller of this function guards
it with "if(info->bm || info->bm_o){", and generally indeed only one of
them is set. But in some cases, both are needed. fix_outline()
definitely dereferences both. This is not necessarily guaranteed, e.g.
on out of memory errors. Add the missing checks.
Fixes CID 146125.
|
|
|
|
| |
Bad things can happen otherwise. Found by coverity scan.
|
|
|
|
| |
Introduced by commit d6bb9af6. Found by coverity scan.
|
|\ |
|
| |
| |
| |
| |
| | |
The name is always pulled from the font info, which is static, so
there is no need to strdup.
|
| | |
|
| |
| |
| |
| |
| | |
fontselect is an internal only API for now. That said, it also seems
much more sane to let library users deal with this resource management.
|
| |
| |
| |
| | |
Found by clang static analysis.
|
| |
| |
| |
| | |
In case a font provider actually uses more than one substitution.
|
| | |
|
| |
| |
| |
| |
| |
| | |
If no particular codepoint is requested (codepoint == 0), just return
the first font family. Additionally, handle fontconfig errors, albeit
they're unlikely to happen.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't want to add fonts multiple times, so call match_fonts lazily,
i.e. only after selecting a font with a certain name failed. Since
font matching interacts with glyph coverage checks, add a simple
mechanism to determine whether matching failed because of name or
glyph coverage. Additionally make sure to handle substitutions before
any calls to match_fonts; this only correctly deals with single-name
substitutions, though.
|
| |
| |
| |
| |
| | |
This adds simple and sensible substitutions for generic font family
names. A helper function is introduced to reduce code duplication.
|
| | |
|
| |
| |
| |
| | |
A name clash was introduced by commit ab08d079.
|
| |
| |
| |
| |
| |
| | |
CFRelease(NULL) can crash. While we're still not sure which CoreText API
calls can fail etc. (thanks Apple), this should fix a couple of
theoretically possible crashes.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The default font provider needs to provide a GetFallbackFunc callback
instead.
|
| | |
|
| |
| |
| |
| |
| | |
The CoreText backend doesn't like this, and in fact there's no reason to
pass NULL.
|
| | |
|
| |
| |
| |
| |
| | |
We already decided that eager loading is too slow. No need to keep
multiple code paths around.
|
| |
| |
| |
| |
| | |
Apparently we only need the font family (and even that isn't used in all
font providers). Drop the others.
|
| |
| |
| |
| |
| |
| | |
Tired of matching the names and order of the callbacks in my head.
While we're at it, also give some of the callbacks better names.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Apparently, libfreetype calls close_stream_font through the
FT_Stream.close callback.
|
| |
| |
| |
| | |
The result of the subst_font callback was not freed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ass_set_fonts_dir() is supposed to enable all fonts in a specific
directory. The implementation for it was dropped with the commit
introducing the new fontselect code. Some users were relying on it, so
we need it back.
It used to be implemented using a single fontconfig call. But since this
has to work even if fontconfig support is not even compiled, a new
implementation is needed.
This commit adds very simple and low-effort support for it. It loads all
files into memory, and then lets the memory font code do the rest. A
more efficient implementation would be possible, for example by
implementing a new font provider, which serves get_data requests from
open file handles. Anyone who wants to do this is welcome to try, and
this commit is just the minimum to restore the lost feature.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The caches may reference data which belongs to the font provider. If the
font selector and the font provider are destroyed, it can leave dangling
pointers in the renderer cache. (At least that's what it looks like.)
For some reason, this didn't even trigger valgrind warnings with the
fontconfig font provider. Possibly the dangling pointers were FT_Face
pointers, and fontconfig might cache these process-wide.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An earlier commit added this code to avoid adding font faces multiple
times. In this form, it breaks the "Trying all charmaps" fallback case,
which can lead to text being rendered as boxes.
Return the font that is going to contain the missing glyph instead. The
calling code will check again, and run the fallback if necessary.
|
| |
| |
| |
| | |
I broke it.
|
| |
| |
| |
| |
| | |
Also, remove the ass_coretext.c conditional compilation hack, and fix
Makefile.am instead.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
FcInitLoadConfig() could faul, leaving rc=1 and fc->config=NULL, making
FcConfigBuildFonts() potentially crash.
Also, the FcConfigBuildFonts() return value was not checked.
|
| |
| |
| |
| |
| | |
Use a pointer to the selected font info, instead of an index. Makes the
code a bit more readable.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This code prioritized fonts by scanning order, but the scanning order is
essentially arbitrary. This resulted in suboptimal and indeterministic
font selection by family name.
Prefer the order as returned by the substitution callback. This requires
some restructuring. The core algorithm is still exactly the same though;
only the order of comparisons changes.
If the font backend has no subtitution callback, nothing should change.
|
| |
| |
| |
|