/[qemacs]/qemacs/x11.c
ViewVC logotype

Diff of /qemacs/x11.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by chqrlie, Wed May 11 12:01:32 2005 UTC revision 1.6 by chqrlie, Fri May 13 10:05:24 2005 UTC
# Line 549  static QEFont *term_open_font(QEditScree Line 549  static QEFont *term_open_font(QEditScree
549                               XFT_WEIGHT, XftTypeInteger, weight,                               XFT_WEIGHT, XftTypeInteger, weight,
550                               XFT_SLANT, XftTypeInteger, slant,                               XFT_SLANT, XftTypeInteger, slant,
551                               0);                               0);
552        if (!renderFont) {
553            /* CG: don't know if this can happen, should try fallback? */
554            free(font);
555            return NULL;
556        }
557      font->ascent = renderFont->ascent;      font->ascent = renderFont->ascent;
558      font->descent = renderFont->descent;      font->descent = renderFont->descent;
559      font->private = renderFont;      font->private = renderFont;
# Line 560  static void term_close_font(QEditScreen Line 565  static void term_close_font(QEditScreen
565      XftFont *renderFont = font->private;      XftFont *renderFont = font->private;
566    
567      XftFontClose(display, renderFont);      XftFontClose(display, renderFont);
568        /* Clear structure to force crash if font is still used after
569         * close_font.
570         */
571        memset(font, 0, sizeof(*font));
572      free(font);      free(font);
573  }  }
574    
# Line 761  static void term_close_font(QEditScreen Line 770  static void term_close_font(QEditScreen
770      XFontStruct *xfont = font->private;      XFontStruct *xfont = font->private;
771    
772      XFreeFont(display, xfont);      XFreeFont(display, xfont);
773        /* Clear structure to force crash if font is still used after
774         * close_font.
775         */
776        memset(font, 0, sizeof(*font));
777      free(font);      free(font);
778  }  }
779    
# Line 813  static XCharStruct *get_char_struct(QEFo Line 826  static XCharStruct *get_char_struct(QEFo
826  static XCharStruct *handle_fallback(QEditScreen *s, QEFont **out_font,  static XCharStruct *handle_fallback(QEditScreen *s, QEFont **out_font,
827                                      QEFont *font, unsigned int cc)                                      QEFont *font, unsigned int cc)
828  {  {
829      XFontStruct *xfont = font->private;      XFontStruct *xfont;
830      XCharStruct *cs;      XCharStruct *cs;
831      int fallback_count;      int fallback_count;
832      QEFont *font1;      QEFont *font1;
# Line 831  static XCharStruct *handle_fallback(QEdi Line 844  static XCharStruct *handle_fallback(QEdi
844              *out_font = font1;              *out_font = font1;
845              return cs;              return cs;
846          }          }
847            release_font(s, font1);
848      }      }
849            
850      /* really no glyph : use default char in current font */      /* really no glyph : use default char in current font */
851      xfont = font->private;      xfont = font->private;
852      cs = get_char_struct(font, xfont->default_char);      cs = get_char_struct(font, xfont->default_char);
853      *out_font = font;      *out_font = lock_font(s, font);
854      return cs;      return cs;
855  }  }
856    
# Line 866  static void term_text_metrics(QEditScree Line 880  static void term_text_metrics(QEditScree
880                  metrics->font_ascent = max(metrics->font_ascent, font1->ascent);                  metrics->font_ascent = max(metrics->font_ascent, font1->ascent);
881                  metrics->font_descent = max(metrics->font_descent, font1->descent);                  metrics->font_descent = max(metrics->font_descent, font1->descent);
882              }              }
883                release_font(s, font1);
884          }          }
885      }      }
886      metrics->width = x;      metrics->width = x;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26