shithub: freetype+ttf2subf

Download patch

ref: c32019b64af395d3d0ff6b8763d14cd24b96142a
parent: 19fbc576afe8e8de2f49f57ddbe4a27c84bcbaa1
author: Werner Lemberg <[email protected]>
date: Thu May 28 02:56:26 EDT 2009

Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
Reported by Krzysztof Kowalczyk <[email protected]>.

* src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
Make it work.
Simplify #ifdef logic.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-28  Werner Lemberg  <[email protected]>
+
+	Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
+	Reported by Krzysztof Kowalczyk <[email protected]>.
+
+	* src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
+	Make it work.
+	Simplify #ifdef logic.
+
 2009-05-22  Werner Lemberg  <[email protected]>
 
 	Improve b/w rasterizer.
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -266,19 +266,27 @@
     error = pcf_load_font( stream, face );
     if ( error )
     {
-      FT_Error  error2;
+      PCF_Face_Done( pcfface );
 
+#if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \
+    defined( FT_CONFIG_OPTION_USE_LZW )
 
-      PCF_Face_Done( pcfface );
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+      {
+        FT_Error  error2;
 
-      /* this didn't work, try gzip support! */
-      error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream );
-      if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
-        goto Fail;
 
-      error = error2;
-      if ( error )
+        /* this didn't work, try gzip support! */
+        error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream );
+        if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
+          goto Fail;
+
+        error = error2;
+      }
+#endif /* FT_CONFIG_OPTION_USE_ZLIB */
+
 #ifdef FT_CONFIG_OPTION_USE_LZW
+      if ( error )
       {
         FT_Error  error3;
 
@@ -289,32 +297,26 @@
           goto Fail;
 
         error = error3;
-        if ( error )
-          goto Fail;
+      }
+#endif /* FT_CONFIG_OPTION_USE_LZW */
 
-        face->gzip_source = stream;
-        pcfface->stream   = &face->gzip_stream;
+      if ( error )
+        goto Fail;
 
-        stream = pcfface->stream;
+      face->gzip_source = stream;
+      pcfface->stream   = &face->gzip_stream;
 
-        error = pcf_load_font( stream, face );
-        if ( error )
-          goto Fail;
-      }
-#else
+      stream = pcfface->stream;
+
+      error = pcf_load_font( stream, face );
+      if ( error )
         goto Fail;
-#endif
-      else
-      {
-        face->gzip_source = stream;
-        pcfface->stream   = &face->gzip_stream;
 
-        stream = pcfface->stream;
+#else /* !(FT_CONFIG_OPTION_USE_ZLIB || FT_CONFIG_OPTION_USE_LZW) */
 
-        error = pcf_load_font( stream, face );
-        if ( error )
-          goto Fail;
-      }
+      goto Fail;
+
+#endif
     }
 
     /* set up charmap */