/[emacs]/emacs/src/xterm.c
ViewVC logotype

Diff of /emacs/src/xterm.c

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

revision 1.853 by jhd, Wed Dec 15 21:34:14 2004 UTC revision 1.854 by handa, Thu Dec 30 12:26:31 2004 UTC
# Line 7838  x_new_font (f, fontname) Line 7838  x_new_font (f, fontname)
7838    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;    FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
7839    FRAME_FONTSET (f) = -1;    FRAME_FONTSET (f) = -1;
7840    
7841    FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f));    FRAME_COLUMN_WIDTH (f) = fontp->average_width;
7842      FRAME_SPACE_WIDTH (f) = fontp->space_width;
7843    FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));    FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
7844    
7845    compute_fringe_widths (f, 1);    compute_fringe_widths (f, 1);
# Line 9782  x_load_font (f, fontname, size) Line 9783  x_load_font (f, fontname, size)
9783      fontp->name = (char *) xmalloc (strlen (fontname) + 1);      fontp->name = (char *) xmalloc (strlen (fontname) + 1);
9784      bcopy (fontname, fontp->name, strlen (fontname) + 1);      bcopy (fontname, fontp->name, strlen (fontname) + 1);
9785    
9786        if (font->min_bounds.width == font->max_bounds.width)
9787          {
9788            /* Fixed width font.  */
9789            fontp->average_width = fontp->space_width = font->min_bounds.width;
9790          }
9791        else
9792          {
9793            XChar2b char2b;
9794            XCharStruct *pcm;
9795    
9796            char2b.byte1 = 0x00, char2b.byte2 = 0x20;
9797            pcm = x_per_char_metric (font, &char2b, 0);
9798            if (pcm)
9799              fontp->space_width = pcm->width;
9800            else
9801              fontp->space_width = FONT_WIDTH (font);
9802    
9803            fontp->average_width
9804              = (XGetFontProperty (font, dpyinfo->Xatom_AVERAGE_WIDTH, &value)
9805                 ? (long) value / 10 : 0);
9806            if (fontp->average_width < 0)
9807              fontp->average_width = - fontp->average_width;
9808            if (fontp->average_width == 0)
9809              {
9810                if (pcm)
9811                  {
9812                    int width = pcm->width;
9813                    for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
9814                      if ((pcm = x_per_char_metric (font, &char2b, 0)) != NULL)
9815                        width += pcm->width;
9816                    fontp->average_width = width / 95;
9817                  }
9818                else
9819                  fontp->average_width = FONT_WIDTH (font);
9820              }
9821          }
9822    
9823      /* Try to get the full name of FONT.  Put it in FULL_NAME.  */      /* Try to get the full name of FONT.  Put it in FULL_NAME.  */
9824      full_name = 0;      full_name = 0;
9825      if (XGetFontProperty (font, XA_FONT, &value))      if (XGetFontProperty (font, XA_FONT, &value))
# Line 10409  x_term_init (display_name, xrm_option, r Line 10447  x_term_init (display_name, xrm_option, r
10447    /* For properties of font.  */    /* For properties of font.  */
10448    dpyinfo->Xatom_PIXEL_SIZE    dpyinfo->Xatom_PIXEL_SIZE
10449      = XInternAtom (dpyinfo->display, "PIXEL_SIZE", False);      = XInternAtom (dpyinfo->display, "PIXEL_SIZE", False);
10450      dpyinfo->Xatom_AVERAGE_WIDTH
10451        = XInternAtom (dpyinfo->display, "AVERAGE_WIDTH", False);
10452    dpyinfo->Xatom_MULE_BASELINE_OFFSET    dpyinfo->Xatom_MULE_BASELINE_OFFSET
10453      = XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False);      = XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False);
10454    dpyinfo->Xatom_MULE_RELATIVE_COMPOSE    dpyinfo->Xatom_MULE_RELATIVE_COMPOSE

Legend:
Removed from v.1.853  
changed lines
  Added in v.1.854

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