| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes issue #68.
|
|
|
|
| |
These were missing in several places. Fixes #50.
|
|
|
|
|
|
|
| |
start/end of feature tags is unsigned, so use the proper constant
to signal to HarfBuzz that these features are global. This allows
HarfBuzz to cache shape plans, and that can considerably speed up
shaping, especially if many small runs need to be shaped.
|
|
|
|
|
|
| |
Rewrite the core of the harfbuzz shaping function. Gets rid of the
MAX_RUNS limit of runs per line and reuses a single hb_buffer_t,
which should be more efficient.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The code was confusing glyph index and Unicode codepoint.
256df617 attempted a fix but merely moved the wrong code.
Fixes Google Code issue #94.
Vertical ligatures are possibly still broken, but
horizontal ligatures and non-ligatures are correct now.
|
| |
|
|
|
|
|
| |
Since font_size is usually normalized to 256, scale_x/y has to be used
for this purpose.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 05eb520 missed some duplicated bits in ass_shaper.c.
<wm4> oh crap
<zgreg> oh crap indeed
Instead of duplicating the logic in ass_shaper.c, just change the
glyphs before they even get into processing. This way, all code
reading the font size etc. is affected. This essentially reverts
commit c207000c, because it's not needed anymore.
|
|
|
|
|
| |
The old include statement works only by coincidence, and will actually
break the build on certain setups.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Determine script for each character and use this as an additional
property for splitting up the text into runs. Characters of Common
or Inherited script assume the script of the preceding character. If
that is not possible (First character(s) in a run are Common/Inherited,
for instance), a backwards scan is done so they can assume the script
of the following character.
Additionally, determine default language in case no override is
set. This simply maps a language to a script, if a language exists
that is mostly representative for a given script. Pango's mapping
has been adapted.
This helps with fonts that don't have OpenType features set up
for default script/language pairs. It's also considered to be right
approach by most people, and might help with correct OpenType rendering
in some other cases.
Fixes issue 85.
|
|
|
|
|
|
| |
The code was confusing glyph index and unicode codepoint index.
Fixes issue 94.
|
|
|
|
|
| |
This complements commit 7af780, which didn't correctly apply the hack
to the advance/position as calculated by the shaper.
|
|
|
|
|
|
|
|
| |
This reverts commit 840ce4c2d9381e340c3239d104933fea85fff3e5.
Harfbuzz added UCDN support much quicker than I thought and the latest
release 0.9.5 contains UCDN already, so we don't need it in libass
anymore.
|
|
|
|
|
|
| |
The list was somewhat incomplete. Add what's important and left, and
disable removal if HarfBuzz is used. HarfBuzz removes these characters
now by itself. Refactor a little into a separate function.
|
|
|
|
|
|
| |
Add explicit support for UCDN, without relying on any HarfBuzz
integration. This finally allows easy usage of HarfBuzz without glib,
ICU, or some other big bloated library!
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately, VSFilter always assumes LTR base direction. All existing
Arabic subtitles have been designed with that in mind. This causes
various issues, for instance punctuation placed at the wrong side of
a line.
We have no other choice than to use the same braindead always-LTR
assumption (except if overridden by the font encoding property).
|
|
|
|
|
|
|
|
| |
Correct off-by-one error and add 0x200c-0x200f range. This range
is compromised of explicit direction and join marks.
Fixes issue 54
Fixes issue 55
|
| |
|
| |
|
|
|
|
|
| |
Make sure to use vertical advance under the right conditions -
vertical font selected, requested glyph is non-latin.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that it's possible to switch shapers at runtime, it also becomes a
lot easier to disable them at compile time. Add ifdefs and build system
changes so that HarfBuzz can be safely disabled. It's autodetected now
and enabled if available.
This shuffles a bit of code around, but there are no functional changes.
Note that FriBidi remains mandatory for the time being, but this
shouldn't pose any problems, since it is a small and very portable
library without any special dependencies.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Shaping works well now, they aren't needed anymore.
|
|
|
|
|
|
| |
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' 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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This leads to fewer shaping runs, but has many unwanted side effects.
|
| |
|
| |
|
|
|
|
|
| |
Make sure to set the font size for every run, as needed, to get metrics
(advance/offset) for the right size.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Make the "Kerning" track property toggle the OpenType feature "kern".
The old TrueType kerning code won't come back.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Handle advance of clusters correctly, fix drawings, calculate run
direction correctly, fix y offset sign.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Use FriBidi's shaper not only for mirroring, but also for simplified
Arabic shaping.
|
| |
|
| |
|
|
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.
|