summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/cid/cidobjs.c
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-02-08 09:28:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-08 12:31:02 +0100
commitfbfacd33be482fa3cf0aa5cffaf7006d538a2f92 (patch)
tree92da72786b3740e37004623612c4fc1c9640d30f /src/3rdparty/freetype/src/cid/cidobjs.c
parentc1f4286a5cbc1794fe7be5bdbbd6a0bf29ef84d4 (diff)
parent74e04d6ace7aa949db97ae2e46c38a4dc0d4d36a (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
Diffstat (limited to 'src/3rdparty/freetype/src/cid/cidobjs.c')
-rw-r--r--src/3rdparty/freetype/src/cid/cidobjs.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/src/3rdparty/freetype/src/cid/cidobjs.c b/src/3rdparty/freetype/src/cid/cidobjs.c
index bf1519bc6e..77afe1c875 100644
--- a/src/3rdparty/freetype/src/cid/cidobjs.c
+++ b/src/3rdparty/freetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
-/* Copyright 1996-2015 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,6 +26,7 @@
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+#include FT_DRIVER_H
#include "ciderrs.h"
@@ -113,16 +114,16 @@
CID_Size size = (CID_Size)cidsize;
- if ( cidsize->internal )
+ if ( cidsize->internal->module_data )
{
PSH_Globals_Funcs funcs;
funcs = cid_size_get_globals_funcs( size );
if ( funcs )
- funcs->destroy( (PSH_Globals)cidsize->internal );
+ funcs->destroy( (PSH_Globals)cidsize->internal->module_data );
- cidsize->internal = NULL;
+ cidsize->internal->module_data = NULL;
}
}
@@ -145,7 +146,7 @@
error = funcs->create( cidsize->face->memory, priv, &globals );
if ( !error )
- cidsize->internal = (FT_Size_Internal)(void*)globals;
+ cidsize->internal->module_data = globals;
}
return error;
@@ -164,7 +165,7 @@
funcs = cid_size_get_globals_funcs( (CID_Size)size );
if ( funcs )
- funcs->set_scale( (PSH_Globals)size->internal,
+ funcs->set_scale( (PSH_Globals)size->internal->module_data,
size->metrics.x_scale,
size->metrics.y_scale,
0, 0 );
@@ -463,9 +464,42 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- cid_driver_init( FT_Module driver )
+ cid_driver_init( FT_Module module )
{
- FT_UNUSED( driver );
+ PS_Driver driver = (PS_Driver)module;
+
+ FT_UInt32 seed;
+
+
+ /* set default property values, cf. `ftt1drv.h' */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ driver->hinting_engine = FT_HINTING_FREETYPE;
+#else
+ driver->hinting_engine = FT_HINTING_ADOBE;
+#endif
+
+ driver->no_stem_darkening = TRUE;
+
+ driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;
+ driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;
+ driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;
+ driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;
+ driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;
+ driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;
+ driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
+ driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
+
+ /* compute random seed from some memory addresses */
+ seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&module ^
+ (FT_Offset)(char*)module->memory );
+ seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
+
+ driver->random_seed = (FT_Int32)seed;
+ if ( driver->random_seed < 0 )
+ driver->random_seed = -driver->random_seed;
+ else if ( driver->random_seed == 0 )
+ driver->random_seed = 123456789;
return FT_Err_Ok;
}