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); |
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)) |
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 |