summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/psnames/psmodule.c
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2013-03-26 08:57:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-01 12:03:55 +0200
commit6845a4fb0147117e8517d66f18792ca7acdbe06e (patch)
tree68e35417b79989a7af8a4ea8c0d282b84dbe0a6e /src/3rdparty/freetype/src/psnames/psmodule.c
parent0fcadcca3d0842354de07ffaa8c622e607aab22c (diff)
Update bundled FreeType sources to 2.3.12
Most important changes: * SFNT cmap 13 table format support; * fixed glitches when rasterizing stretched TTF (xsize!=ysize); * various fixes in Type1, CFF, and PCF drivers Change-Id: Ib9e2210ffbd0daa2fdbf518ea87f4be502de6b48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/psnames/psmodule.c')
-rw-r--r--src/3rdparty/freetype/src/psnames/psmodule.c73
1 files changed, 39 insertions, 34 deletions
diff --git a/src/3rdparty/freetype/src/psnames/psmodule.c b/src/3rdparty/freetype/src/psnames/psmodule.c
index 41942a9b46..00b363f8bb 100644
--- a/src/3rdparty/freetype/src/psnames/psmodule.c
+++ b/src/3rdparty/freetype/src/psnames/psmodule.c
@@ -24,6 +24,7 @@
#include "pstables.h"
#include "psnamerr.h"
+#include "pspic.h"
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -33,7 +34,7 @@
#define VARIANT_BIT 0x80000000UL
-#define BASE_GLYPH( code ) ( (code) & ~VARIANT_BIT )
+#define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
/* Return the Unicode value corresponding to a given glyph. Note that */
@@ -57,7 +58,7 @@
/* `uniXXXXYYYYZZZZ'... */
FT_Int count;
- FT_ULong value = 0;
+ FT_UInt32 value = 0;
const char* p = glyph_name + 3;
@@ -92,7 +93,7 @@
if ( *p == '\0' )
return value;
if ( *p == '.' )
- return value | VARIANT_BIT;
+ return (FT_UInt32)( value | VARIANT_BIT );
}
}
@@ -101,7 +102,7 @@
if ( glyph_name[0] == 'u' )
{
FT_Int count;
- FT_ULong value = 0;
+ FT_UInt32 value = 0;
const char* p = glyph_name + 1;
@@ -132,7 +133,7 @@
if ( *p == '\0' )
return value;
if ( *p == '.' )
- return value | VARIANT_BIT;
+ return (FT_UInt32)( value | VARIANT_BIT );
}
}
@@ -154,9 +155,10 @@
/* now look up the glyph in the Adobe Glyph List */
if ( !dot )
- return ft_get_adobe_glyph_index( glyph_name, p );
+ return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
else
- return ft_get_adobe_glyph_index( glyph_name, dot ) | VARIANT_BIT;
+ return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
+ VARIANT_BIT );
}
}
@@ -435,7 +437,7 @@
}
- static FT_ULong
+ static FT_UInt32
ps_unicodes_char_next( PS_Unicodes table,
FT_UInt32 *unicode )
{
@@ -516,38 +518,43 @@
}
- static
- const FT_Service_PsCMapsRec pscmaps_interface =
- {
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
-
+ FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface,
(PS_Unicode_ValueFunc) ps_unicode_value,
(PS_Unicodes_InitFunc) ps_unicodes_init,
(PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
(PS_Unicodes_CharNextFunc) ps_unicodes_char_next,
+ (PS_Macintosh_NameFunc) ps_get_macintosh_name,
+ (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
+
+ t1_standard_encoding,
+ t1_expert_encoding
+ )
+
#else
+ FT_DEFINE_SERVICE_PSCMAPSREC(pscmaps_interface,
0,
0,
0,
0,
-#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
-
(PS_Macintosh_NameFunc) ps_get_macintosh_name,
(PS_Adobe_Std_StringsFunc) ps_get_standard_strings,
t1_standard_encoding,
t1_expert_encoding
- };
+ )
+
+#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
+
+
+ FT_DEFINE_SERVICEDESCREC1(pscmaps_services,
+ FT_SERVICE_ID_POSTSCRIPT_CMAPS, &FT_PSCMAPS_INTERFACE_GET
+ )
- static const FT_ServiceDescRec pscmaps_services[] =
- {
- { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface },
- { NULL, NULL }
- };
static FT_Pointer
@@ -556,16 +563,20 @@
{
FT_UNUSED( module );
- return ft_service_list_lookup( pscmaps_services, service_id );
+ return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id );
}
#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
+#define PUT_PS_NAMES_SERVICE(a) 0
+#else
+#define PUT_PS_NAMES_SERVICE(a) a
+#endif
- FT_CALLBACK_TABLE_DEF
- const FT_Module_Class psnames_module_class =
- {
+ FT_DEFINE_MODULE(psnames_module_class,
+
0, /* this is not a font driver, nor a renderer */
sizeof ( FT_ModuleRec ),
@@ -573,18 +584,12 @@
0x10000L, /* driver version */
0x20000L, /* driver requires FreeType 2 or above */
-#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- 0,
- (FT_Module_Constructor)0,
- (FT_Module_Destructor) 0,
- (FT_Module_Requester) 0
-#else
- (void*)&pscmaps_interface, /* module specific interface */
+ PUT_PS_NAMES_SERVICE((void*)&FT_PSCMAPS_INTERFACE_GET), /* module specific interface */
(FT_Module_Constructor)0,
(FT_Module_Destructor) 0,
- (FT_Module_Requester) psnames_get_service
-#endif
- };
+ (FT_Module_Requester) PUT_PS_NAMES_SERVICE(psnames_get_service)
+ )
+
/* END */