Mercurial > hg > xemacs-beta
comparison src/redisplay-msw.c @ 4476:dbf79a1732ba
Don't try to get text width for the null font instance, mswindows
2008-07-10 Aidan Kehoe <kehoea@parhasard.net>
* redisplay-msw.c (mswindows_text_width_single_run):
Explicitly check for the null font instance, and return zero if
so. Avoids the crash documented in
http://mid.gmane.org/18473.32468.712317.149457@parhasard.net .
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 10 Jul 2008 17:05:59 +0200 |
parents | 2b84dd8eb906 |
children | ea701c23ed84 |
comparison
equal
deleted
inserted
replaced
4475:86283c809984 | 4476:dbf79a1732ba |
---|---|
145 mswindows_text_width_single_run (HDC hdc, struct face_cachel *cachel, | 145 mswindows_text_width_single_run (HDC hdc, struct face_cachel *cachel, |
146 textual_run *run) | 146 textual_run *run) |
147 { | 147 { |
148 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); | 148 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset); |
149 SIZE size; | 149 SIZE size; |
150 | |
151 /* The X11 code doesn't have to do this explicitly, because there we trust | |
152 the font instance to know whether it's actually proportional or not, | |
153 and we use the zero width that is stored in the monospace null font | |
154 instance. */ | |
155 if (EQ (Vthe_null_font_instance, font_inst)) | |
156 { | |
157 return 0; | |
158 } | |
150 | 159 |
151 #if 0 /* #### not the way of ikeyama's ws */ | 160 #if 0 /* #### not the way of ikeyama's ws */ |
152 if (!fi->proportional_p || !hdc) | 161 if (!fi->proportional_p || !hdc) |
153 { | 162 { |
154 if (XCHARSET_DIMENSION (run->charset) == 2) | 163 if (XCHARSET_DIMENSION (run->charset) == 2) |