Commit 389acc625edf757f2b555e5d1fd7995f192edd0e

Werner Lemberg 2001-01-01T17:25:21

* src/pcf/*: New driver module for PCF font format (used in X Windows). * include/freetype/internal/ftdebug.h (FT_Trace): Added values for PCF driver. * include/freetype/internal/pcftypes.h: New file. * include/freetype/config/ftmodule.h: Added PCF driver module. * src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type. * builds/modules.mk (clean_module_list): Fixed deletion of module file in case `make make_module_list' is called before `make setup'.

diff --git a/ChangeLog b/ChangeLog
index 9cbcc3f..1f7d0a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2001-01-01  Francesco Zappa Nardelli  <francesco.zappa.nardelli@ens.fr>
+
+	* src/pcf/*: New driver module for PCF font format (used in
+	X Windows).
+	* include/freetype/internal/ftdebug.h (FT_Trace): Added values for
+	PCF driver.
+	* include/freetype/internal/pcftypes.h: New file.
+	* include/freetype/config/ftmodule.h: Added PCF driver module.
+
+2001-01-01  Werner Lemberg  <wl@gnu.org>
+
+	* src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type.
+
+2000-12-31  Werner Lemberg  <wl@gnu.org>
+
+	* builds/modules.mk (clean_module_list): Fixed deletion of module
+	file in case `make make_module_list' is called before `make setup'.
+
 2000-12-30  Werner Lemberg  <wl@gnu.org>
 
 	* src/cff/cffload.c (CFF_Load_Charset): Improved error messages.
diff --git a/builds/modules.mk b/builds/modules.mk
index 59f1223..3f911de 100644
--- a/builds/modules.mk
+++ b/builds/modules.mk
@@ -32,32 +32,32 @@ endif
 # To build the modules list, we invoke the `make_module_list' target.
 #
 # This rule is commented out by default since FreeType comes already with
-# a ftmodule.h file.
+# an ftmodule.h file.
 #
 #$(MODULE_LIST): make_module_list
 
+
+ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
+  OPEN_MODULE   := @echo$(space)
+  CLOSE_MODULE  :=  >> $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST))
+  REMOVE_MODULE := @-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST))
+else
+  OPEN_MODULE   := @echo "
+  CLOSE_MODULE  := " >> $(MODULE_LIST)
+  REMOVE_MODULE := @-$(DELETE) $(MODULE_LIST)
+endif
+
+
 # Before the modules list file can be generated, we must remove the file in
 # order to `clean' the list.
 #
 clean_module_list:
-	@-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST))
+	$(REMOVE_MODULE)
 	@-echo Regenerating the modules list in $(MODULE_LIST)...
 
 make_module_list: clean_module_list
 	@echo done.
 
-
-# Trailing spaces are protected with a `#' sign to avoid accidental
-# removing.
-#
-ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),)
-  OPEN_MODULE  := @echo$(space)
-  CLOSE_MODULE :=  >> $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST))
-else
-  OPEN_MODULE  := @echo "
-  CLOSE_MODULE := " >> $(MODULE_LIST)
-endif
-
 # $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver
 # in the `module.mk' rules file.
 #
diff --git a/include/freetype/config/ftmodule.h b/include/freetype/config/ftmodule.h
index 8a9ea0a..eb35a32 100644
--- a/include/freetype/config/ftmodule.h
+++ b/include/freetype/config/ftmodule.h
@@ -1,6 +1,7 @@
 FT_USE_MODULE(autohint_module_class)
 FT_USE_MODULE(cff_driver_class)
 FT_USE_MODULE(t1cid_driver_class)
+FT_USE_MODULE(pcf_driver_class)
 FT_USE_MODULE(psaux_module_class)
 FT_USE_MODULE(psnames_module_class)
 FT_USE_MODULE(ft_raster1_renderer_class)
diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h
index 0ab4c33..d42e7f0 100644
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -99,6 +99,10 @@ FT_BEGIN_HEADER
     /* Windows fonts component */
     trace_winfnt,
 
+    /* PCF fonts component */
+    trace_pcfdriver,
+    trace_pcfread,
+
     /* the last level must always be `trace_max' */
     trace_max
 
diff --git a/include/freetype/internal/pcftypes.h b/include/freetype/internal/pcftypes.h
new file mode 100644
index 0000000..8febb26
--- /dev/null
+++ b/include/freetype/internal/pcftypes.h
@@ -0,0 +1,54 @@
+/*  pcftypes.h                                                                 
+
+  FreeType font driver for pcf fonts
+
+  Copyright (C) 2000 by            
+  Francesco Zappa Nardelli     
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+
+#ifndef __PCFTYPES_H__
+#define __PCFTYPES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+  typedef struct  PCF_Public_FaceRec_
+  {
+    FT_FaceRec  root;
+  
+    char*       charset_encoding;
+    char*       charset_registry;
+
+  } PCF_Public_FaceRec, *PCF_Public_Face;
+
+
+FT_END_HEADER
+
+#endif  /* __PCFTYPES_H__ */
+
+
+/* END */
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 210c15a..d1d5326 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -469,16 +469,16 @@
 
   static
   FT_UInt  FNT_Get_Char_Index( FT_CharMap  charmap,
-                               FT_ULong    char_code )
+                               FT_Long     char_code )
   {
-    FT_UInt  result = char_code;
+    FT_Long  result = char_code;
 
 
     if ( charmap )
     {
       FNT_Font*  font  = ((FNT_Face)charmap->face)->fonts;
-      FT_UInt    first = font->header.first_char;
-      FT_UInt    count = font->header.last_char - first + 1;
+      FT_Long    first = font->header.first_char;
+      FT_Long    count = font->header.last_char - first + 1;
 
 
       char_code -= first;