summaryrefslogtreecommitdiffstats
path: root/libass/ass_shaper.h
Commit message (Collapse)AuthorAgeFilesLines
* Disable bidi bracket matching unless enabled via ASS_FeatureOleg Oshmyan2020-07-141-0/+7
| | | | | | | | | | | | | | | | | | | | | Bracket matching is incompatible with VSFilter (even on modern Windows), so disable it by default. But as it's generally a good thing (and 100% more compliant with current Unicode), keep it available as an ASS_Feature. It can be toggled individually or enabled as part of the catch-all ASS_FEATURE_INCOMPATIBLE_EXTENSIONS feature. If libass is compiled against FriBidi older than 1.0, bracket matching is impossible. Signal this at runtime by failing to recognize the ASS_FEATURE_BIDI_BRACKETS feature. This way, clients who want to use bracket matching can set the feature without any compile-time checks for FriBidi and can be freely linked against libass that is itself compiled against any version of FriBidi; and yet they can detect at runtime whether the feature is actually enabled. Fixes https://github.com/libass/libass/issues/374.
* Take bool in ass_shaper_set_kerningOleg Oshmyan2020-07-141-1/+2
|
* shaper: drop prealloc parameter of ass_shaper_newOleg Oshmyan2020-07-121-1/+1
| | | | | | The only prealloc value actually used is 0, which is not useful and invokes implementation-defined (and potentially obsolescent as per C11 DR400) behavior.
* ass_set_fonts: empty cache as wellRodger Combs2017-10-221-0/+1
|
* Include config.h in all source files and in no headersOleg Oshmyan2015-09-171-2/+0
| | | | | | | | | 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-171-0/+2
|
* shaper: add FriBidi error handlingGrigori Goronzy2014-05-291-1/+1
| | | | | | It is unlikely, but FriBidi might not process a string correctly, and we should handle that. Tested by making it fail always. This should also fix some compiler warnings.
* Fix fribidi include pathwm42013-07-171-1/+1
| | | | | The old include statement works only by coincidence, and will actually break the build on certain setups.
* 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.
* Support language hint in the Script Info sectionGrigori Goronzy2011-08-011-0/+1
| | | | | | 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.
* Cache HarfBuzz fontsGrigori Goronzy2011-07-151-0/+2
| | | | | | 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.
* Use the "font encoding" property as a base direction hintGrigori Goronzy2011-07-151-0/+2
| | | | | | | | | | 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.
* Add kerning toggle for HarfBuzz shapingGrigori Goronzy2011-07-131-0/+1
| | | | | Make the "Kerning" track property toggle the OpenType feature "kern". The old TrueType kerning code won't come back.
* Introduce ASS_Shaper objectGrigori Goronzy2011-07-131-7/+13
| | | | | | 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.
* Support glyph clusters of multiple glyphsGrigori Goronzy2011-07-111-0/+1
| | | | | | | | | 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.
* shaper: print version info stringGrigori Goronzy2011-07-061-0/+1
|
* Provisional bidi and shaping supportGrigori Goronzy2011-07-061-0/+28
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.