summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wagner <bungeman@chromium.org>2023-01-05 21:07:26 -0500
committerWerner Lemberg <wl@gnu.org>2023-01-07 07:28:04 +0100
commit3481b154430faea9f6b4002519e60a8ad8ebe8d8 (patch)
treed52dec542116ae9eff856ef754a2b869e6de84ac
parentebe7e9128cdf81cb0a0d27fe293ecff96f6c98a8 (diff)
downloadfreetype2-3481b154430faea9f6b4002519e60a8ad8ebe8d8.tar.gz
[truetype] Reset cvt and storage in context load.
Currently the cvt and storage are saved and restored in `TT_RunIns`. However, this is too granular as the cvt and storage area should be set to the original cvt and storage area only when setting up the hinting context. This allows for the cvt and storage area to be modified while parsing multiple glyphs, as is the case with composite glyphs. * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and `origStorage`. * src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and storage area. (Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data do copy on write" to "if in glyph and not using glyph specific data do copy on write".
-rw-r--r--src/truetype/ttinterp.c15
-rw-r--r--src/truetype/ttinterp.h2
2 files changed, 2 insertions, 15 deletions
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 2ddeee36d..6888166f1 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -1527,9 +1527,8 @@
static void
Modify_CVT_Check( TT_ExecContext exc )
{
- /* TT_RunIns sets origCvt and restores cvt to origCvt when done. */
if ( exc->iniRange == tt_coderange_glyph &&
- exc->cvt == exc->origCvt )
+ exc->cvt != exc->glyfCvt )
{
exc->error = Update_Max( exc->memory,
&exc->glyfCvtSize,
@@ -3115,10 +3114,8 @@
}
else
{
- /* TT_RunIns sets origStorage and restores storage to origStorage */
- /* when done. */
if ( exc->iniRange == tt_coderange_glyph &&
- exc->storage == exc->origStorage )
+ exc->storage != exc->glyfStorage )
{
FT_ULong tmp = (FT_ULong)exc->glyfStoreSize;
@@ -7832,8 +7829,6 @@
exc->func_move_cvt = Move_CVT;
}
- exc->origCvt = exc->cvt;
- exc->origStorage = exc->storage;
exc->iniRange = exc->curRange;
Compute_Funcs( exc );
@@ -8594,9 +8589,6 @@
ins_counter,
ins_counter == 1 ? "" : "s" ));
- exc->cvt = exc->origCvt;
- exc->storage = exc->origStorage;
-
return FT_Err_Ok;
LErrorCodeOverflow_:
@@ -8606,9 +8598,6 @@
if ( exc->error && !exc->instruction_trap )
FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error ));
- exc->cvt = exc->origCvt;
- exc->storage = exc->origStorage;
-
return exc->error;
}
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index 48f618dc9..02199fc0c 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -193,7 +193,6 @@ FT_BEGIN_HEADER
FT_Long* cvt; /* ! */
FT_ULong glyfCvtSize;
FT_Long* glyfCvt; /* cvt working copy for glyph */
- FT_Long* origCvt;
FT_UInt glyphSize; /* ! glyph instructions buffer size */
FT_Byte* glyphIns; /* ! glyph instructions buffer */
@@ -224,7 +223,6 @@ FT_BEGIN_HEADER
FT_Long* storage; /* ! storage area */
FT_UShort glyfStoreSize;
FT_Long* glyfStorage; /* storage working copy for glyph */
- FT_Long* origStorage;
FT_F26Dot6 period; /* values used for the */
FT_F26Dot6 phase; /* `SuperRounding' */