From 67da02444ee4ad0950bfe3b5ad531822e6818ff5 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 29 Mar 2023 09:44:45 +0800 Subject: [PATCH] Update Android port * src/sfntfont.c (sfntfont_open): Avoid specifying redundant blends. --- src/sfntfont.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/sfntfont.c b/src/sfntfont.c index 3476da6734e..40272247116 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c @@ -3068,6 +3068,22 @@ sfntfont_open (struct frame *f, Lisp_Object font_entity, sfnt_normalize_blend (&font_info->blend); + /* Test whether or not the instance is actually redundant, + as all of its axis are at their default values. If so, + free the instance. */ + + for (i = 0; i < desc->tables->fvar->axis_count; ++i) + { + if (font_info->blend.norm_coords[i]) + break; + } + + if (i == desc->tables->fvar->axis_count) + { + sfnt_free_blend (&font_info->blend); + goto cancel_blend; + } + /* If an interpreter was specified, distort it now. */ if (font_info->interpreter) @@ -3089,6 +3105,7 @@ sfntfont_open (struct frame *f, Lisp_Object font_entity, } } + cancel_blend: /* Calculate the xfld name. */ font->props[FONT_NAME_INDEX] = Ffont_xlfd_name (font_object, Qnil); -- 2.39.2