summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drawing: remove unused fieldwm42015-10-142-2/+0
|
* configure: don't add unnecessary libraries to PKG_LIBS_PRIVATEOleg Oshmyan2015-10-141-3/+6
| | | | | | Library checks can succeed if the needed functions exist in libc and don't need any extra linker flags. Avoid adding unnecessary flags (which break static linking against libass) in this case.
* configure: include -liconv if that is foundwm42015-10-131-2/+7
|
* ass: use a bitmap for checking duplicate eventswm42015-10-123-4/+61
| | | | | | | | | | | | | The loop in check_duplicate_event() essentially makes event processing with ass_process_chunk() O(n^2). Using a bitmap instead of a loop brings it back to O(n). This could be interpreted as an API change: since the event list is freely modifieable by the API user through ASS_Track public fields, libass can't know if the internal bitmap went out of sync with the public event list. We just redefine it so that calling ass_process_chunk() means the API user agrees not to manipulate the event list otherwise.
* configure: Set the correct x32 machine option for yasmLuke Dashjr2015-10-101-0/+6
|
* Use proper include statement for HarfBuzzwm42015-10-071-1/+1
|
* cache: remove unused BINSTRING field typewm42015-10-061-9/+0
| | | | Its only use was removed in commit b63d8931.
* Update last release date in READMEOleg Oshmyan2015-10-031-1/+1
|
* Release 0.13.00.13.0wm42015-10-035-6/+36
|
* build: add missing new source fileswm42015-10-031-2/+3
| | | | | The ass_func_template.h entry was removed with commit c22a4ff9. utils.asm is really new.
* configure: do not add -ldwrite to libass.pcwm42015-09-241-3/+0
| | | | | This was forgotten. We always load dwrite.dll at runtime, so this isn't needed.
* ass_font: fix broken loop conditionwm42015-09-241-1/+1
| | | | | | As pointed out in #198. This is certainly just a typo. Fixes #198.
* Merge pull request #197 from grigorig/remove-encaGrigori Goronzy2015-09-234-91/+5
|\ | | | | Remove ENCA support
| * Remove ENCA supportGrigori Goronzy2015-09-234-91/+5
|/ | | | | | | | | | | 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.
* Merge pull request #84 from astiob/msvcGrigori Goronzy2015-09-2230-17/+67
|\ | | | | MSVC/ICL and general header fixes
| * Fully fix compilation with MSVC/ICLOleg Oshmyan2015-09-1722-1/+51
| | | | | | | | | | | | | | | | | | 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>
| * Include config.h in all source files and in no headersOleg Oshmyan2015-09-1712-12/+12
| | | | | | | | | | | | | | | | | | 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.
| * Move ASS_Shaper declaration to ass_shaper.hOleg Oshmyan2015-09-172-3/+4
| |
| * unistd.h is not neededOleg Oshmyan2015-09-172-2/+1
| |
* | fontselect: make iconv optional againwm42015-09-213-22/+61
|/ | | | It was needed for UTF16BE -> UTF8 only, which is trivial to implement.
* directwrite: change WINBOOL to BOOL.torque2015-09-172-11/+11
| | | | WINBOOL is MingW-specific.
* directwrite: fix syntax error with MSVC.torque2015-09-171-1/+1
| | | | | MSVC requires the calling convention to be grouped with the identifier when defining a callback type.
* font: ignore bearing for strikesGrigori Goronzy2015-09-161-16/+11
| | | | | | | | | | 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.
* ass_fontselect: do not use PATH_MAXwm42015-09-131-1/+1
| | | | | 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.
* Merge pull request #192 from grigorig/stringfuncsGrigori Goronzy2015-09-119-51/+162
|\ | | | | NIH: add locale-independent string functions
| * NIH: add locale-independent string functionsGrigori Goronzy2015-09-119-51/+162
|/ | | | | | | | 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
* fontselect: avoid undefined behaviorwm42015-09-091-3/+5
| | | | | | 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.
* fontselect: raise font selection log messagewm42015-09-091-1/+1
|
* ass_fontselect: ignore ./.. and hidden fileswm42015-09-081-0/+2
|
* fontselect: handle additional malloc errorsGrigori Goronzy2015-09-081-2/+5
|
* ass_fontselect: uninline ass_map_font()wm42015-09-072-12/+15
| | | | | Also fixes the build on OSX under some circumstances (weird and inconsistent rules for the inline keyword in C).
* configure: make fontconfig optionalwm42015-09-071-1/+14
|
* ass_fontselect: log the selected font providerwm42015-09-071-5/+9
|
* ass_shaper: raise shaper info log levelwm42015-09-071-1/+1
| | | | | MSGL_V is usually for far noisier messages, such as those printed per subtitle event.
* ass_bitmap: fix potential NULL derefwm42015-09-071-3/+7
| | | | | | | | | | | | | 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.
* ass_render: fix potential NULL derefwm42015-09-071-1/+1
| | | | Fixes CID 146421.
* travis: run on OSX toowm42015-09-071-1/+2
|
* ass_drawing: make ass_drawing_new() fail properly on OOMwm42015-09-071-1/+4
| | | | Fixes CID 146124.
* ass_parse: add check against ass_drawing_new() failurewm42015-09-071-8/+9
| | | | | Also move the argument parsing part to the top of the function. IT's easier to read this way.
* ass_render: fix potential NULL derefwm42015-09-071-2/+2
| | | | | | | | | | 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.
* fontselect: initialize postscript nameGrigori Goronzy2015-09-071-1/+1
| | | | Bad things can happen otherwise. Found by coverity scan.
* fontselect: fix memory leakGrigori Goronzy2015-09-071-1/+1
| | | | Introduced by commit d6bb9af6. Found by coverity scan.
* Merge branch 'fonts'Grigori Goronzy2015-09-0727-615/+3602
|\
| * Merge pull request #190 from grigorig/fontsGrigori Goronzy2015-09-077-44/+144
| |\ | | | | | | Substitutions and some fixes
| | * fontselect: get rid of strdup for display nameGrigori Goronzy2015-09-072-8/+3
| | | | | | | | | | | | | | | The name is always pulled from the font info, which is static, so there is no need to strdup.
| | * fontselect: improve font display name choiceGrigori Goronzy2015-09-071-3/+7
| | |
| | * fontselect: remove outdated remarkGrigori Goronzy2015-09-071-4/+0
| | | | | | | | | | | | | | | 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.
| | * fontconfig: fix memory leak in error pathGrigori Goronzy2015-09-071-0/+1
| | | | | | | | | | | | Found by clang static analysis.
| | * fontselect: call match_fonts for each aliasGrigori Goronzy2015-09-071-3/+6
| | | | | | | | | | | | In case a font provider actually uses more than one substitution.
| | * test: use proper fallback nameGrigori Goronzy2015-09-071-1/+1
| | | | | | | | | | | | | | | The correct generic family name is "sans-serif", the short form "Sans" is specific to fontconfig only.
| | * fontselect: fix fallback family fallbackGrigori Goronzy2015-09-071-1/+1
| | |
| | * fontconfig: handle fallback corner casesGrigori Goronzy2015-09-071-2/+16
| | | | | | | | | | | | | | | | | | If no particular codepoint is requested (codepoint == 0), just return the first font family. Additionally, handle fontconfig errors, albeit they're unlikely to happen.
| | * fontselect: fix match_fonts semanticsGrigori Goronzy2015-09-071-27/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * directwrite, coretext: implement substitutionsGrigori Goronzy2015-09-023-0/+59
| |/ | | | | | | | | This adds simple and sensible substitutions for generic font family names. A helper function is introduced to reduce code duplication.
| * directwrite: fix fallback for codepoint 0Grigori Goronzy2015-09-011-5/+7
| |
| * directwrite: fix compilationGrigori Goronzy2015-09-011-1/+1
| | | | | | | | A name clash was introduced by commit ab08d079.
| * coretext: use SAFE_CFRelease() for robustnesswm42015-09-011-17/+18
| | | | | | | | | | | | 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.
| * fontselect: fix yet another memory leakGrigori Goronzy2015-09-011-0/+2
| |
| * fontselect: stop font selection after first matchGrigori Goronzy2015-09-011-0/+5
| |
| * fontselect: remove static fallback font listGrigori Goronzy2015-09-011-26/+0
| | | | | | | | | | The default font provider needs to provide a GetFallbackFunc callback instead.
| * fontselect: add constwm42015-09-011-1/+1
| |
| * fontselect: never pass family=NULL to get_fallback()wm42015-09-012-1/+4
| | | | | | | | | | The CoreText backend doesn't like this, and in fact there's no reason to pass NULL.
| * coretext: fix sizeof vs. strlenwm42015-09-011-2/+1
| |
| * coretext: always use lazy loadingwm42015-09-011-29/+1
| | | | | | | | | | We already decided that eager loading is too slow. No need to keep multiple code paths around.
| * fontselect: simplify get_fallback signaturewm42015-09-015-16/+9
| | | | | | | | | | Apparently we only need the font family (and even that isn't used in all font providers). Drop the others.
| * fontselect: use designated initializerswm42015-09-015-37/+28
| | | | | | | | | | | | 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.
| * coretext: implement GetFallbackFuncStefano Pigozzi2015-09-011-1/+25
| |
| * fontselect: add bounds checking for memory font stream readswm42015-08-311-0/+6
| |
| * font: fix double frees if opening memory font failswm42015-08-311-2/+0
| | | | | | | | | | Apparently, libfreetype calls close_stream_font through the FT_Stream.close callback.
| * fontselect: fix a memory leakwm42015-08-311-22/+29
| | | | | | | | The result of the subst_font callback was not freed.
| * fontselect: reimplement ass_set_fonts_dir() functionalitywm42015-08-283-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * render_api: fix crash when calling ass_set_fonts() after renderingwm42015-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | 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.
| * font: fix broken charmap fallback handlingwm42015-08-281-1/+1
| | | | | | | | | | | | | | | | | | 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.
| * fontselect: fix fallbackswm42015-08-281-1/+1