summaryrefslogtreecommitdiff
path: root/src/cff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-05-15 15:44:36 +0200
committerWerner Lemberg <wl@gnu.org>2023-05-15 16:04:15 +0200
commit416d4c25f1e15d2494d373982a511928f635e705 (patch)
tree91e3f8005766c6691d6edc5bc29d099cd5104b62 /src/cff
parent872a759b468ef0d88b0636d6beb074fe6b87f9cd (diff)
downloadfreetype2-416d4c25f1e15d2494d373982a511928f635e705.tar.gz
Add new load flag `FT_LOAD_NO_SVG`.
Modern color fonts often contain both an 'SVG' and 'COLR' table. FreeType always preferred 'SVG' over 'COLR' (this was a design decision), however, this might not be the right choice for the user. The new flags makes FreeType ignore the 'SVG' table while loading a glyph. Fixes #1229. * include/freetype/freetype.h (FT_LOAD_NO_SVG): New macro. * src/base/ftobjs.c (FT_Load_Glyph), src/cff/cffgload.c (cff_slot_load), src/truetype/ttgload.c (TT_Load_Glyph): Use it.
Diffstat (limited to 'src/cff')
-rw-r--r--src/cff/cffgload.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index cfa0aaf2b..c483d1d1a 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -356,14 +356,16 @@
#ifdef FT_CONFIG_OPTION_SVG
/* check for OT-SVG */
- if ( ( load_flags & FT_LOAD_COLOR ) && face->svg )
+ if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 &&
+ ( load_flags & FT_LOAD_COLOR ) &&
+ face->svg )
{
/*
* We load the SVG document and try to grab the advances from the
* table. For the bearings we rely on the presetting hook to do that.
*/
- SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
if ( size && (size->root.metrics.x_ppem < 1 ||