pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: font bug in games/xblockout



OK, since I imported this pkg I feel responsible.
Calling both XLoadQueryFont() and XLoadFont() doesn't
make much sense indeed, so I followed the Gentoo fix
so far. A all-wildcard fallback is not so great; it ends
up as something huge and unreadable for me... (And
dereferencing a pointer before checking against 0
isn't either:-)
Do the appended patches help for you? (I also
replaced the 24pt "bigfont" by 25pt. For some reason
the former isn't available for me but the latter is.)
best regards
Matthias





-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
$NetBSD$

--- initmenu.c.orig     2005-11-07 21:40:38.000000000 +0100
+++ initmenu.c
@@ -408,37 +408,34 @@ void inittext(struct menu *m, struct opt
   XCharStruct overall_return ;
 
   m->xfont = XLoadQueryFont( x->display , opt->thefont ) ;
-  m->font = XLoadFont( x->display , opt->thefont ) ;
   if ( opt->verbose )
     {
       fprintf(stderr,"font=%s\n", opt->thefont) ;
     }
-  if ( m->font==BadAlloc || m->font==BadName || m->xfont==0 )
+  if ( m->xfont==0 )
     {
       fprintf(stderr,"Some problems when loading a font... trying others\n") ;
       m->xfont = XLoadQueryFont( x->display , 
-                                "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" ) ;
-      m->font = XLoadFont( x->display , 
-                          "-*-*-*-*-*-*-*-*-*-*-*-*-*-*" ) ;
-      if ( m->font==BadAlloc || m->font==BadName || m->xfont==0 )
+                                "fixed" ) ;
+      if ( m->xfont==0 )
        {
-         fprintf(stderr,"You haven't -*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
+         fprintf(stderr,"You haven't \"fixed\"\n");
          fprintf(stderr,"Have you A font?\n");
          fprintf(stderr,"Retry with -font option\n");
          exit(1) ;
        }
     }
+  m->font = m->xfont->fid;
   m->xfont2 = XLoadQueryFont( x->display , opt->thefont2 ) ;
-  m->font2 = XLoadFont( x->display , opt->thefont2 ) ;
   if ( opt->verbose )
     {
       fprintf(stderr,"font2=%s\n", opt->thefont2) ;
     }
-  if ( m->font2==BadAlloc || m->font2==BadName || m->xfont2==0 )
+  if ( m->xfont2==0 )
     {
-      m->font2 = m->font ;
       m->xfont2 = m->xfont ;
     }
+  m->font2 = m->xfont2->fid;
 
   xgc.background = x->back_pixel ;
   xgc.foreground = opt->backcolor!=7 ? x->white_pixel : x->black_pixel;
$NetBSD$

--- bl.c.orig   2007-01-28 19:22:32.000000000 +0100
+++ bl.c
@@ -279,7 +279,7 @@ B |#plane|Col|Swap|Flick|AllFlick|Redraw
   bl.opt.state = STOP ;
 
   strcpy( bl.opt.thefont , "-*-*-*-r-*-*-12-*-*-*-*-*-iso8859-1" ) ;
-  strcpy( bl.opt.thefont2 , "-*-*-*-r-*-*-24-*-*-*-*-*-iso8859-1" ) ;
+  strcpy( bl.opt.thefont2 , "-*-*-*-r-*-*-25-*-*-*-*-*-iso8859-1" ) ;
 
   bl.boardkey[0] = bl.opt.userkey ;
   bl.boardkey[1] = "14789632azqswx \035p\0030" ;


Home | Main Index | Thread Index | Old Index