diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2014-01-08 01:28:49 +0200 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2014-01-08 03:24:36 +0200 |
commit | 50c53a1330e61d14808630b9d054b9aaaa9b0031 (patch) | |
tree | 3af6214aa9430ea3bd8c793cf7532e445f82ad1b /libass/ass_shaper.c | |
parent | a37e3b3eb43f360693ee278bf2991f829b496b25 (diff) | |
download | libass-50c53a1330e61d14808630b9d054b9aaaa9b0031.tar.bz2 libass-50c53a1330e61d14808630b9d054b9aaaa9b0031.tar.xz |
shaper: disable ligatures for non-zero \fsp
Diffstat (limited to 'libass/ass_shaper.c')
-rw-r--r-- | libass/ass_shaper.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c index d5a970e..4d4104e 100644 --- a/libass/ass_shaper.c +++ b/libass/ass_shaper.c @@ -31,9 +31,11 @@ enum { VERT = 0, VKNA, - KERN + KERN, + LIGA, + CLIG }; -#define NUM_FEATURES 3 +#define NUM_FEATURES 5 #endif struct ass_shaper { @@ -145,6 +147,10 @@ static void init_features(ASS_Shaper *shaper) shaper->features[VKNA].end = INT_MAX; shaper->features[KERN].tag = HB_TAG('k', 'e', 'r', 'n'); shaper->features[KERN].end = INT_MAX; + shaper->features[LIGA].tag = HB_TAG('l', 'i', 'g', 'a'); + shaper->features[LIGA].end = INT_MAX; + shaper->features[CLIG].tag = HB_TAG('c', 'l', 'i', 'g'); + shaper->features[CLIG].end = INT_MAX; } /** @@ -152,11 +158,17 @@ static void init_features(ASS_Shaper *shaper) */ static void set_run_features(ASS_Shaper *shaper, GlyphInfo *info) { - // enable vertical substitutions for @font runs - if (info->font->desc.vertical) - shaper->features[VERT].value = shaper->features[VKNA].value = 1; - else - shaper->features[VERT].value = shaper->features[VKNA].value = 0; + // enable vertical substitutions for @font runs + if (info->font->desc.vertical) + shaper->features[VERT].value = shaper->features[VKNA].value = 1; + else + shaper->features[VERT].value = shaper->features[VKNA].value = 0; + + // disable ligatures if horizontal spacing is non-standard + if (info->hspacing) + shaper->features[LIGA].value = shaper->features[CLIG].value = 0; + else + shaper->features[LIGA].value = shaper->features[CLIG].value = 1; } /** @@ -719,6 +731,7 @@ void ass_shaper_find_runs(ASS_Shaper *shaper, ASS_Renderer *render_priv, last->font_size != info->font_size || last->scale_x != info->scale_x || last->scale_y != info->scale_y || + last->hspacing != info->hspacing || last->face_index != info->face_index || last->script != info->script)) shape_run++; |