Hello
I'm fixing bugs in the X.Org code that are also passed along to XFree86.  We
have a bug report in the type1 font code.  If anyone on this list has had type1
font code experience and would like to help review this bug it would be
appreciated.  Please contact me at [EMAIL PROTECTED] directly because I don't
subscribe to this email list.  FYI, the bug is in file
xc/lib/font/Type1/t1funcs.c with the RAM requirement heuristic.  Thanks.
Tassia St. Germain

Bug report below:

     VERSION:
R6.6
      CLIENT MACHINE and OPERATING SYSTEM:
SuSE 7.1 with Linux 2.4.18 (i686) and XFree86 4.2.0 as well
as 4.2.99.0 (kernel and Xserver compiled from sources)
      DISPLAY TYPE:
XFree86 with tdfx driver (3dfx Voodoo3 3000 card)
      WINDOW MANAGER:
kwin (KDE), fvwm2
      COMPILER:
gcc 2.95.2
      AREA:
lib/font/Type1
      SYNOPSIS:
The RAM requirement calculation heuristics do not suit a
particular Type1 font, hence making XFree86 abort with the
message "We have REALLY run out of memory".
      DESCRIPTION:
Although my machine has 360 MB and more than 1.3 GB swap
space, whenever I let gimp or kword (KDE) process the
Zodiac.pfb font(available here: http://www.steffmann.de/;
free for private use) in a size of 200 or more pixels,
XFree86 aborts with the message "We have REALLY run out
of memory".  It is, of course, possible, that the mentioned
font is buggy and should be fixed, rather than the XServer.
I have no possibility to check that. But even then, the
patch below fixes the problem.
      REPEAT BY:
1. download this font: http://steffmann.de/fonts/Zodiac.zip
2. install it (e.g. with type1inst)
3. start fvwm2 & gimp (version shouldn't matter. However, I
used v1.2.0.)
4. Start "Xtns/Script-Fu/Logos/3D-Outline" (any other
Logos-Module 'works' too)
5. click "Font: NOT SET" and select font "tierkreiszeichen"
(leave font size and preview text -- they don't matter)
6. back in the Script-Fu dialog: select "Font Size" 200 pixels,
leave the "Text" field ("The Gimp") -- it doesn't seem to
matter
7. hit OK
The XServer aborts and shows the following message:
   Fatal server error:
   We have REALLY run out of memory
      SAMPLE FIX:
This patch increases the estimated RAM requirements. After
applying it, the Xserver doesn't abort any more and works
as intentioned. Gimp displays the above mentioned font with
up to 1000 pixels. I couldn't test bigger sizes, Because
this is Gimps limit. (Even lower for kword.)
   Doubling the factor "120" proved insufficient. It allows
font sizes of 200 pixels, but aborts again for 300 pixels.
600 works for up to 1000 pixels.  I don't know, however, if
in fact this factor is to be increased or rather the
constant 200000 (400000).
   The abort, by the way, happened because of wrong heuristics
in hunk 2 of the diff. I only =assumed= that the other two
places might cause the same problem in other cases.
Be sure to include the "XConsortium" or "TOG" ident line in any diffs.
Sorry, there is no such line. (?) But I included the "Xorg" ident line.
The patch applies to CVS HEAD as of today, 2002-06-08.
Index: t1funcs.c
 ===================================================================
 RCS file: /cvs/xc/lib/font/Type1/t1funcs.c,v
 retrieving revision 3.26
 diff -u -3 -p -r3.26 t1funcs.c
 --- t1funcs.c   2001/12/14 19:56:44     3.26
 +++ t1funcs.c   2002/06/08 11:05:16
 @@ -1,4 +1,4 @@
 -/* $Xorg: t1funcs.c,v 1.5 2001/02/09 02:04:01 xorgcvs Exp $ */
 +/* $Xorg: t1funcs.c,v 1.5 2001/02/09 02:04:01 xorgcvsX Exp $ */
  /* Copyright International Business Machines,Corp. 1991
   * All Rights Reserved
   *
 @@ -341,7 +341,7 @@ CIDOpenScalable (FontPathElementPtr fpe,
      bzero(cid, sizeof(cidglyphs));
      /* heuristic for \""maximum\"" size of pool we'll need: */
 -    size = 200000 + 120 *
 +    size = 200000 + 600 *
                (int)hypot(vals->pixel_matrix[2], vals->pixel_matrix[3])
                * sizeof(short);
      if (size < 0 || NULL == (pool = (long *) xalloc(size))) {
 @@ -549,9 +549,9 @@ Type1OpenScalable (FontPathElementPtr fp
         /* heuristic for \""maximum\"" size of pool we'll need: */
  #ifdef BUILDCID
 -       size = 400000 + 120 *
 +       size = 400000 + 600 *
  #else
 -       size = 200000 + 120 *
 +       size = 200000 + 600 *
  #endif
               (int)hypot(vals->pixel_matrix[2], vals->pixel_matrix[3])
               * sizeof(short);
 @@ -1549,7 +1549,7 @@ CIDRenderGlyph(FontPtr pFont, psobj *cha
  #define  PAD(bits, pad)  (((bits)+(pad)-1)&-(pad))
         /* heuristic for \""maximum\"" size of pool we'll need: */
 -       size = 200000 + 120 *
 +       size = 200000 + 600 *
                (int)hypot(cid->pixel_matrix[2], cid->pixel_matrix[3])
                * sizeof(short);
         if (size < 0 || NULL == (pool = (long *) xalloc(size))) {

_______________________________________________
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts

Reply via email to