summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.h
Commit message (Collapse)AuthorAgeFilesLines
* Runtime shaper selectionGrigori Goronzy2011-08-081-0/+1
| | | | | | | 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.
* Use the "font encoding" property as a base direction hintGrigori Goronzy2011-07-151-0/+1
| | | | | | | | | | ASS specifies a "font encoding", both in the styles as well as with the \fe override tag. This font encoding is very Windows-specific and libass doesn't use it for charmap matching or anything like that. However, it can be useful for hinting the base direction of text. Make Hebrew and Arabic encodings switch to RTL base direction, other languages to LTR and use neutral base direction for the autodetect setting.
* Introduce ASS_Shaper objectGrigori Goronzy2011-07-131-0/+4
| | | | | | Encapsulate all data related to shaping into this new object and migrate all shaping-related code to it. The object is long-living; arrays are allocated only once and then grown as needed.
* Various small fixes to HarfBuzz renderingGrigori Goronzy2011-07-121-0/+1
| | | | | Handle advance of clusters correctly, fix drawings, calculate run direction correctly, fix y offset sign.
* Support glyph clusters of multiple glyphsGrigori Goronzy2011-07-111-1/+4
| | | | | | | | | Sometimes a glyph cluster resolves to multiple glyphs, for example when diacritics are used with Arabic script. This doesn't map well to the list of glyphs expected by libass. Extend the glyph list to a list of singly-linked glyph clusters of glyphs and adapt the renderer to support this.
* HarfBuzz shaping supportGrigori Goronzy2011-07-111-0/+4
| | | | | | | | Split up text into runs with the same direction, font face and font size, shape these runs with HarfBuzz and reorder accordingly. This noticeably improves Arabic shaping and should make shaping for many other scripts work. HarfBuzz also does kerning for Latin text.
* Provisional bidi and shaping supportGrigori Goronzy2011-07-061-0/+1
| | | | | | | | | | | | | | Adds fully working bidirectional text and simple shaping support. The following works: - bidirectional text according to the Unicode Bidirectional Algorithm - simple shaper for mirrored forms (brackets, etc.) according to rule L4 of the Unicode Bidirectional Algorithm - reordering into visual order with correct line wrapping However, the implementation certainly needs efficiency improvements (caching, less malloc'ing), a proper shaper (HarfBuzz) needs to be hooked up and various bugs with karaoke and positioning need to be fixed.
* Separate event parsing and layoutGrigori Goronzy2011-07-041-0/+7
| | | | | | Split up the combined event parsing and layout loop into two passes. State information needed for layout are duplicated in GlyphInfo structures.
* Remove unused struct memberGrigori Goronzy2011-07-041-1/+0
|
* Introduce bitmap runsGrigori Goronzy2011-07-041-0/+5
| | | | | | | | Prepare for run-based rendering. In the parser, increment a run id according to relevant style changes (color, border, shadow, etc.) to mark the points where a new bitmap needs to be started. Modify the line wrapper to increment the run ids of each glyph after a break. Add functions to calculate the render size of runs for rasterization.
* cache: use outline-bitmap hierarchy to slim down bitmap hash keyGrigori Goronzy2011-06-271-0/+1
| | | | | | | | The bitmap hash key duplicated a lot of information the glyph hash key already saves. The subclassing introduced recently complicates this even more. Modify the hash key to utilize a pointer to the glyph hash value instead, which is faster and more flexible. Make sure to always empty the bitmap cache when the glyph cache is emptied.
* cache: unified outline cache for glyphs/drawingsGrigori Goronzy2011-06-271-1/+1
| | | | | | | | | Glyphs and drawings have wildly different hash keys. Subclass the hash keys of glyphs and drawings in a new, unified outline cache. This also fixes some issues with drawings in the glyph cache. Now, the textual description of the drawing is included in the key (the hash value isn't really good enough, especially not fnv32) and the baseline offset is saved as well.
* Convert outline processing and caching from glyphs to bare outlinesGrigori Goronzy2011-06-201-2/+2
| | | | | | | | | This introduces functions to use and copy pointered outline objects easily and uses these instead of glyphs everywhere. Previously the glyph cache was abused for caching vector clipping masks, but this isn't possible anymore (nor desirable), thus vector clipping cache has been disabled for the moment.
* Much improved cache/hashmap implementationGrigori Goronzy2011-06-071-4/+4
| | | | | | | | - less code, cleaner - decoupled from ASS_Library - better data encapsulation - simpler interface - avoids a nasty hack
* refactor: move track init into ass track parserGrigori Goronzy2011-06-061-0/+3
|
* Match first occurence of \fade, \fad, \an and \a tagsGrigori Goronzy2011-05-301-0/+4
| | | | | Track if we already parsed a fade or a alignment tag and ignore all further tags.
* Relicense to ISCGrigori Goronzy2010-09-281-12/+10
| | | | | | 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.
* refactor: move ASS_Renderer getters/setters/etc into separate fileGrigori Goronzy2010-08-011-0/+4
|
* Refactor: move event parsing code into separate fileGrigori Goronzy2009-09-011-0/+2
| | | | | Move all code related to parsing event lines and processing override tags into a separate file (ass_parse.c).
* Trim whitespace after line wrappingGrigori Goronzy2009-08-221-0/+1
| | | | | Mark leading and trailing spaces on lines and adjust layouting code to respect these marks and skip the spaces.
* Use event bbox for collision detectionGrigori Goronzy2009-08-131-2/+3
| | | | | | Consider the bounding box of an event for collision detection instead of only its vertical position and height. This allows multiple events per line if they don't overlap.
* Support \q override tagGrigori Goronzy2009-08-121-1/+1
| | | | | | Parse \q override tag and set a new state variable to its value. The line wrapping code still needs improvements; wrap style 0/3 are not entirely correctly implemented and style 1 is not implemented.
* Factor out renderer types into separate fileGrigori Goronzy2009-08-071-0/+258