summaryrefslogtreecommitdiffstats
path: root/libass
</
Commit message (Collapse)AuthorAgeFilesLines
* Support language hint in the Script Info sectionGrigori Goronzy2011-08-015-0/+25
| | | | | | Parse a hint in the form "Language: xx" with xx being an ISO 639-1 language code, and pass it to HarfBuzz. This can be useful to render scripts with language-specific character variants.
* harfbuzz: cache glyph metricsGrigori Goronzy2011-07-294-4/+242
| | | | | | HarfBuzz' FreeType font functions do not cache anything and call FT_Load_Glyph all the time, which can be slow. Add a cache for metrics and use it with custom font functions.
* Fix crash in ass_set_style_overridesGrigori Goronzy2011-07-281-0/+1
| | | | | Set pointer to the style overrides to NULL to make sure a freed buffer will not be accessed anymore later. Reported by uau.
* Axe misleading comment, reordering works fineGrigori Goronzy2011-07-251-2/+0
|
* Disable reordering of non-spacing marksGrigori Goronzy2011-07-251-1/+1
| | | | | | | | FriBidi's line reordering algorithm reorders non-spacing marks (diacritics, etc.) to come after the base character by default. This doesn't work particularly well with our layout model and leads to wrongly positioned marks in some cases with HarfBuzz and all cases with FriBidi shaping.
* Don't extend face runs as much as possibleGrigori Goronzy2011-07-221-5/+0
| | | | This leads to fewer shaping runs, but has many unwanted side effects.
* Update HarfBuzz' font metricsGrigori Goronzy2011-07-221-0/+16
|
* Hack: return a valid face index even if no glyph is foundGrigori Goronzy2011-07-171-0/+2
| | | | | Temporary fix for a crash when a font face doesn't actually contain the glyph that fontconfig reports. Needs a real solution.
* Fix crash with FreeType's updated strokerGrigori Goronzy2011-07-171-7/+26
| | | | | | The new revision of the stroker in FreeType doesn't like the way contours are zero-filled to disable them. It's not particularly clean anyway, so rewrite the whole outline instead.
* Fix line counting and breakingGrigori Goronzy2011-07-171-5/+6
| | | | | | | | | Make sure to increment the line counter only if the offset of the new line is actually legal and inside the bounds of the text size. Fixes random crashes in case the last symbol of the line is a break. git-blame says it's Evgeniys fault, it wasn't caused by the recent layout changes.
* Set requested font face correctlyGrigori Goronzy2011-07-161-1/+1
|
* Remove unused variableGrigori Goronzy2011-07-161-2/+0
|
* shaper: fix run-specific font sizeGrigori Goronzy2011-07-164-10/+10
| | | | | Make sure to set the font size for every run, as needed, to get metrics (advance/offset) for the right size.
* Cache HarfBuzz fontsGrigori Goronzy2011-07-154-3/+45
| | | | | | Add a new opaque data structure to store shaper-specific font data in an ASS_Font. At the moment, this is used for caching HarfBuzz fonts, to reduce allocation and font initialization overhead.
* Revert @font ascender/descender hackGrigori Goronzy2011-07-151-3/+0
| | | | | | | | | This was introduced with commit e051ab. After re-evaluation, it seems to be rather wrong. Windows appears to use the same ascender as horizontal rendering, except for the first line. We don't have this special handling of the first line, but apart from that, everything is similar to Windows now. Verified with a couple of popular CJK fonts, such as MS Mincho, Meiryo, etc.
* Use the "font encoding" property as a base direction hintGrigori Goronzy2011-07-155-3/+45
| | | | | | | | | | 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.
* Restore italic to non-italic transition layout fixGrigori Goronzy2011-07-131-16/+14
|
* Disable currently unused bitmap run codeGrigori Goronzy2011-07-131-0/+2
|
* Add kerning toggle for HarfBuzz shapingGrigori Goronzy2011-07-133-1/+13
| | | | | Make the "Kerning" track property toggle the OpenType feature "kern". The old TrueType kerning code won't come back.
* Enable vert/vkna features for @font vertical textGrigori Goronzy2011-07-131-1/+44
| | | | | | Set up a feature list and toggles these features as needed. The "vert" feature enables vertical glyph variants in general, while "vkna" additionally enables vertical variants for Kana.
* Fix layout with fsp/fay features enabledGrigori Goronzy2011-07-131-3/+6
|
* Introduce ASS_Shaper objectGrigori Goronzy2011-07-134-116/+199
| | | | | | 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-123-24/+31
| | | | | Handle advance of clusters correctly, fix drawings, calculate run direction correctly, fix y offset sign.
* Support glyph clusters of multiple glyphsGrigori Goronzy2011-07-114-107/+203
| | | | | | | | | 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-115-34/+145
| | | | | | | | 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.
* Separate glyph font face matching and glyph loadingGrigori Goronzy2011-07-113-23/+50
| | | | | | | | | | | Split up ass_font_get_glyph into two functions: one function matches checks the fonts for support of the requested codepoint and returns a face_index and glyph_index to later load the glyph, with a second function. This approach is very useful for shaping, which needs to be done on runs with the same font face and font size and changes the glyph_index.
* Hook up FriBidi's simple Arabic shaperGrigori Goronzy2011-07-101-9/+12
| | | | | Use FriBidi's shaper not only for mirroring, but also for simplified Arabic shaping.
* Fix bitmap cacheGrigori Goronzy2011-07-101-2/+3
| | | | | | Pass the *complete* hash key to the cache handling functions, not only the outline-specific subkey. This mistake completely stopped the cache from actually working and resulted in great slowdown!
* Reorder positions for "Banner" effect textGrigori Goronzy2011-07-101-32/+36
| | | | | | Events that use the "Banner" effect have different wrapping/breaking handling (none at all, to be exact) and need special treatment to make reordering work.
* Redesign horizontal alignment calculations for bidiGrigori Goronzy2011-07-091-18/+7
| | | | | | | The line alignment code determined the first and last glyph in a line and calculated the distance from that. This is rather arcane and doesn't easily work with bidi. Redesign the algorithm to simply add together all individual character widths instead.
* Fix coordinates after repositioningGrigori Goronzy2011-07-081-2/+11
|
* shaper: always use neutral base directionGrigori Goronzy2011-07-081-1/+2
|
* shaper: print version info stringGrigori Goronzy2011-07-063-0/+12
|
* Provisional bidi and shaping supportGrigori Goronzy2011-07-065-15/+210
| | | | | | | | | | | | | | 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.
* Fix cache leakGrigori Goronzy2011-07-061-1/+1
| | | | | Fixes a leak introduced with the new cache functions, caused by wrong pointer usage.
* Separate event parsing and layoutGrigori Goronzy2011-07-044-133/+148
| | | | | | 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-043-0/+80
| | | | | | | | 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.
* Fix box blur for non-bordered outlinesGrigori Goronzy2011-07-041-1/+1
| | | | | | This horrible bug was introduced by commit c13cb2. Pointed out by uau.
* Fix: VSFilter compat: don't render shadow when glyph/border invisibleGrigori Goronzy2011-07-041-1/+1
| | | | | | Use the alpha channel, not the red channel. Fixes commit f92830. Original patch by lachs0r.
* Cache ascender/descenderGrigori Goronzy2011-07-011-19/+10
| | | | | | Cache ascender/descender so they don't have to be queried every frame for every glyph. This also makes it possible to more uniformly handle drawings and glyphs.
* Remove unused hash key itemGrigori Goronzy2011-06-281-1/+0
|
* Fix stride support in vector clipsGrigori Goronzy2011-06-271-1/+1
|
* cache: unified bitmap cacheGrigori Goronzy2011-06-274-36/+68
| | | | | | Similarly to the glyph cache, subclass the bitmap cache to allow both outline bitmaps and clipping mask bitmaps to coexist in the same cache in a much cleaner way.
* cache: use outline-bitmap hierarchy to slim down bitmap hash keyGrigori Goronzy2011-06-273-38/+19
| | | | | | | | 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: safer ass_cache_statsGrigori Goronzy2011-06-271-4/+8
|
* cache: fix size tracking and emptyingGrigori Goronzy2011-06-272-26/+28
|
* cache: unified outline cache for glyphs/drawingsGrigori Goronzy2011-06-276-58/+112
| | | | | | | | | 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.
* Remove outdated commentGrigori Goronzy2011-06-261-2/+0
|
* bitmap: add strideGrigori Goronzy2011-06-263-44/+53
| | | | | Add stride support to the basic bitmap type used for low-level rasterization.
* Clean up includesGrigori Goronzy2011-06-213-8/+0
|
* Remove unused functionGrigori Goronzy2011-06-212-16/+0
|
* Use bare outlines for drawingsGrigori Goronzy2011-06-204-74/+32
| | | | | | | 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.
* Convert outline processing and caching from glyphs to bare outlinesGrigori Goronzy2011-06-206-79/+108
| | | | | | | | | 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.
* Convert to high-level rasterizer parts to outlinesGrigori Goronzy2011-06-153-25/+28
| | | | | This covers rasterization, filtering and blending for one render item.
* Stroker: process outlines directlyGrigori Goronzy2011-06-133-41/+54
|
* Render outlines, not glyphsGrigori Goronzy2011-06-131-34/+41
| | | | | | | | | | | | | | | | | | | libass can render both regular glyphs (extracted from a font) and drawings, which are inserted into an existing glyph so far. This is a rather crude hack. However, it is necessary, as the renderer only works with FT_Glyphs. The obvious solution is to work on the underlying outlines directly instead. This is the first step to make this possible: change the basic rasterizer to use the outline-specific rasterization functions. There are more advantages: - It's more efficient. The bitmap can be directly rendered into the bordered target bitmap. - This should make it easier to adapt the renderer to run-based rendering later on (the pixels are ORed into the target) The higher-level rendering code still needs to be adjusted.
* Fix whitespace trimmingGrigori Goronzy2011-06-111-8/+9
| | | | | | | Only try to remove any further whitespace in front of a line if the first character of the line (the break character) is whitespace. Addresses Issue 35.
* Add cache statisticsGrigori Goronzy2011-06-072-10/+8
|
* Much improved cache/hashmap implementationGrigori Goronzy2011-06-078-365/+224
| | | | | | | | - 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-063-33/+37
|
* refactor: move karaoke effect parsing into event parserGrigori Goronzy2011-06-063-70/+72
|
* Bump version0.9.12Grigori Goronzy2011-05-301-1/+1
|
* Nicer default styleGrigori Goronzy2011-05-301-1/+1
| | | | Use 50% alpha for the shadow. Looks nicer and is just like VSFilter.
* Match first occurence of \fade, \fad, \an and \a tagsGrigori Goronzy2011-05-303-9/+23
| | | | | Track if we already parsed a fade or a alignment tag and ignore all further tags.
* Improved "last resort" charmap matchingGrigori Goronzy2011-04-091-5/+6
| | | | | | | | After font reselection, loop through all charmaps if no glyph can't be found until we hopefully find one that works. If we get here at all, the font is seriously broken, so this is unlikely to harm anything. This improves the last resort charmap fallback introduced in 96057d.
* Remove misleading comment about style case sensitivityGrigori Goronzy2011-04-091-1/+0
| | | | VSFilter always matches style names case sensitive.
* Much improved "Default" styleGrigori Goronzy2011-04-091-2/+36
| | | | | | Make the "Default" style, useful as a fallback and required by few scripts for proper rendering, actually do something sensible. Font, sizes, et cetera are set up mostly like VSFilter.
* VSFilter compat: don't render shadow when glyph/border invisibleGrigori Goronzy2011-04-091-0/+5
| | | | | Yet another VSFilter idiosyncracy: when the glyph fill is invisible (alpha 0xFF) and there is no border, do not render any shadow.
* Fix fontconfig disabled at runtimeGrigori Goronzy2011-02-162-5/+8
| | | | | | 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.
* Simplify word wrapping and fix possible endless loopGrigori Goronzy2011-02-091-14/+5
| | | | | | | | | | | | | | | | | | wrap_lines_smart() got stuck if there was a long line without spaces followed by a hard linebreak. When the loop got to the '\n' character the hard linebreak was not handled because the line was already over wrap length and soft linebreak handling had precedence. Then at the end of the loop body the code noted that the hard linebreak hadn't yet been handled, and the same glyph needed to be reprocessed for that. However, the soft linebreak code hadn't actually done anything because there was no space to break at, and thus the loop repeated from the exact same state forever. Handle this by removing the check for an additional hard linebreak after a soft linebreak, which stepped back by one char. This is a very marginal case and shouldn't really matter in practice. Original patch and parts of this message by uau.
* Relicense to ISCGrigori Goronzy2010-09-2818-216/+180
| | | | | | 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.
* Add support for \fs+ and \fs- syntaxGrigori Goronzy2010-08-121-0/+16
| | | | | | | These forms can be used to add or subtract a value from the current font size instead of setting a new font size. Animations are supported, but not recommended, as they won't be fluid due to grid-fitting/hinting.
* Only word wrap on spacesGrigori Goronzy2010-08-121-7/+3
| | | | | | It looks like VSFilter only ever wraps on spaces, even if the line length is going to overflow. We should do that as well. Fixes a pretty confusing problem with scrolling vertical text.
* Bump autoconf version and LIBASS_VERSION0.9.11Grigori Goronzy2010-08-111-1/+1
|
* Set AM_CFLAGS instead of CFLAGS directlyGrigori Goronzy2010-08-091-0/+2
|
* Get rid of NULL checks for freeGrigori Goronzy2010-08-097-52/+33
| | | | | The useless "if (foo) free(foo)" idiom is all over the place, just get rid of it finally...
* Fix another minor leak (event_format overwriting)Grigori Goronzy2010-08-091-0/+1
|