summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bump shared library version0.9.7Grigori Goronzy2009-08-071-1/+1
|
* Bump LIBASS_VERSION due to renamesGrigori Goronzy2009-08-061-1/+1
|
* Use int for ScaledBorderAndShadowGrigori Goronzy2009-08-061-1/+1
| | | | | Convert type for consistency with other booleans/flags that also use int.
* Rename typedefs (breaks API)Grigori Goronzy2009-08-0620-608/+614
| | | | | | 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.
* Cosmetics: add parameter name in prototypeGrigori Goronzy2009-08-051-1/+1
|
* Fix typoGrigori Goronzy2009-08-051-1/+1
|
* Clarify the AR parameter meaningsGrigori Goronzy2009-08-052-10/+10
| | | | Use the correct terms (SAR/DAR) for the aspect ratio parameters.
* Get rid of MAX_EVENTS limitGrigori Goronzy2009-07-301-3/+3
| | | | | Allocate the maximum possible number of used events in fix_collisions dynamically, eliminating the MAX_EVENTS limit.
* Do not round karaoke timing coordinatesGrigori Goronzy2009-07-291-2/+2
| | | | | | Do not round the coordinates of the glyph bbox (when converting 26.6 fixed-point to integer); they are used for timing karaoke. Doing so can sometimes make \k and \ko karaoke not apply correctly.
* Bring back names for public typesGrigori Goronzy2009-07-281-3/+3
| | | | | | For the event/style/track types, bring back the struct name, but without the _s suffix. This is useful for forward declaration of these types.
* Fix \k and \ko tagsGrigori Goronzy2009-07-281-2/+2
| | | | | | The timing calculations for \k and \ko were off and still assumed int values for a bbox, while it now uses a d6 representation. This essentially made duration about 64 times as long as it should be.
* Clean up typedefs/structsGrigori Goronzy2009-07-2813-54/+52
| | | | | 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.
* Improve message callback APIGrigori Goronzy2009-07-265-10/+9
| | | | | | 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.
* Remove shift vector in ass_render_eventGrigori Goronzy2009-07-254-13/+8
| | | | | | | The shift is not calculated when fetching a glyph anymore. Instead, it is calculated right before rasterizing a glyph. Remove the shift vector and make get_outline_glyph, the glyph cache and ass_font_set_transform work without supplying a shift vector.
* Assume 4:3 AR when calculating missing PlayResX/YGrigori Goronzy2009-07-251-7/+2
| | | | | In case only one PlayResX/Y component is specified, calculate the other component by assuming a 4:3 aspect ratio. This is similar to vsfilter.
* Handle clip vector rasterizer errorsGrigori Goronzy2009-07-241-1/+8
| | | | | If rasterizing the clip vector fails, actually handle the situation instead of crashing.
* Document ass_hinting enumGrigori Goronzy2009-07-241-1/+7
| | | | Add a note to the docs regarding hinting method choice.
* Fix renderer memory leaksGrigori Goronzy2009-07-241-3/+13
| | | | | | | | | | Use the correct free order when freeing a ass_renderer and make sure that the latest list of ass_images is freed, too. Protect the font family string against double free and make sure it is freed in free_render_context. Leaks and access problems were found by valgrind/memcheck.
* Fix fontconfig memory leaksGrigori Goronzy2009-07-241-4/+2
| | | | | | | | | | | | Do not manually use FcConfigFilename; passing a NULL pointer to FcConfigParseAndLoad is just as effective and also avoids a memory leak since the string allocated by FcConfigFilename was never freed. Free FcConfig instance in fontconfig_done; since we're not using the default configuration anymore it doesn't make sense to keep the configuration around. Leaks were found by valgrind/memcheck.
* Test program: free track/renderer/libraryGrigori Goronzy2009-07-241-0/+5
| | | | | In the test program, free the track, renderer and library properly. This is useful for memory leak testing.
* Free tracks properlyGrigori Goronzy2009-07-241-0/+2
| | | | | When freeing a track, also free the track name and the track itself. Leak found by valgrind/memcheck.
* Build system: enable/disable flags, pkg-config fixesGrigori Goronzy2009-07-242-6/+33
| | | | | * Add enable/disable flags for enca, fontconfig and libpng. * Add dependent libraries to pkg-config file to allow static linking.
* Fix compilation without fontconfigGrigori Goronzy2009-07-241-3/+5
| | | | | Adjust fontconfig_select and fontconfig_update stubs for the recent changes.
* Move render_id into ass_rendererGrigori Goronzy2009-07-241-3/+1
| | | | | The render_id (last_render_id) variable was the last remaining static data object; move it into render_priv.
* Fallback to default fontconfig configurationGrigori Goronzy2009-07-221-1/+9
| | | | | | | | If parsing or loading the fontconfig configuration file, either using the default or a specified one, fails, try to load the default fontconfig configuration. This triggers loading a fallback configuration if no configuration file is available at all. A warning message is emitted to notify the user about this.
* Fix rasterizer error handling (double free)Grigori Goronzy2009-07-221-1/+0
| | | | | | In case rasterizing a glyph is successful, but rasterizing its outline is not, do not free the glyph bitmap. It will be freed in cache cleanup later. Freeing it earlier leads to a double free.
* Bold/italic: interpret -1 as "true"Grigori Goronzy2009-07-221-6/+6
| | | | | | Interpret the value -1 as "true", as specified in the ASS specifications. Otherwise, clamp the value to 0 for other values < 0, so these are interpreted as "false".
* Add check for libm to configureGrigori Goronzy2009-07-211-0/+1
| | | | Check for libm and add the library to the linker flags.
* Do not double free default font/family buffersGrigori Goronzy2009-07-211-5/+0
| | | | Reported by Martin Sourada.
* Factor out bitmap buffer copyGrigori Goronzy2009-07-212-7/+27
| | | | | | | 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.
* Clamp clip rectangle to frame sizeGrigori Goronzy2009-07-212-4/+5
| | | | | Make sure the clip rectangle is inside the screen boundaries. Idea by Evgeniy Stepanov.
* Animations: allow equal start and end timeGrigori Goronzy2009-07-211-2/+2
| | | | | | Do not set the end time of the animation to the end time of the event in case end time and start time specified in a \t tag are equal. This should sort out a problem introduced by commit 1f176b.
* Check for table availability when striking a glyphGrigori Goronzy2009-07-201-2/+2
| | | | | | | | The glyph striker (underline/strike-through) did not check for table availability, possibly accessing a NULL pointer. Change this to only strike the glyph if the table with the appropriate information is available. Currently there is no fallback for fonts without the required information.
* Font metrics: prefer OS/2 table for ascender/descenderGrigori Goronzy2009-07-201-4/+10
| | | | | | If possible, use ascender/descender from the OS/2 TTF table. This is another try to get libass to match VSFilter in regard to vertical font metrics.
* Fix borders when a x/y component is zeroGrigori Goronzy2009-07-191-1/+1
|
* Fix drawing parser memory leakGrigori Goronzy2009-07-192-3/+1
| | | | | Always free the drawing glyph in ass_drawing_free; do not double free clip vector bitmap.
* Introduce simple cache memory managementGrigori Goronzy2009-07-195-5/+58
| | | | | | | | | | | 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.
* Fix vertical centering (VALIGN_CENTER)Grigori Goronzy2009-07-191-1/+1
| | | | | | | Match VSFilter behavior when centering non-positioned events vertically. Previously, libass put the event on top of the vertical center while VSFilter centered the event evenly. Adjust the centering to behave like VSFilter.
* Fix ascender/descender calculation for empty linesGrigori Goronzy2009-07-191-5/+8
| | | | | Take ascender/descender from the last valid glyph when empty lines occur. This makes multiple empty lines (\N\N\N etc.) work correctly.
* Improve API headers and documentationGrigori Goronzy2009-07-172-61/+171
| | | | | | 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.
* Improve fontconfig setupGrigori Goronzy2009-07-176-20/+48
| | | | | | | 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.
* Update changelog againGrigori Goronzy2009-07-171-4/+4
|
* Tweak font metrics to match Windows GDIGrigori Goronzy2009-07-171-2/+3
| | | | | Try to change ascender/descender calculation to be more compatible with Windows GDI and consequently, VSFilter.
* Clear free list on renderer uninitGrigori Goronzy2009-07-161-11/+17
| | | | | | The vector clip support introduced a free list that gets freed on every new frame. Factor out the code for freeing it into a separate function and make sure it is called when uniniting the ass_renderer.
* Implement vector clipsGrigori Goronzy2009-07-163-23/+224
| | | | | | | | | Make it possible to use drawings for clipping with \clip and \iclip. parse_tag was extended to parse drawings in \clip or \iclip tags in case parsing them as rectangular clips fails. These clip drawings are later rasterized and used for blending bitmaps, just after bitmaps are assembled into a list in render_text. Currently, the cache is not utilized for storing the parsed drawings or blended bitmaps.
* Rework build systemGrigori Goronzy2009-07-132-26/+26
| | | | | | | | * Remove checks for functions or headers that are part of ANSI C or C89. * Make enca optional. * Conditionally compile the test program depending on libpng availability.
* Output messages to stderr by defaultGrigori Goronzy2009-07-121-3/+3
| | | | | Modify the default message handler to output to stderr instead of stdout.
* Proper support for empty linesGrigori Goronzy2009-07-121-9/+8
| | | | | | | | Calculate the line height of empty lines the VSFilter way in measure_text; curiously, VSFilter sets the height of an empty line to half the height of the line before. Remove the hack that created empty lines by inserting spaces--it was wrong anyway.
* Allow passing user data to callbackGrigori Goronzy2009-07-125-8/+16
| | | | | | 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.
* Merge glyph and outline bitmap betterGrigori Goronzy2009-07-121-1/+1
| | | | | | | | Use a different threshold for merging the outline and glyph and also adjust the merge amount. This fails to give complete transparency (and thus will yield slightly darker looking glyphs, usually), but avoids very ugly looking artefacts at the edge between border and glyph that were still prevalent.
* Redo border calculations for \be and \blurGrigori Goronzy2009-07-121-25/+28
| | | | | | | | | | The last commit related to this overdid it a bit -- in some cases, with \be5, for example, edges were visible on the outlines. Instead of using a linear function to map \be applications to border enlargement value, use a nonlinear function, a simple square root. This seems to work a lot better, while keeping the enlargement small. In addition, make it possible to use \be and \blur at the same time. \be is applied first.
* Check whether renderer and track use the same library instanceGrigori Goronzy2009-07-121-0/+3
| | | | | | Add a sanity check to ass_start_frame that checks whether the track that is currently rendered from and the ass_renderer use the same library instance.
* Updates for autotools' make distGrigori Goronzy2009-07-124-4/+5
| | | | | Rename ass_cache_template.c to ass_cache_template.h; add libass.sym to EXTRA_DIST.
* Initial changelog update for 0.9.7Grigori Goronzy2009-07-112-1/+19
| | | | Update changelog and version number in configure.ac.
* autoconf: disable Fortran/C++ checksGrigori Goronzy2009-07-111-1/+4
| | | | | | For some reason, libtool wants to check for Fortran and C++ compilers, which takes some time. Disable these checks to speed up ./configure runs.
* Add AM_PROG_CC_C_O to configure.acGrigori Goronzy2009-07-111-0/+1
| | | | This basically silences a automake error/warning.
* Convert test program to plain CGrigori Goronzy2009-07-114-174/+182
| | | | | The test program unnecessarily was using a few C++ features. Convert it to plain C to make everything work without a C++ compiler.
* configure: use pkg-config for libpng, encaGrigori Goronzy2009-07-111-3/+14
| | | | | | | Use pkg-config to check for enca and libpng, like it is already done for freetype and fontconfig. Also, use libass/ass.c instead of the test program, test/test.cpp, as the unique source identification.
* Message callback funtionalityGrigori Goronzy2009-07-1118-211/+308
| | | | | | | | | | | 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]".
* Replace string defines with real stringsGrigori Goronzy2009-07-1111-191/+131
| | | | | | Instead of referencing string defines from help_mp.h, use the strings directly in ass_msg. Consequently, help_mp.h is useless and can be deleted.
* Move gaussian blur into bitmap handling codeGrigori Goronzy2009-07-103-122/+121
|
* Slight optimizations for \be, \blurGrigori Goronzy2009-07-102-5/+5
| | | | | | | Enlarge bitmap glyphs less for \be, this is especially effective for lots of \be applications. Also make sure that the gaussian blur buffers are only updated if gaussian blur is actually used for a particular glyph.
* Use better method for stroking with \xbord, \ybordGrigori Goronzy2009-07-081-86/+62
| | | | | | | | | | | | | | | Instead of stroking in two passes using the regular stroker use the outline emboldener in case different x and y stroke widths are requested. The regular outline stroker draws circular arcs, adding points to the outline. The number of points can vary according to the width of the stroker. This makes it impossible to reliably stroke in two passes with it. The outline emboldener does not produce outlines looking as nice as the stroker outlines, but it never adds points to the outline, making it suitable for two-pass emboldening with different x and y width.
* Correctly round doubles to integersGrigori Goronzy2009-07-081-2/+2
| | | | | mystrtoi and mystrtoll did not round correctly for negative numbers, this was fixed.
* Turn down subpixel accuracy to 1/8th pixelGrigori Goronzy2009-07-081-3/+4
| | | | | | | Using the full accuracy range of 1/64th pixel seems unnecessary--1/8th pixel is "good enough". Mask out the three lowest bits to lower cache and CPU usage; a short test shows that this almost halves the amount of glyphs with different subpixel shifts being generated and cached.
* Support for underline and strikethroughGrigori Goronzy2009-07-075-6/+111
| | | | | | | | | | | | | | | | | Add support for the underline (\u) and strikethrough/strikeout (\s) properties. This is a bit tricky, since FreeType doesn't offer any method of adding the lines, so you have to draw them yourself. libass uses various information from TrueType tables to get position and size of the lines, does a few simple consistency checks (some fonts might be broken) and if everything is alright, adds new contours for the lines. Sometimes, rendering errors can occur: - Currently, kerning isn't taken into account, which means the lines can overlap a little, leading to small optical glitches. - Some (broken) fonts use the wrong winding direction. In this case, the FreeType stroker will only consider the added lines to be "outside" and only stroke the line instead of the whole glyph.
* Test program: check track initializationGrigori Goronzy2009-07-071-0/+4
| | | | Stop in case the track initialization fails. This fixes a crash.
* Fix crash when event format spec is missingGrigori Goronzy2009-07-071-13/+22
| | | | | | | | libass didn't properly initialize its idea about the event format specification (the Format: line in the [Events] section) in case none was explicitly specified. This ends in a crash due to access to a null pointer. It was changed so that the event format is initialized to a reasonable default, the way it is also done for embedded subtitles.
* Implement drawing mode (\p)Grigori Goronzy2009-07-068-68/+694
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finally implement the drawing mode, which allows drawing of custom vector graphics. Drawings are intercepted in ass_render_event; a hash of the drawing string is generated which is then used for looking up drawings and bitmaps of drawings in the cache. The drawings itself are "fake" glyphs. They are created by parsing the simple drawing description language, evaluating the curves described (lines, cubic beziers and/or a special kind of b-splines) and creating vector outlines. Afterwards, these drawings are (with a few exceptions, e.g. ascender/descender) exactly handled like regular glyphs. Support for vector clippings is still missing, but otherwise the implementation should be complete and compatible with VSFilter. The libass integration of the drawing parsing/processing code is still a bit sketchy and should be refactored. History: WIP: Drawing mode infrastructure WIP: Drawing tokenizer WIP: Parse drawing tokens, call evaluators WIP: Bezier/b-spline evaluator WIP: Final pieces for the drawing mode WIP: Heavy modifications to the drawing parser/tokenizer WIP: Dynamic outline memory allocation WIP: Drawing position fixes WIP: more drawing position fixup (similar to VSFilter now) WIP: Lots of cleanup and fixes for drawings. WIP: Drawing mode integration into ass_render_event
* Remove read_file_recode from APIGrigori Goronzy2009-07-012-3/+1
| | | | | | 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.
* Scale letter spacing with