aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2003-01-07 01:26:33 +0000
committerKenichi Handa2003-01-07 01:26:33 +0000
commit2570e34465cefacf043cbd323cbd0603cd938636 (patch)
tree939f277749b338b8df5ed31486d360acde46b562
parent07ad7d434e6b03d442d2fa18035b4c6f04a4b822 (diff)
downloademacs-2570e34465cefacf043cbd323cbd0603cd938636.tar.gz
emacs-2570e34465cefacf043cbd323cbd0603cd938636.zip
(x_new_font): Optimize for the case that the font is
already set for the frame.
-rw-r--r--src/xterm.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 986d48353bd..893a09db885 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12258,6 +12258,11 @@ x_new_font (f, fontname)
12258 if (!fontp) 12258 if (!fontp)
12259 return Qnil; 12259 return Qnil;
12260 12260
12261 if (f->output_data.x->font == (XFontStruct *) (fontp->font))
12262 /* This font is already set in frame F. There's nothing more to
12263 do. */
12264 return build_string (fontp->full_name);
12265
12261 f->output_data.x->font = (XFontStruct *) (fontp->font); 12266 f->output_data.x->font = (XFontStruct *) (fontp->font);
12262 f->output_data.x->baseline_offset = fontp->baseline_offset; 12267 f->output_data.x->baseline_offset = fontp->baseline_offset;
12263 f->output_data.x->fontset = -1; 12268 f->output_data.x->fontset = -1;
@@ -12302,13 +12307,16 @@ x_new_font (f, fontname)
12302 return build_string (fontp->full_name); 12307 return build_string (fontp->full_name);
12303} 12308}
12304 12309
12305/* Give frame F the fontset named FONTSETNAME as its default font, and 12310/* Give frame F the fontset named FONTSETNAME as its default fontset,
12306 return the full name of that fontset. FONTSETNAME may be a wildcard 12311 and return the full name of that fontset. FONTSETNAME may be a
12307 pattern; in that case, we choose some fontset that fits the pattern. 12312 wildcard pattern; in that case, we choose some fontset that fits
12313 the pattern. FONTSETNAME may be a font name for ASCII characters;
12314 in that case, we create a fontset from that font name.
12315
12308 The return value shows which fontset we chose. 12316 The return value shows which fontset we chose.
12309 If FONTSETNAME specifies the default fontset, return Qt. 12317 If FONTSETNAME specifies the default fontset, return Qt.
12310 If an ASCII font specified in the specified fontset can't be 12318 If an ASCII font in the specified fontset can't be loaded, return
12311 loaded, return Qnil. */ 12319 Qnil. */
12312 12320
12313Lisp_Object 12321Lisp_Object
12314x_new_fontset (f, fontsetname) 12322x_new_fontset (f, fontsetname)