summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMoazin Khatti <moazinkhatri@gmail.com>2019-08-17 23:42:27 +0500
committerMoazin Khatti <moazinkhatri@gmail.com>2019-08-17 23:42:27 +0500
commit503977f55c22d3286fb4fb623b5f12c89812a62d (patch)
treee04e5ca7e6d17e5b179b4a16d5413018f1d3dd4a /include
parent9df8c7dd27df66c79327babf7c011cc145c95563 (diff)
downloadfreetype2-ot-svg-clean.tar.gz
Adds transformation support for OT-SVG glyphs.ot-svg-clean
* include/freetype/ftglyph.h: Adds `transform' and `delta' fields to `FT_SvgGlyphRed'. * include/freetype/otsvg.h: Adds `transform' and `delta' fields to `FT_SVG_Document'. * src/base/ftglyph.c: Creates method `ft_svg_glyph_transform' and modifies existing functions for the new fields. * src/sfnt/ttsvg.c: (tt_face_load_svg_doc) Set `transform' to unity and `delta' to zero by default. * src/svg/ftsvg.c: Adds `ft_svg_transform'.
Diffstat (limited to 'include')
-rw-r--r--include/freetype/ftglyph.h9
-rw-r--r--include/freetype/otsvg.h8
2 files changed, 16 insertions, 1 deletions
diff --git a/include/freetype/ftglyph.h b/include/freetype/ftglyph.h
index b29751e04..e34644409 100644
--- a/include/freetype/ftglyph.h
+++ b/include/freetype/ftglyph.h
@@ -268,6 +268,12 @@ FT_BEGIN_HEADER
* end_glyph_id ::
* The ending glyph ID for the glyph range that this document has.
*
+ * transform ::
+ * Transformation matrix to apply on the glyph while rendering.
+ *
+ * delta ::
+ * Translation to apply on the glyph while rendering.
+ *
* @note:
* `metrics` and `units_per_EM` might look like repetitions since both
* fields are stored in face objects. However, the Glyph Management API
@@ -289,7 +295,8 @@ FT_BEGIN_HEADER
FT_UShort units_per_EM;
FT_UShort start_glyph_id;
FT_UShort end_glyph_id;
- /* TODO: (OT-SVG) Maybe put a transformation matrix here */
+ FT_Matrix transform;
+ FT_Vector delta;
} FT_SvgGlyphRec;
diff --git a/include/freetype/otsvg.h b/include/freetype/otsvg.h
index b7b9af8cc..55969e57e 100644
--- a/include/freetype/otsvg.h
+++ b/include/freetype/otsvg.h
@@ -147,6 +147,12 @@ FT_BEGIN_HEADER
* end_glyph_id ::
* The ending glyph ID for the glyph range that this document has.
*
+ * transform ::
+ * Transformation matrix to apply on the glyph while rendering.
+ *
+ * delta ::
+ * Translation to apply on the glyph while rendering.
+ *
* @note:
* `metrics` and `units_per_EM` might look like repetitions since both
* fields are stored in face object, but they are not; When the slot is
@@ -165,6 +171,8 @@ FT_BEGIN_HEADER
FT_UShort units_per_EM;
FT_UShort start_glyph_id;
FT_UShort end_glyph_id;
+ FT_Matrix transform;
+ FT_Vector delta;
} FT_SVG_DocumentRec;
/**************************************************************************