mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-31 17:30:54 -08:00
*** empty log message ***
This commit is contained in:
parent
db9b8a15c6
commit
859a9fdfc4
2 changed files with 20 additions and 0 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2007-12-19 Jason Rumney <jasonr@gnu.org>
|
||||
|
||||
* w32font.c (w32font_text_extents): Don't use the frame stored in the
|
||||
font, as it may have been deleted.
|
||||
|
||||
* w32font.h (w32font_get_cache): Update declaration.
|
||||
|
||||
2007-12-18 Kenichi Handa <handa@ni.aist.go.jp>
|
||||
|
|
|
|||
|
|
@ -203,6 +203,8 @@ w32font_open (f, font_entity, pixel_size)
|
|||
if (w32_font == NULL)
|
||||
return NULL;
|
||||
|
||||
safe_debug_print (font_entity);
|
||||
|
||||
if (!w32font_open_internal (f, font_entity, pixel_size, w32_font))
|
||||
{
|
||||
xfree (w32_font);
|
||||
|
|
@ -293,7 +295,14 @@ w32font_text_extents (font, code, nglyphs, metrics)
|
|||
WORD *wcode = alloca(nglyphs * sizeof (WORD));
|
||||
SIZE size;
|
||||
|
||||
#if 0
|
||||
/* Frames can come and go, and their fonts outlive them. This is
|
||||
particularly troublesome with tooltip frames, and causes crashes. */
|
||||
f = ((struct w32font_info *)font)->owning_frame;
|
||||
#else
|
||||
f = selected_frame;
|
||||
#endif
|
||||
|
||||
dc = get_frame_dc (f);
|
||||
old_font = SelectObject (dc, ((W32FontStruct *)(font->font.font))->hfont);
|
||||
|
||||
|
|
@ -601,6 +610,10 @@ w32font_match_internal (frame, font_spec, opentype_only)
|
|||
bzero (&match_data.pattern, sizeof (LOGFONT));
|
||||
fill_in_logfont (f, &match_data.pattern, font_spec);
|
||||
|
||||
/* If weight was not specified, try to get a normal weight font. */
|
||||
if (!match_data.pattern.lfWeight)
|
||||
match_data.pattern.lfWeight = FW_NORMAL;
|
||||
|
||||
match_data.opentype_only = opentype_only;
|
||||
if (opentype_only)
|
||||
match_data.pattern.lfOutPrecision = OUT_OUTLINE_PRECIS;
|
||||
|
|
@ -637,6 +650,10 @@ w32font_open_internal (f, font_entity, pixel_size, w32_font)
|
|||
bzero (&logfont, sizeof (logfont));
|
||||
fill_in_logfont (f, &logfont, font_entity);
|
||||
|
||||
/* If weight was not specified, try to get a normal weight font. */
|
||||
if (!logfont.lfWeight)
|
||||
logfont.lfWeight = FW_NORMAL;
|
||||
|
||||
size = XINT (AREF (font_entity, FONT_SIZE_INDEX));
|
||||
if (!size)
|
||||
size = pixel_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue