diff options
| author | Jason Rumney | 2008-02-04 00:52:02 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-02-04 00:52:02 +0000 |
| commit | 5ace1ec11f814367e24076a4e9e50a2ce86ca1ac (patch) | |
| tree | 0bfc0a73635b8bf8afb6a54db910dd2759d83999 | |
| parent | 680d641f2f34232d3bb9a46d1e50c72efde47fca (diff) | |
| download | emacs-5ace1ec11f814367e24076a4e9e50a2ce86ca1ac.tar.gz emacs-5ace1ec11f814367e24076a4e9e50a2ce86ca1ac.zip | |
(w32font_open_internal): Use font_unparse_fcname to set full_name.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/w32font.c | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 30e62212cab..a332e604267 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-02-04 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32font.c (w32font_open_internal): Use font_unparse_fcname to | ||
| 4 | set full_name. | ||
| 5 | |||
| 1 | 2008-02-03 Jason Rumney <jasonr@gnu.org> | 6 | 2008-02-03 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * makefile.w32-in (OBJ1): Include font.o here. | 8 | * makefile.w32-in (OBJ1): Include font.o here. |
diff --git a/src/w32font.c b/src/w32font.c index 619ff7caf98..e2973db0eb6 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -227,8 +227,12 @@ w32font_close (f, font) | |||
| 227 | font->font.font = 0; | 227 | font->font.font = 0; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | if (font->font.full_name && font->font.full_name != font->font.name) | ||
| 231 | xfree (font->font.full_name); | ||
| 232 | |||
| 230 | if (font->font.name) | 233 | if (font->font.name) |
| 231 | xfree (font->font.name); | 234 | xfree (font->font.name); |
| 235 | |||
| 232 | xfree (font); | 236 | xfree (font); |
| 233 | } | 237 | } |
| 234 | 238 | ||
| @@ -678,7 +682,27 @@ w32font_open_internal (f, font_entity, pixel_size, w32_font) | |||
| 678 | font->font.name = (char *) xmalloc (len + 1); | 682 | font->font.name = (char *) xmalloc (len + 1); |
| 679 | bcopy (logfont.lfFaceName, font->font.name, len); | 683 | bcopy (logfont.lfFaceName, font->font.name, len); |
| 680 | font->font.name[len] = '\0'; | 684 | font->font.name[len] = '\0'; |
| 681 | font->font.full_name = font->font.name; | 685 | |
| 686 | { | ||
| 687 | char *name; | ||
| 688 | |||
| 689 | /* We don't know how much space we need for the full name, so start with | ||
| 690 | 96 bytes and go up in steps of 32. */ | ||
| 691 | len = 96; | ||
| 692 | name = malloc (len); | ||
| 693 | while (name && font_unparse_fcname (font_entity, pixel_size, name, len) < 0) | ||
| 694 | { | ||
| 695 | char *new = realloc (name, len += 32); | ||
| 696 | |||
| 697 | if (! new) | ||
| 698 | free (name); | ||
| 699 | name = new; | ||
| 700 | } | ||
| 701 | if (name) | ||
| 702 | font->font.full_name = name; | ||
| 703 | else | ||
| 704 | font->font.full_name = font->font.name; | ||
| 705 | } | ||
| 682 | font->font.charset = 0; | 706 | font->font.charset = 0; |
| 683 | font->font.codepage = 0; | 707 | font->font.codepage = 0; |
| 684 | font->font.size = w32_font->metrics.tmMaxCharWidth; | 708 | font->font.size = w32_font->metrics.tmMaxCharWidth; |