summaryrefslogtreecommitdiffstats
path: root/libass/ass_drawing.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up includesGrigori Goronzy2011-06-211-1/+0
|
* Use bare outlines for drawingsGrigori Goronzy2011-06-201-45/+17
| | | | | | | 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.
* Fix fontconfig disabled at runtimeGrigori Goronzy2011-02-161-4/+6
| | | | | | 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.
* Fix drawing leakage: delay glyph allocationGrigori Goronzy2010-08-091-8/+8
| | | | | | 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.
* Remove debugging leftoversGrigori Goronzy2010-07-291-21/+0
|
* Fix drawing cbox calculationGrigori Goronzy2010-07-291-2/+18
| | | | | | 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.
* ASS_Drawing: do not free glyphGrigori Goronzy2010-07-141-2/+0
| | | | | The glyph is inserted into the cache and freed upon cache reset, so it shouldn't be freed alongside the drawing.
* Fix libass w/o fontconfigGrigori Goronzy2009-10-111-13/+22
| | | | | | | | | 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.
* Do not close empty drawingsGrigori Goronzy2009-08-291-2/+4
| | | | | | | | If there are no points (i.e. illegal drawing), do not close the drawing by incrementing the contour counter. Under certain circumstances, this can crash the FreeType stroker. This fixes issue 7.
* Rename typedefs (breaks API)Grigori Goronzy2009-08-061-27/+27
| | | | | | 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.
* Fix drawing parser memory leakGrigori Goronzy2009-07-191-2/+1
| | | | | Always free the drawing glyph in ass_drawing_free; do not double free clip vector bitmap.
* Implement vector clipsGrigori Goronzy2009-07-161-8/+11
| | | | | | | | | 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.
* Message callback funtionalityGrigori Goronzy2009-07-111-2/+4
| | | | | | | | | | | 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-111-0/+3
| | | | | | 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.
* Support for underline and strikethroughGrigori Goronzy2009-07-071-1/+1
| | | | | | | | | | | | | | | | | 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.
* Implement drawing mode (\p)Grigori Goronzy2009-07-061-0/+477
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