[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] ewaldhew-wip a6fc2f6 21/36: add t1 mode checks (skip blend,
From: |
Hew Yih Shiuan Ewald |
Subject: |
[freetype2] ewaldhew-wip a6fc2f6 21/36: add t1 mode checks (skip blend, etc) |
Date: |
Tue, 4 Jul 2017 06:47:11 -0400 (EDT) |
branch: ewaldhew-wip
commit a6fc2f6c79f56bc582ce8f460f3a9812835f7593
Author: Ewald Hew <address@hidden>
Commit: Ewald Hew <address@hidden>
add t1 mode checks (skip blend, etc)
---
src/psaux/psfont.c | 70 ++++++++++++++++++++++++++++--------------------------
src/psaux/psft.c | 9 +++++--
2 files changed, 43 insertions(+), 36 deletions(-)
diff --git a/src/psaux/psfont.c b/src/psaux/psfont.c
index 13cff73..2fe3bfd 100644
--- a/src/psaux/psfont.c
+++ b/src/psaux/psfont.c
@@ -260,8 +260,6 @@
CF2_UInt lenNormalizedV = 0;
FT_Fixed* normalizedV = NULL;
- FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)font->cffload;
-
/* clear previous error */
font->error = FT_Err_Ok;
@@ -274,46 +272,50 @@
needExtraSetup = TRUE;
}
- /* check for variation vectors */
- vstore = cf2_getVStore( decoder );
- hasVariations = ( vstore->dataCount != 0 );
-
- if ( hasVariations )
+ if ( !font->isT1 )
{
-#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /* check whether Private DICT in this subfont needs to be reparsed */
- font->error = cf2_getNormalizedVector( decoder,
- &lenNormalizedV,
- &normalizedV );
- if ( font->error )
- return;
+ FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)font->cffload;
+ /* check for variation vectors */
+ vstore = cf2_getVStore( decoder );
+ hasVariations = ( vstore->dataCount != 0 );
- if ( cffload->blend_check_vector( &subFont->blend,
- subFont->private_dict.vsindex,
- lenNormalizedV,
- normalizedV ) )
+ if ( hasVariations )
{
- /* blend has changed, reparse */
- cffload->load_private_dict( decoder->cff,
- subFont,
- lenNormalizedV,
- normalizedV );
- needExtraSetup = TRUE;
- }
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* check whether Private DICT in this subfont needs to be reparsed */
+ font->error = cf2_getNormalizedVector( decoder,
+ &lenNormalizedV,
+ &normalizedV );
+ if ( font->error )
+ return;
+
+ if ( cffload->blend_check_vector( &subFont->blend,
+ subFont->private_dict.vsindex,
+ lenNormalizedV,
+ normalizedV ) )
+ {
+ /* blend has changed, reparse */
+ cffload->load_private_dict( decoder->cff,
+ subFont,
+ lenNormalizedV,
+ normalizedV );
+ needExtraSetup = TRUE;
+ }
#endif
- /* copy from subfont */
- font->blend.font = subFont->blend.font;
+ /* copy from subfont */
+ font->blend.font = subFont->blend.font;
- /* clear state of charstring blend */
- font->blend.usedBV = FALSE;
+ /* clear state of charstring blend */
+ font->blend.usedBV = FALSE;
- /* initialize value for charstring */
- font->vsindex = subFont->private_dict.vsindex;
+ /* initialize value for charstring */
+ font->vsindex = subFont->private_dict.vsindex;
- /* store vector inputs for blends in charstring */
- font->lenNDV = lenNormalizedV;
- font->NDV = normalizedV;
+ /* store vector inputs for blends in charstring */
+ font->lenNDV = lenNormalizedV;
+ font->NDV = normalizedV;
+ }
}
/* if ppem has changed, we need to recompute some cached data */
diff --git a/src/psaux/psft.c b/src/psaux/psft.c
index c75c64d..abcddbd 100644
--- a/src/psaux/psft.c
+++ b/src/psaux/psft.c
@@ -309,8 +309,11 @@
FT_Error error = FT_Err_Ok;
CF2_Font font;
+ FT_Bool is_t1 = decoder->builder.is_t1;
- FT_ASSERT( decoder && decoder->cff );
+
+ FT_ASSERT( decoder &&
+ ( is_t1 || decoder->cff ) );
memory = decoder->builder.memory;
@@ -330,7 +333,9 @@
font = (CF2_Font)decoder->cff->cf2_instance.data;
font->memory = memory;
- font->cffload = (FT_Service_CFFLoad)decoder->cff->cffload;
+
+ if ( !is_t1 )
+ font->cffload = (FT_Service_CFFLoad)decoder->cff->cffload;
/* initialize a client outline, to be shared by each glyph rendered */
cf2_outline_init( &font->outline, font->memory, &font->error );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] ewaldhew-wip a6fc2f6 21/36: add t1 mode checks (skip blend, etc),
Hew Yih Shiuan Ewald <=