aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/cid
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 14:14:24 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 14:14:24 +0000
commit4284aeba874b9168f2228c59639bec8346a56796 (patch)
treed51ffb4507e0cae24b0875d8bb6b2c037829a684 /freetype/src/cid
parentc438f190eedc71ee8dd14e14fec660e98d3dc0bf (diff)
parent0695dfb71ca6fe132d15a4d0890e8a868183adf9 (diff)
downloadvcxsrv-4284aeba874b9168f2228c59639bec8346a56796.tar.gz
vcxsrv-4284aeba874b9168f2228c59639bec8346a56796.tar.bz2
vcxsrv-4284aeba874b9168f2228c59639bec8346a56796.zip
svn merge ^/branches/released
Diffstat (limited to 'freetype/src/cid')
-rw-r--r--freetype/src/cid/cidgload.c57
-rw-r--r--freetype/src/cid/cidload.c2
-rw-r--r--freetype/src/cid/cidparse.c9
-rw-r--r--freetype/src/cid/cidriver.c1
-rw-r--r--freetype/src/cid/cidriver.h4
5 files changed, 40 insertions, 33 deletions
diff --git a/freetype/src/cid/cidgload.c b/freetype/src/cid/cidgload.c
index 39a2ba495..e71206506 100644
--- a/freetype/src/cid/cidgload.c
+++ b/freetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,7 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
#include FT_OUTLINE_H
+#include <freetype/internal/ftcalc.h>
#include "ciderrs.h"
@@ -51,20 +52,23 @@
FT_ULong glyph_length = 0;
PSAux_Service psaux = (PSAux_Service)face->psaux;
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ FT_Incremental_InterfaceRec *inc =
+ face->root.internal->incremental_interface;
+#endif
+
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* For incremental fonts get the character data using */
/* the callback function. */
- if ( face->root.internal->incremental_interface )
+ if ( inc )
{
FT_Data glyph_data;
- error = face->root.internal->incremental_interface->funcs->get_glyph_data(
- face->root.internal->incremental_interface->object,
- glyph_index,
- &glyph_data );
+ error = inc->funcs->get_glyph_data( inc->object,
+ glyph_index, &glyph_data );
if ( error )
goto Exit;
@@ -80,9 +84,7 @@
glyph_length );
}
- face->root.internal->incremental_interface->funcs->free_glyph_data(
- face->root.internal->incremental_interface->object,
- &glyph_data );
+ inc->funcs->free_glyph_data( inc->object, &glyph_data );
if ( error )
goto Exit;
@@ -163,22 +165,21 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* Incremental fonts can optionally override the metrics. */
- if ( !error &&
- face->root.internal->incremental_interface &&
- face->root.internal->incremental_interface->funcs->get_glyph_metrics )
+ if ( !error && inc && inc->funcs->get_glyph_metrics )
{
FT_Incremental_MetricsRec metrics;
- metrics.bearing_x = decoder->builder.left_bearing.x;
- metrics.bearing_y = decoder->builder.left_bearing.y;
- metrics.advance = decoder->builder.advance.x;
- error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
- face->root.internal->incremental_interface->object,
- glyph_index, FALSE, &metrics );
- decoder->builder.left_bearing.x = metrics.bearing_x;
- decoder->builder.left_bearing.y = metrics.bearing_y;
- decoder->builder.advance.x = metrics.advance;
+ metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );
+ metrics.bearing_y = FIXED_TO_INT( decoder->builder.left_bearing.y );
+ metrics.advance = FIXED_TO_INT( decoder->builder.advance.x );
+
+ error = inc->funcs->get_glyph_metrics( inc->object,
+ glyph_index, FALSE, &metrics );
+
+ decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );
+ decoder->builder.left_bearing.y = INT_TO_FIXED( metrics.bearing_y );
+ decoder->builder.advance.x = INT_TO_FIXED( metrics.advance );
decoder->builder.advance.y = 0;
}
@@ -251,7 +252,7 @@
/* ignore the error if one occurred - skip to next glyph */
}
- *max_advance = decoder.builder.advance.x;
+ *max_advance = FIXED_TO_INT( decoder.builder.advance.x );
psaux->t1_decoder_funcs->done( &decoder );
@@ -342,8 +343,10 @@
FT_Slot_Internal internal = cidglyph->internal;
- cidglyph->metrics.horiBearingX = decoder.builder.left_bearing.x;
- cidglyph->metrics.horiAdvance = decoder.builder.advance.x;
+ cidglyph->metrics.horiBearingX =
+ FIXED_TO_INT( decoder.builder.left_bearing.x );
+ cidglyph->metrics.horiAdvance =
+ FIXED_TO_INT( decoder.builder.advance.x );
internal->glyph_matrix = font_matrix;
internal->glyph_delta = font_offset;
@@ -357,8 +360,10 @@
/* copy the _unscaled_ advance width */
- metrics->horiAdvance = decoder.builder.advance.x;
- cidglyph->linearHoriAdvance = decoder.builder.advance.x;
+ metrics->horiAdvance =
+ FIXED_TO_INT( decoder.builder.advance.x );
+ cidglyph->linearHoriAdvance =
+ FIXED_TO_INT( decoder.builder.advance.x );
cidglyph->internal->glyph_transformed = 0;
/* make up vertical ones */
diff --git a/freetype/src/cid/cidload.c b/freetype/src/cid/cidload.c
index 14a49aa52..405125566 100644
--- a/freetype/src/cid/cidload.c
+++ b/freetype/src/cid/cidload.c
@@ -112,7 +112,7 @@
if ( parser->num_dict < 0 )
{
- FT_ERROR(( "cid_load_keyword: invalid use of `%s'!\n",
+ FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
keyword->ident ));
error = CID_Err_Syntax_Error;
goto Exit;
diff --git a/freetype/src/cid/cidparse.c b/freetype/src/cid/cidparse.c
index 6fd73b74c..139d74aad 100644
--- a/freetype/src/cid/cidparse.c
+++ b/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,7 +18,6 @@
#include <ft2build.h>
#include <freetype/internal/ftdebug.h>
-#include <freetype/internal/ftcalc.h>
#include <freetype/internal/ftobjs.h>
#include <freetype/internal/ftstream.h>
@@ -87,13 +86,13 @@
/* `StartData' or `/sfnts' */
{
FT_Byte buffer[256 + 10];
- FT_Int read_len = 256 + 10;
+ FT_Long read_len = 256 + 10; /* same as signed FT_Stream->size */
FT_Byte* p = buffer;
- for ( offset = (FT_ULong)FT_STREAM_POS(); ; offset += 256 )
+ for ( offset = FT_STREAM_POS(); ; offset += 256 )
{
- FT_Int stream_len;
+ FT_Long stream_len; /* same as signed FT_Stream->size */
stream_len = stream->size - FT_STREAM_POS();
diff --git a/freetype/src/cid/cidriver.c b/freetype/src/cid/cidriver.c
index 044a3aaf2..b17406064 100644
--- a/freetype/src/cid/cidriver.c
+++ b/freetype/src/cid/cidriver.c
@@ -20,7 +20,6 @@
#include "cidriver.h"
#include "cidgload.h"
#include <freetype/internal/ftdebug.h>
-#include <freetype/internal/ftstream.h>
#include "ciderrs.h"
diff --git a/freetype/src/cid/cidriver.h b/freetype/src/cid/cidriver.h
index eff3b6a42..6cade3a9c 100644
--- a/freetype/src/cid/cidriver.h
+++ b/freetype/src/cid/cidriver.h
@@ -26,6 +26,10 @@
FT_BEGIN_HEADER
+#ifdef FT_CONFIG_OPTION_PIC
+#error "this module does not support PIC yet"
+#endif
+
FT_CALLBACK_TABLE
const FT_Driver_ClassRec t1cid_driver_class;