* docs/CHANGES: Updated. Add new service for getting the ROS from a CID font. * include/freetype/config/ftheader.h (FT_CID_H): New macro. * include/freetype/ftcid.h: New file. * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro. * include/freetype/internal/services/svcid.h: New file. * src/base/ftcid.c: New file. * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H. (cff_get_ros): New function. (cff_service_cid_info): New service structure. (cff_services): Register it. * src/cff/cffload.c (cff_font_done): Free registry and ordering. * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'. * modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
diff --git a/ChangeLog b/ChangeLog
index 59986bd..3079fed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2007-07-16 Werner Lemberg <wl@gnu.org>
+
+ * docs/CHANGES: Updated.
+
+2007-07-16 Derek Clegg <dclegg@apple.com>
+
+ Add new service for getting the ROS from a CID font.
+
+ * include/freetype/config/ftheader.h (FT_CID_H): New macro.
+ * include/freetype/ftcid.h: New file.
+
+ * include/freetype/internal/ftserv.h (FT_SERVIVE_CID_H): New macro.
+ * include/freetype/internal/services/svcid.h: New file.
+
+ * src/base/ftcid.c: New file.
+
+ * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H.
+ (cff_get_ros): New function.
+ (cff_service_cid_info): New service structure.
+ (cff_services): Register it.
+
+ * src/cff/cffload.c (cff_font_done): Free registry and ordering.
+
+ * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'.
+
+ * modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
+
2007-07-11 Derek Clegg <dclegg@apple.com>
Add support for postscript name service to CFF driver.
diff --git a/docs/CHANGES b/docs/CHANGES
index 79fd778..1c42b86 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -1,4 +1,16 @@
+CHANGES BETWEEN 2.3.6 and 2.3.5
+
+ II. IMPORTANT CHANGES
+
+ - The new function `FT_Get_CID_Registry_Ordering_Supplement' gives
+ access to those fields in a CID-keyed font. The code has been
+ contributed by Derek Clegg.
+
+
+======================================================================
+
+
CHANGES BETWEEN 2.3.5 and 2.3.4
I. IMPORTANT BUG FIXES
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index b957d05..31aa3d5 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -386,6 +386,20 @@
/*************************************************************************
*
* @macro:
+ * FT_CID_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing the
+ * definitions of an API which access CID font information from a
+ * face.
+ *
+ */
+#define FT_CID_H <freetype/ftcid.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_GZIP_H
*
* @description:
diff --git a/include/freetype/ftchapters.h b/include/freetype/ftchapters.h
index bd812c8..9f1eb3f 100644
--- a/include/freetype/ftchapters.h
+++ b/include/freetype/ftchapters.h
@@ -54,6 +54,7 @@
/* type1_tables */
/* sfnt_names */
/* bdf_fonts */
+/* cid_fonts */
/* pfr_fonts */
/* winfnt_fonts */
/* font_formats */
diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
index 45d2fa9..2db3e87 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -301,6 +301,7 @@ FT_BEGIN_HEADER
*/
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
+#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
diff --git a/modules.cfg b/modules.cfg
index 6d8a95e..525866a 100644
--- a/modules.cfg
+++ b/modules.cfg
@@ -152,6 +152,11 @@ BASE_EXTENSIONS += ftbbox.c
# See include/freetype/ftbdf.h for the API.
BASE_EXTENSIONS += ftbdf.c
+# Access CID font information.
+#
+# See include/freetype/ftcid.h for the API.
+BASE_EXTENSIONS += ftcid.c
+
# Utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp bitmaps into
# 8bpp format, and for emboldening of bitmap glyphs.
#
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 99740d1..d2f0a4d 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -22,6 +22,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_IDS_H
+#include FT_SERVICE_CID_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
@@ -420,6 +421,66 @@
};
+ /*
+ * CID INFO SERVICE
+ *
+ */
+ static FT_Error
+ cff_get_ros( CFF_Face face,
+ const char* *registry,
+ const char* *ordering,
+ FT_Int *supplement )
+ {
+ FT_Error error = CFF_Err_Ok;
+ CFF_Font cff = (CFF_Font)face->extra.data;
+
+
+ if ( cff )
+ {
+ CFF_FontRecDict dict = &cff->top_font.font_dict;
+ FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
+
+
+ if ( dict->cid_registry == 0xFFFFU )
+ {
+ error = CFF_Err_Invalid_Argument;
+ goto Fail;
+ }
+
+ if ( registry )
+ {
+ if ( cff->registry == NULL )
+ cff->registry = cff_index_get_sid_string( &cff->string_index,
+ dict->cid_registry,
+ psnames );
+ *registry = cff->registry;
+ }
+
+ if ( ordering )
+ {
+ if ( cff->ordering == NULL )
+ cff->ordering = cff_index_get_sid_string( &cff->string_index,
+ dict->cid_ordering,
+ psnames );
+ *ordering = cff->ordering;
+ }
+
+ if ( supplement )
+ *supplement = dict->cid_supplement;
+
+ }
+
+ Fail:
+ return error;
+ }
+
+
+ static const FT_Service_CIDRec cff_service_cid_info =
+ {
+ (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros
+ };
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -441,6 +502,7 @@
{ FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict },
#endif
{ FT_SERVICE_ID_TT_CMAP, &cff_service_get_cmap_info },
+ { FT_SERVICE_ID_CID, &cff_service_cid_info },
{ NULL, NULL }
};
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index dd2f113..242c06a 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1590,6 +1590,9 @@
FT_FREE( font->font_info );
}
+ FT_FREE( font->registry );
+ FT_FREE( font->ordering );
+
FT_FREE( font->global_subrs );
FT_FREE( font->font_name );
}
diff --git a/src/cff/cfftypes.h b/src/cff/cfftypes.h
index 306e5aa..b5e5115 100644
--- a/src/cff/cfftypes.h
+++ b/src/cff/cfftypes.h
@@ -259,6 +259,10 @@ FT_BEGIN_HEADER
/* since version 2.3.0 */
PS_FontInfoRec* font_info; /* font info dictionary */
+ /* since version 2.3.6 */
+ FT_String* registry;
+ FT_String* ordering;
+
} CFF_FontRec, *CFF_Font;