* include/freetype/internal/ftbdf.h, src/base/ftbdf.c, src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk: Adding a new API called "FT_Get_BDF_Charset_ID" to retrieve BDF-specific strings from a face. This is much cleaner than accessing the internal types "BDF_Public_Face" defined in FT_INTERNAL_BDF_TYPES_H
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
diff --git a/ChangeLog b/ChangeLog
index ef9a346..26932aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-05-21 David Turner <david@freetype.org>
+
+ * include/freetype/internal/ftbdf.h, src/base/ftbdf.c,
+ src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk:
+
+ Adding a new API called "FT_Get_BDF_Charset_ID" to retrieve
+ BDF-specific strings from a face. This is much cleaner
+ than accessing the internal types "BDF_Public_Face" defined in
+ FT_INTERNAL_BDF_TYPES_H
+
2002-05-21 Werner Lemberg <wl@gnu.org>
* src/bdf/README: Mention Microsoft's SBIT tool.
diff --git a/include/freetype/ftbdf.h b/include/freetype/ftbdf.h
new file mode 100644
index 0000000..8dfb9fc
--- /dev/null
+++ b/include/freetype/ftbdf.h
@@ -0,0 +1,16 @@
+#ifndef __FT_BDF_H__
+#define __FT_BDF_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+FT_BEGIN_HEADER
+
+ FT_EXPORT( FT_Error )
+ FT_Get_BDF_Charset_ID( FT_Face face,
+ const char* *acharset_encoding,
+ const char* *acharset_registry );
+
+FT_END_HEADER
+
+#endif /* __FT_BDF_H__ */
diff --git a/src/base/Jamfile b/src/base/Jamfile
index 79fdb22..76efd28 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -23,7 +23,7 @@ SubDirHdrs [ FT2_SubDir src base ] ;
# Add the optional/replaceable files.
#
-Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c
+Library $(FT2_LIB) : ftsystem.c ftinit.c ftglyph.c ftmm.c ftbdf.c
ftbbox.c ftdebug.c ;
# Add Macintosh-specific file to the library when necessary.
diff --git a/src/base/descrip.mms b/src/base/descrip.mms
index efa5b07..83bb508 100644
--- a/src/base/descrip.mms
+++ b/src/base/descrip.mms
@@ -15,7 +15,7 @@
CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.builds.vms],[--.include],[--.src.base])
-OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftmm.obj
+OBJS=ftbase.obj,ftinit.obj,ftglyph.obj,ftdebug.obj,ftbdf.obj,ftmm.obj
all : $(OBJS)
library [--.lib]freetype.olb $(OBJS)
diff --git a/src/base/ftbdf.c b/src/base/ftbdf.c
new file mode 100644
index 0000000..558970c
--- /dev/null
+++ b/src/base/ftbdf.c
@@ -0,0 +1,40 @@
+#include <ft2build.h>
+#include FT_INTERNAL_BDF_TYPES_H
+#include FT_INTERNAL_OBJECTS_H
+
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_BDF_Charset_ID( FT_Face face,
+ const char* *acharset_encoding,
+ const char* *acharset_registry )
+ {
+ FT_Error error;
+ const char* encoding = NULL;
+ const char* registry = NULL;
+
+
+ error = FT_Err_Invalid_Argument;
+
+ if ( face != NULL && face->driver != NULL )
+ {
+ FT_Module driver = (FT_Module) face->driver;
+
+ if ( driver->clazz && driver->clazz->module_name &&
+ ft_strcmp( driver->clazz->module_name, "bdf" ) == 0 )
+ {
+ BDF_Public_Face bdf_face = (BDF_Public_Face) face;
+
+ encoding = (const char*) bdf_face->charset_encoding;
+ registry = (const char*) bdf_face->charset_registry;
+ error = 0;
+ }
+ }
+
+ if ( acharset_encoding )
+ *acharset_encoding = encoding;
+
+ if ( acharset_registry )
+ *acharset_registry = registry;
+
+ return error;
+ }
diff --git a/src/base/rules.mk b/src/base/rules.mk
index b89bc80..b27611d 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -51,6 +51,7 @@ BASE_SRC := $(BASE_)ftcalc.c \
#
BASE_EXT_SRC := $(BASE_)ftglyph.c \
$(BASE_)ftmm.c \
+ $(BASE_)ftbdf.c \
$(BASE_)ftbbox.c
# Default extensions objects