Broken Font Loading

Robert Martin rsmartin@ucsd.edu
Thu Jan 29 20:49:00 GMT 2009


I recently accidentally upgraded my Cygwin/X to Version 1.5.3.

One of the applications I use, amrvis, from Berkeley lab now crashes 
when I try to get a line plot when it still works with a previous 
version of Cygwin/X on another machine (the about dialog just says the 
dialog is from 2004/3/25, but I think it's actually newer than that... 
man for 'X' says version 6.8.2.0).

Here's what I could track down that seemed relevant.

-----------------------------------------

Program received signal SIGSEGV, Segmentation fault.
0x0000000000470360 in XYPlotWin (this=0x7b7f90, title=<value optimized out>,
    app=<value optimized out>, w=<value optimized out>,
    parent=<value optimized out>, type=<value optimized out>, curr_frame=0)
    at XYPlotWin.cpp:397
397       gcvals.font = labeltextFont->fid;

(gdb) p labeltextFont->fid
Cannot access memory at address 0x9

XYPlotWin.cpp:392:  labeltextFont = PM_FONT("LabelFont");

XYPlotWin.cpp:102:#define PM_FONT(name) 
((parameters->Get_Parameter(name, &param_temp)) ? \
XYPlotWin.cpp-103-   param_temp.fontv.value : (BL_ASSERT(0), 
(XFontStruct *) 0))

XYPlotParam.cpp:170:  DEF("LabelFont", FONT, DEF_LABEL_FONT);

XYPlotDefaults.H:52:#define DEF_LABEL_FONT             "helvetica-10"

XYPlot.Defaults:12:LabelFont            FONT    helvetica-10

XYPlotParam.cpp:
   268    switch (type) {
       ...
   287      case FONT:
   288        if( ! do_font(form, &result->fontv.value)) {
   289          fprintf(stderr, paramstr, name, form, "font", DEF_FONT);
   290          do_font(DEF_FONT, &result->fontv.value);
   291        }
   292      break;   

   370  int XYPlotParameters::do_font(char *name, XFontStruct **font_info) {
   371    char name_copy[DEF_MAX_FONT], query_spec[DEF_MAX_FONT];
   372    char *font_family, *font_size, **font_list;
   373    int font_size_value, font_count, i;
   374
   375    // First attempt to interpret as font family/size
   376    strcpy(name_copy, name);
   377    if((font_size = strchr(name_copy, '-'))) {
   378      *font_size = '\0';
   379      font_family = name_copy;
   380      ++font_size;
   381      font_size_value = atoi(font_size);
   382      if(font_size_value > 0) {
   383        // Still a little iffy -- what about weight and roman vs. 
other
   384        sprintf(query_spec, ISO_FONT, font_family, font_size_value 
* 10);
   385        font_list = XListFonts(gaPtr->PDisplay(), query_spec,
   386                               DEF_MAX_NAMES, &font_count);
   387
   388        // Load first one that you can
   389        for(i = 0; i < font_count; ++i) {
   390          if((*font_info = XLoadQueryFont(gaPtr->PDisplay(), 
font_list[i]))) {
   391            break;
   392          }
   393        }
   394        if(*font_info) {
   395          return 1;
   396        }
   397      }
   398    }
   399    // Assume normal font name
   400    *font_info = XLoadQueryFont(gaPtr->PDisplay(), name);
   401    if((*font_info = XLoadQueryFont(gaPtr->PDisplay(), name)) != 
NULL) {
   402      return 1;
   403    }
   404    return 0;
   405  }

--------------------------

Any ideas?  Is this even the right place to send questions?

-Rob Martin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/



More information about the Cygwin-xfree mailing list