summaryrefslogtreecommitdiff
path: root/source/fitz/font.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-08-01 18:15:23 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-08-17 13:38:48 +0200
commit626ea2ea771735492c9a4350ae02b26ea09d1423 (patch)
treec92241b181a51719cbb47402bad98bb1984bf963 /source/fitz/font.c
parente349ba5984fe837d3eec9649d718efe16169ca44 (diff)
downloadmupdf-626ea2ea771735492c9a4350ae02b26ea09d1423.tar.xz
Simplify stext structure and device.
* Use pool allocator and linked lists for all levels. * Remove separate fz_stext_sheet struct. * Remove unused 'script' style. * Remove 'span' level items. * Detect visual/logical RTL layouts. * Detect indented paragraphs.
Diffstat (limited to 'source/fitz/font.c')
-rw-r--r--source/fitz/font.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c
index eb7c8c35..dfe4ab24 100644
--- a/source/fitz/font.c
+++ b/source/fitz/font.c
@@ -193,6 +193,28 @@ fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float x
}
}
+float fz_font_ascender(fz_context *ctx, fz_font *font)
+{
+ if (font->t3procs)
+ return font->bbox.y1;
+ else
+ {
+ FT_Face face = font->ft_face;
+ return (float)face->ascender / face->units_per_EM;
+ }
+}
+
+float fz_font_descender(fz_context *ctx, fz_font *font)
+{
+ if (font->t3procs)
+ return font->bbox.y0;
+ else
+ {
+ FT_Face face = font->ft_face;
+ return (float)face->descender / face->units_per_EM;
+ }
+}
+
/*
* Freetype hooks
*/