From da3986aa6cbf47cc9d5d4450edc24e5d98b8ce02 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 27 Oct 2011 08:13:08 +0200 Subject: [PATCH] Fix last CVT patch. The `cvt' table was too small by one entry. --- src/tabytecode.h | 4 ++-- src/tacvt.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tabytecode.h b/src/tabytecode.h index de5da9a..8a50cab 100644 --- a/src/tabytecode.h +++ b/src/tabytecode.h @@ -383,10 +383,10 @@ #define cvtl_temp 0 /* used for creating twilight points */ #define cvtl_scale cvtl_temp + 1 /* assigned in the `prep' table */ - +#define cvtl_max_runtime cvtl_scale + 1 /* must be last */ /* the horizontal and vertical standard widths */ -#define CVT_HORZ_STANDARD_WIDTH_OFFSET(font) cvtl_scale + 1 +#define CVT_HORZ_STANDARD_WIDTH_OFFSET(font) cvtl_max_runtime #define CVT_VERT_STANDARD_WIDTH_OFFSET(font) \ CVT_HORZ_STANDARD_WIDTH_OFFSET(font) + 1 diff --git a/src/tacvt.c b/src/tacvt.c index 38e08ae..f54c842 100644 --- a/src/tacvt.c +++ b/src/tacvt.c @@ -82,7 +82,8 @@ TA_table_build_cvt(FT_Byte** cvt, haxis = &((TA_LatinMetrics)font->loader->hints.metrics)->axis[0]; vaxis = &((TA_LatinMetrics)font->loader->hints.metrics)->axis[1]; - buf_len = 2 * (3 + buf_len = 2 * (cvtl_max_runtime /* runtime values */ + + 2 /* vertical and horizontal standard width */ + haxis->width_count + vaxis->width_count + 2 * vaxis->blue_count); @@ -102,7 +103,7 @@ TA_table_build_cvt(FT_Byte** cvt, /* some CVT values are initialized (and modified) at runtime; */ /* see the `cvtl_xxx' macros in tabytecode.h */ - for (i = 0; i < CVT_HORZ_STANDARD_WIDTH_OFFSET(font); i++) + for (i = 0; i < cvtl_max_runtime; i++) { *(buf_p++) = 0; *(buf_p++) = 0; -- 2.11.4.GIT