From 0417527d5b5abc3ee9426f31bd95209ca97502a5 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 3 Oct 2022 19:23:26 -0400 Subject: [PATCH] [autofit] Reset the face charmap directly. There is no need to validate the original charmap in `FT_Set_Charmap`. It can be reset directly. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Use direct assignment. * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto. --- src/autofit/afcjk.c | 2 +- src/autofit/afglobal.c | 2 +- src/autofit/afindic.c | 3 +-- src/autofit/aflatin.c | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 950f65925..3130b2ac3 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -650,7 +650,7 @@ af_cjk_metrics_check_digits( metrics, face ); } - FT_Set_Charmap( face, oldmap ); + face->charmap = oldmap; return FT_Err_Ok; } diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index c395f64b6..8ae8592cb 100644 --- a/src/autofit/afglobal.c +++ b/src/autofit/afglobal.c @@ -317,7 +317,7 @@ #endif /* FT_DEBUG_LEVEL_TRACE */ - FT_Set_Charmap( face, old_charmap ); + face->charmap = old_charmap; return error; } diff --git a/src/autofit/afindic.c b/src/autofit/afindic.c index 5bf0b5f94..e8b5027e4 100644 --- a/src/autofit/afindic.c +++ b/src/autofit/afindic.c @@ -49,8 +49,7 @@ af_cjk_metrics_check_digits( metrics, face ); } - FT_Set_Charmap( face, oldmap ); - + face->charmap = oldmap; return FT_Err_Ok; } diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index 7ebac2522..9a8885d62 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -1157,7 +1157,7 @@ } Exit: - FT_Set_Charmap( face, oldmap ); + face->charmap = oldmap; return error; }