shithub: freetype+ttf2subf

Download patch

ref: 389acc625edf757f2b555e5d1fd7995f192edd0e
parent: a9f3ccb523890f5416526d616285d4b5c347d926
author: Werner Lemberg <[email protected]>
date: Mon Jan 1 12:25:21 EST 2001

* 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'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2001-01-01  Francesco Zappa Nardelli  <[email protected]>
+
+	* 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  <[email protected]>
+
+	* src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type.
+
+2000-12-31  Werner Lemberg  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* src/cff/cffload.c (CFF_Load_Charset): Improved error messages.
--- a/builds/modules.mk
+++ b/builds/modules.mk
@@ -32,31 +32,31 @@
 # 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.
--- 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)
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -99,6 +99,10 @@
     /* Windows fonts component */
     trace_winfnt,
 
+    /* PCF fonts component */
+    trace_pcfdriver,
+    trace_pcfread,
+
     /* the last level must always be `trace_max' */
     trace_max
 
--- /dev/null
+++ b/include/freetype/internal/pcftypes.h
@@ -1,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 */
--- 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;