Bug 308346

Summary: freetype2 update for 10.2 broke build of some packages
Product: [openSUSE] openSUSE 10.2 Reporter: Stefan Dirsch <sndirsch>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Normal    
Priority: P2 - High CC: ast, hmuelle, mls, ro
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stefan Dirsch 2007-09-06 18:28:17 UTC
Last freetype2 update to 2.3.5 for 10.2 broke the build of some
packages:

- xgl
- xiterm
- xorg-x11
- xorg-x11-Xvnc
- xorg-x11-server

[...]
libXfont.so: undefined reference to `ft_isdigit'
[...]

I wonder why for this update even no bugzilla entry exists ?!?

-------------------------------------------------------------------
Tue Jul 03 16:19:11 CEST 2007 - mfabian@suse.de

- update to 2.3.5. Extract from the doc/CHANGES file:
  * Some subglyphs in TrueType fonts were handled incorrectly due
    to a missing graphics state reinitialization.
  * Large .Z files  (as distributed with some X11  packages)
    weren't handled correctly, making FreeType increase the heap
    stack in an endless loop.
  * A large number of bugs have been fixed to avoid crashes and
    endless loops with invalid fonts.
  * The two new cache functions  `FTC_ImageCache_LookupScaler' and
    `FTC_SBit_Cache_LookupScaler' have been added to allow lookup of
    glyphs using an  `FTC_Scaler' object;  this makes it possible to
    use fractional pixel sizes in the cache.  The demo programs have
    been updated accordingly to use this feature.
  * A new API  `FT_Get_CMap_Format' has been added to  get the
    cmap format  of a  TrueType font.   This  is useful  in handling
    PDF files. The code has been contributed by Derek Clegg.
  * The  auto-hinter now  produces better output by default for
    non-Latin scripts like Indic.  This was done by using the CJK
    hinting module as the default instead of the Latin one. Thanks
    to Rahul Bhalerao for this suggestion.
  * Support for Windows FON files in PE format has been contributed
    by Dmitry Timoshkov.

I'm rather reluctant to fix this issue in xorg-x11-libs/xorg-x11-devel
and suggest to re-add the missing ft_isdigit define instead to
freetype2 again.

Some details:

libXfont-1.2.3 # grp -r ft_isdigit
[...]
./src/FreeType/fttools.c-#if (FREETYPE_VERSION < 2001008)
./src/FreeType/fttools.c:# ifndef ft_isdigit
./src/FreeType/fttools.c:#  define ft_isdigit isdigit
./src/FreeType/fttools.c-# endif
./src/FreeType/fttools.c-#endif
[...]
./src/FreeType/fttools.c:        while(ft_isdigit(start[i])) {
[...]

build log
---------
[...]
fttools.c:183: warning: implicit declaration of function 'ft_isdigit'
fttools.c:183: warning: nested extern declaration of 'ft_isdigit'

--- freetype-2.2.1.20061027/CVS/Entries 2006-10-27 17:23:16.000000000 +0200
+++ freetype-2.3.5/CVS/Entries  2007-07-03 16:15:00.000000000 +0200

ChangeLog
---------

+       include/freetype/internal/ftobjs.h: As suggested by Graham Asher,
+       ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values
+       instead on relying on the locale-dependent functions provided by
+       <ctypes.h>.

include/freetype/config/ftstdlib.h
----------------------------------

-#include <ctype.h>
-
-#define ft_isalnum   isalnum
-#define ft_isdigit   isdigit
-#define ft_islower   islower
-#define ft_isupper   isupper
-#define ft_isxdigit  isxdigit

include/freetype/internal/ftobjs.h
----------------------------------

+  /*
+   *  character classification functions -- since these are used to parse
+   *  font files, we must not use those in <ctypes.h> which are
+   *  locale-dependent
+   */
+#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )
+
+#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \
+                             ( (unsigned)(x) - 'a' ) < 6U  || \
+                             ( (unsigned)(x) - 'A' ) < 6U  )
+
+  /* the next two macros assume ASCII representation */
+#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )
+#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )
+
+#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )
+#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )
Comment 1 Stefan Dirsch 2007-09-10 14:10:17 UTC
Since I need to update xorg-x11-libs for 10.2 anyway, I will fix this in libXfont instead. Reassigning to myself.
Comment 2 Stefan Dirsch 2007-09-10 14:40:16 UTC
fixed xorg-x11-libs packages submitted for 10.2.