diff options
| author | Adrian Robert | 2008-07-20 00:47:28 +0000 |
|---|---|---|
| committer | Adrian Robert | 2008-07-20 00:47:28 +0000 |
| commit | ed96cde8e90c813ca6714b92bb5a0a6dc5eff27d (patch) | |
| tree | 529d474ca33020d3fa11d139dca72bcd6686a086 /src | |
| parent | d5e4dda5f6fbc60eb57727d3b93fb0ef6f74868e (diff) | |
| download | emacs-ed96cde8e90c813ca6714b92bb5a0a6dc5eff27d.tar.gz emacs-ed96cde8e90c813ca6714b92bb5a0a6dc5eff27d.zip | |
restore ability under NS to change font size from font panel (lost during some recent font backend refactoring)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/font.c | 15 | ||||
| -rw-r--r-- | src/frame.c | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 6 |
4 files changed, 33 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dd015342bc9..b1f1d027ef8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,22 @@ | |||
| 1 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> | 1 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> |
| 2 | 2 | ||
| 3 | * font.c (font_open_by_name): Under NS, default lface height to zero. | ||
| 4 | (font_open_for_lface): Under NS, set size based on frame fontsize. | ||
| 5 | * nsterm.m (EmacsView-changeFont:): Remove some commented code. | ||
| 6 | * frame.c (x_set_frame_parameters): Remove HAVE_NS ifdef. | ||
| 7 | |||
| 8 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 9 | |||
| 10 | * nsterm.m (ns_antialias_text, ns_use_qd_smoothing) | ||
| 11 | (ns_use_system_highlight_color): Switch these from DEFVAR_BOOL to | ||
| 12 | DEFVAR_LISP and change all code accordingly to use Qt/Qnil instead of | ||
| 13 | YES/NO. | ||
| 14 | * nsterm.h (prevUseHighlightColor): Make a Lisp_Object. | ||
| 15 | * nsfont.m (nsfont_draw): Treat ns_use_qd_smoothing as Lisp_Object. | ||
| 16 | * Makefile.in (clean): Clear out build destination dir. | ||
| 17 | |||
| 18 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 19 | |||
| 3 | * Makefile.in (nsgui.h-related dependencies): Remove abbrev, xfns, | 20 | * Makefile.in (nsgui.h-related dependencies): Remove abbrev, xfns, |
| 4 | xterm, xselect. | 21 | xterm, xselect. |
| 5 | * lisp.h: Remove declaration of hash_remove. | 22 | * lisp.h: Remove declaration of hash_remove. |
diff --git a/src/font.c b/src/font.c index 26adda26e47..9ceedddb297 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -55,6 +55,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 55 | #endif /* MAC_OS */ | 55 | #endif /* MAC_OS */ |
| 56 | 56 | ||
| 57 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | 57 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; |
| 58 | |||
| 59 | #ifdef HAVE_NS | ||
| 60 | extern Lisp_Object Qfontsize; | ||
| 61 | #endif | ||
| 58 | 62 | ||
| 59 | Lisp_Object Qopentype; | 63 | Lisp_Object Qopentype; |
| 60 | 64 | ||
| @@ -3316,6 +3320,13 @@ font_open_for_lface (f, entity, attrs, spec) | |||
| 3316 | 3320 | ||
| 3317 | pt /= 10; | 3321 | pt /= 10; |
| 3318 | size = POINT_TO_PIXEL (pt, f->resy); | 3322 | size = POINT_TO_PIXEL (pt, f->resy); |
| 3323 | #ifdef HAVE_NS | ||
| 3324 | if (size == 0) | ||
| 3325 | { | ||
| 3326 | Lisp_Object ffsize = get_frame_param(f, Qfontsize); | ||
| 3327 | size = NUMBERP (ffsize) ? POINT_TO_PIXEL (XINT (ffsize), f->resy) : 0; | ||
| 3328 | } | ||
| 3329 | #endif | ||
| 3319 | } | 3330 | } |
| 3320 | return font_open_entity (f, entity, size); | 3331 | return font_open_entity (f, entity, size); |
| 3321 | } | 3332 | } |
| @@ -3390,7 +3401,11 @@ font_open_by_name (f, name) | |||
| 3390 | attrs[LFACE_FAMILY_INDEX] = attrs[LFACE_FOUNDRY_INDEX] = Qnil; | 3401 | attrs[LFACE_FAMILY_INDEX] = attrs[LFACE_FOUNDRY_INDEX] = Qnil; |
| 3391 | attrs[LFACE_SWIDTH_INDEX] = attrs[LFACE_WEIGHT_INDEX] | 3402 | attrs[LFACE_SWIDTH_INDEX] = attrs[LFACE_WEIGHT_INDEX] |
| 3392 | = attrs[LFACE_SLANT_INDEX] = Qnormal; | 3403 | = attrs[LFACE_SLANT_INDEX] = Qnormal; |
| 3404 | #ifndef HAVE_NS | ||
| 3393 | attrs[LFACE_HEIGHT_INDEX] = make_number (120); | 3405 | attrs[LFACE_HEIGHT_INDEX] = make_number (120); |
| 3406 | #else | ||
| 3407 | attrs[LFACE_HEIGHT_INDEX] = make_number (0); | ||
| 3408 | #endif | ||
| 3394 | attrs[LFACE_FONT_INDEX] = Qnil; | 3409 | attrs[LFACE_FONT_INDEX] = Qnil; |
| 3395 | 3410 | ||
| 3396 | return font_load_for_lface (f, attrs, spec); | 3411 | return font_load_for_lface (f, attrs, spec); |
diff --git a/src/frame.c b/src/frame.c index 21b16154662..989341eb48a 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2986,9 +2986,7 @@ x_set_frame_parameters (f, alist) | |||
| 2986 | 2986 | ||
| 2987 | old_value = get_frame_param (f, prop); | 2987 | old_value = get_frame_param (f, prop); |
| 2988 | fullscreen_is_being_set |= EQ (prop, Qfullscreen); | 2988 | fullscreen_is_being_set |= EQ (prop, Qfullscreen); |
| 2989 | #ifndef HAVE_NS /* XXX: ensure font attrs change goes through */ | ||
| 2990 | if (NILP (Fequal (val, old_value))) | 2989 | if (NILP (Fequal (val, old_value))) |
| 2991 | #endif | ||
| 2992 | { | 2990 | { |
| 2993 | store_frame_param (f, prop, val); | 2991 | store_frame_param (f, prop, val); |
| 2994 | 2992 | ||
diff --git a/src/nsterm.m b/src/nsterm.m index 3d8ff3129f8..a1aeb74bd84 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4441,11 +4441,7 @@ extern void update_window_cursor (struct window *w, int on); | |||
| 4441 | emacs_event->code = KEY_NS_CHANGE_FONT; | 4441 | emacs_event->code = KEY_NS_CHANGE_FONT; |
| 4442 | 4442 | ||
| 4443 | size = [newFont pointSize]; | 4443 | size = [newFont pointSize]; |
| 4444 | /* PENDING: stick w/integer sizes for now. */ | 4444 | ns_input_fontsize = make_number (lrint (size)); |
| 4445 | /* if (size == lrint (size)) */ | ||
| 4446 | ns_input_fontsize = make_number (lrint (size)); | ||
| 4447 | /* else | ||
| 4448 | ns_input_fontsize = make_float (size); */ | ||
| 4449 | ns_input_font = build_string ([[newFont familyName] UTF8String]); | 4445 | ns_input_font = build_string ([[newFont familyName] UTF8String]); |
| 4450 | EV_TRAILER (e); | 4446 | EV_TRAILER (e); |
| 4451 | } | 4447 | } |