]> granicus.if.org Git - libass/commitdiff
Calculate vertical layout ascender/descender
authorGrigori Goronzy <greg@blackbox>
Thu, 18 Feb 2010 06:14:23 +0000 (07:14 +0100)
committerGrigori Goronzy <greg@blackbox>
Sat, 10 Apr 2010 23:59:28 +0000 (01:59 +0200)
Calculate ascender for rotated glyphs from the maximum advance width.
Works OK usually, but screws up with fonts that miss this information.

libass/ass_font.c

index 109390f7133aeec649b61a0aa648231fcc52f3a4..6f1f4b7cd9b4d91b609d368bda0e1c5e3912f713 100644 (file)
@@ -286,6 +286,9 @@ void ass_font_get_asc_desc(ASS_Font *font, uint32_t ch, int *asc,
                 *asc = FT_MulFix(face->ascender, y_scale);
                 *desc = FT_MulFix(-face->descender, y_scale);
             }
+            if (font->desc.vertical) {
+                *asc = FT_MulFix(face->max_advance_width, y_scale);
+            }
             return;
         }
     }