Add missing ChangeLog entry, copyright notices, whitespace, formatting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
diff --git a/ChangeLog b/ChangeLog
index e19cb50..f644b53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2017-12-25 Ewald Hew <ewaldhew@gmail.com>
+
+ Move PostScript drivers' property handlers to `base'.
+
+ This reduces the amount of duplicated code across PostScript
+ drivers.
+
+ * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c
+ ({cff,cid,t1}_property_{get,set}): Moved to...
+ * include/freetype/internal/ftpsprop.h: ...this new file.
+ (ps_property_{get,set}): New functions to replace moved ones.
+
+ * src/base/ftpsprop.c: New file that implements above functions.
+
+ * include/freetype/internal/internal.h
+ (FT_INTERNAL_POSTSCRIPT_PROPS_H): New macro.
+
+ * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c:
+ Updated.
+
+ * src/base/Jamfile, src/base/rules.mk (BASE_SRC), src/base/ftbase.c:
+ Updated.
+
2017-12-20 Werner Lemberg <wl@gnu.org>
Speed up FT_Set_Var_{Design,Blend}_Coordinates if curr == new.
diff --git a/include/freetype/internal/ftpsprop.h b/include/freetype/internal/ftpsprop.h
index 97e313a..cbd2874 100644
--- a/include/freetype/internal/ftpsprop.h
+++ b/include/freetype/internal/ftpsprop.h
@@ -4,6 +4,15 @@
/* */
/* Get and set properties of PostScript drivers (specification). */
/* */
+/* Copyright 2017 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
/***************************************************************************/
diff --git a/src/base/ftpsprop.c b/src/base/ftpsprop.c
index a8bb050..b146eab 100644
--- a/src/base/ftpsprop.c
+++ b/src/base/ftpsprop.c
@@ -5,7 +5,15 @@
/* Get and set properties of PostScript drivers (body). */
/* See `ftdriver.h' for available properties. */
/* */
-/* Copyright */
+/* Copyright 2017 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
/***************************************************************************/
@@ -86,9 +94,11 @@
return error;
}
+
else if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
-#if defined(CFF_CONFIG_OPTION_OLD_ENGINE) || defined(T1_CONFIG_OPTION_OLD_ENGINE)
+#if defined( CFF_CONFIG_OPTION_OLD_ENGINE ) || \
+ defined( T1_CONFIG_OPTION_OLD_ENGINE )
const char* module_name = module->clazz->module_name;
#endif
@@ -101,17 +111,20 @@
if ( !ft_strcmp( s, "adobe" ) )
driver->hinting_engine = FT_HINTING_ADOBE;
+
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
else if ( !ft_strcmp( module_name, "cff" ) &&
- !ft_strcmp( s, "freetype" ) )
+ !ft_strcmp( s, "freetype" ) )
driver->hinting_engine = FT_HINTING_FREETYPE;
#endif
+
#ifdef T1_CONFIG_OPTION_OLD_ENGINE
else if ( ( !ft_strcmp( module_name, "type1" ) ||
!ft_strcmp( module_name, "t1cid" ) ) &&
- !ft_strcmp( s, "freetype" ) )
+ !ft_strcmp( s, "freetype" ) )
driver->hinting_engine = FT_HINTING_FREETYPE;
#endif
+
else
return FT_THROW( Invalid_Argument );
}
@@ -124,7 +137,7 @@
if ( *hinting_engine == FT_HINTING_ADOBE
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|| ( *hinting_engine == FT_HINTING_FREETYPE &&
- !ft_strcmp( module_name, "cff" ) )
+ !ft_strcmp( module_name, "cff" ) )
#endif
#ifdef T1_CONFIG_OPTION_OLD_ENGINE
|| ( *hinting_engine == FT_HINTING_FREETYPE &&
@@ -139,6 +152,7 @@
return error;
}
}
+
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
@@ -164,6 +178,7 @@
return error;
}
+
else if ( !ft_strcmp( property_name, "random-seed" ) )
{
FT_Int32 random_seed;
@@ -221,6 +236,7 @@
return error;
}
+
else if ( !ft_strcmp( property_name, "hinting-engine" ) )
{
FT_UInt hinting_engine = driver->hinting_engine;
@@ -231,6 +247,7 @@
return error;
}
+
else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
{
FT_Bool no_stem_darkening = driver->no_stem_darkening;
@@ -247,3 +264,5 @@
return FT_THROW( Missing_Property );
}
+
+/* END */
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index b55b2ea..4236c80 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -821,6 +821,7 @@
* PROPERTY SERVICE
*
*/
+
FT_DEFINE_SERVICE_PROPERTIESREC(
cff_service_properties,
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index d665d12..464ff49 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -176,6 +176,7 @@
* PROPERTY SERVICE
*
*/
+
FT_DEFINE_SERVICE_PROPERTIESREC(
cid_service_properties,
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index f354ac1..57a91ae 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -621,6 +621,7 @@
* PROPERTY SERVICE
*
*/
+
FT_DEFINE_SERVICE_PROPERTIESREC(
t1_service_properties,