diff options
| author | Andrew Choi | 2002-06-16 23:08:57 +0000 |
|---|---|---|
| committer | Andrew Choi | 2002-06-16 23:08:57 +0000 |
| commit | f00691a3e4e5b7997ee7efe6e745d1158a439b21 (patch) | |
| tree | 036f7ab41500e1da9f67cd9399a8589a78052e1d /src/macterm.c | |
| parent | 5fd4d15974c8437440a1b249feab59fb1fea5866 (diff) | |
| download | emacs-f00691a3e4e5b7997ee7efe6e745d1158a439b21.tar.gz emacs-f00691a3e4e5b7997ee7efe6e745d1158a439b21.zip | |
In src/:
2002-06-16 Andrew Choi <akochoi@shaw.ca>
* fontset.c (syms_of_fontset) [MAC_OS]: Set ASCII font of
Vdefault_fontset to Monaco with mac-roman coding.
* mac.c, macfns.c, macmenu.c, macterm.c: Undefine and redefine
init_process before and after inclusion of Carbon/Carbon.h, resp.
* macterm.c (x_new_font): Set font for normal_gc, reverse_gc, and
cursor_gc.
(add_font_name_table_entry): New function.
(init_font_name_table): Use add_font_name_table_entry; add italic,
bold, and bold-italic entries for truetype fonts.
* xfaces.c (init_frame_faces) [MAC_OS]: Call realize_basic_faces
for Mac too.
(try_font_list) [MAC_OS]: If no font matches given registry, try
fonts with any registry matching face_family.
(realize_x_face) [MAC_OS]: Remove old ad-hoc fix to load font
here.
* s/darwin.h: If autoconf detects the Ncurses library, define
LIBS_TERMCAP to -lncurses to use it.
In lisp/:
2002-06-16 Andrew Choi <akochoi@shaw.ca>
* term/mac-win.el (scalable-fonts-allowed): Set to t.
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 70 |
1 files changed, 49 insertions, 21 deletions
diff --git a/src/macterm.c b/src/macterm.c index e25b4dc3b65..d98f24bc4fc 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 44 | precompiled header Carbon.h. */ | 44 | precompiled header Carbon.h. */ |
| 45 | #undef max | 45 | #undef max |
| 46 | #undef min | 46 | #undef min |
| 47 | #undef init_process | ||
| 47 | #include <Carbon/Carbon.h> | 48 | #include <Carbon/Carbon.h> |
| 48 | #undef free | 49 | #undef free |
| 49 | #define free unexec_free | 50 | #define free unexec_free |
| @@ -55,6 +56,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 55 | #define min(a, b) ((a) < (b) ? (a) : (b)) | 56 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
| 56 | #undef max | 57 | #undef max |
| 57 | #define max(a, b) ((a) > (b) ? (a) : (b)) | 58 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
| 59 | #undef init_process | ||
| 60 | #define init_process emacs_init_process | ||
| 58 | #else /* not MAC_OSX */ | 61 | #else /* not MAC_OSX */ |
| 59 | #include <Quickdraw.h> | 62 | #include <Quickdraw.h> |
| 60 | #include <ToolUtils.h> | 63 | #include <ToolUtils.h> |
| @@ -9559,6 +9562,13 @@ x_new_font (f, fontname) | |||
| 9559 | /* Now make the frame display the given font. */ | 9562 | /* Now make the frame display the given font. */ |
| 9560 | if (FRAME_MAC_WINDOW (f) != 0) | 9563 | if (FRAME_MAC_WINDOW (f) != 0) |
| 9561 | { | 9564 | { |
| 9565 | XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->normal_gc, | ||
| 9566 | f->output_data.mac->font); | ||
| 9567 | XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->reverse_gc, | ||
| 9568 | f->output_data.mac->font); | ||
| 9569 | XSetFont (FRAME_MAC_DISPLAY (f), f->output_data.mac->cursor_gc, | ||
| 9570 | f->output_data.mac->font); | ||
| 9571 | |||
| 9562 | frame_update_line_height (f); | 9572 | frame_update_line_height (f); |
| 9563 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) | 9573 | if (NILP (tip_frame) || XFRAME (tip_frame) != f) |
| 9564 | x_set_window_size (f, 0, f->width, f->height); | 9574 | x_set_window_size (f, 0, f->width, f->height); |
| @@ -10651,10 +10661,30 @@ x_font_name_to_mac_font_name (char *xf, char *mf) | |||
| 10651 | } | 10661 | } |
| 10652 | 10662 | ||
| 10653 | 10663 | ||
| 10654 | /* Sets up the table font_name_table to contain the list of all | 10664 | static void |
| 10655 | monospace fonts in the system the first time the table is used so | 10665 | add_font_name_table_entry (char *font_name) |
| 10656 | that the Resource Manager need not be accessed every time this | 10666 | { |
| 10657 | information is needed. */ | 10667 | if (font_name_table_size == 0) |
| 10668 | { | ||
| 10669 | font_name_table_size = 16; | ||
| 10670 | font_name_table = (char **) | ||
| 10671 | xmalloc (font_name_table_size * sizeof (char *)); | ||
| 10672 | } | ||
| 10673 | else if (font_name_count + 1 >= font_name_table_size) | ||
| 10674 | { | ||
| 10675 | font_name_table_size += 16; | ||
| 10676 | font_name_table = (char **) | ||
| 10677 | xrealloc (font_name_table, | ||
| 10678 | font_name_table_size * sizeof (char *)); | ||
| 10679 | } | ||
| 10680 | |||
| 10681 | font_name_table[font_name_count++] = font_name; | ||
| 10682 | } | ||
| 10683 | |||
| 10684 | /* Sets up the table font_name_table to contain the list of all fonts | ||
| 10685 | in the system the first time the table is used so that the Resource | ||
| 10686 | Manager need not be accessed every time this information is | ||
| 10687 | needed. */ | ||
| 10658 | 10688 | ||
| 10659 | static void | 10689 | static void |
| 10660 | init_font_name_table () | 10690 | init_font_name_table () |
| @@ -10700,23 +10730,21 @@ init_font_name_table () | |||
| 10700 | 10730 | ||
| 10701 | while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) | 10731 | while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) |
| 10702 | == noErr) | 10732 | == noErr) |
| 10703 | { | 10733 | if (size == 0) |
| 10704 | if (font_name_table_size == 0) | 10734 | { |
| 10705 | { | 10735 | add_font_name_table_entry (mac_to_x_fontname (name, size, |
| 10706 | font_name_table_size = 16; | 10736 | style, sc)); |
| 10707 | font_name_table = (char **) | 10737 | add_font_name_table_entry (mac_to_x_fontname (name, size, |
| 10708 | xmalloc (font_name_table_size * sizeof (char *)); | 10738 | italic, sc)); |
| 10709 | } | 10739 | add_font_name_table_entry (mac_to_x_fontname (name, size, |
| 10710 | else if (font_name_count + 1 >= font_name_table_size) | 10740 | bold, sc)); |
| 10711 | { | 10741 | add_font_name_table_entry (mac_to_x_fontname (name, size, |
| 10712 | font_name_table_size += 16; | 10742 | italic | bold, |
| 10713 | font_name_table = (char **) | 10743 | sc)); |
| 10714 | xrealloc (font_name_table, | 10744 | } |
| 10715 | font_name_table_size * sizeof (char *)); | 10745 | else |
| 10716 | } | 10746 | add_font_name_table_entry (mac_to_x_fontname (name, size, style, |
| 10717 | font_name_table[font_name_count++] | 10747 | sc)); |
| 10718 | = mac_to_x_fontname (name, size, style, sc); | ||
| 10719 | } | ||
| 10720 | } | 10748 | } |
| 10721 | 10749 | ||
| 10722 | /* Dispose of the iterators. */ | 10750 | /* Dispose of the iterators. */ |