Mercurial > emacs
comparison src/font.c @ 96831:47bb47a5494d
restore ability under NS to change font size from font panel (lost during some recent font backend refactoring)
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Sun, 20 Jul 2008 00:47:28 +0000 |
parents | d45acf0c8d23 |
children | 9592c50233ab |
comparison
equal
deleted
inserted
replaced
96830:a8aac59d9c7a | 96831:47bb47a5494d |
---|---|
53 #ifdef MAC_OS | 53 #ifdef MAC_OS |
54 #include "macterm.h" | 54 #include "macterm.h" |
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 |
61 /* Important character set strings. */ | 65 /* Important character set strings. */ |
62 Lisp_Object Qascii_0, Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip; | 66 Lisp_Object Qascii_0, Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip; |
3314 { | 3318 { |
3315 double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); | 3319 double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); |
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 } |
3322 | 3333 |
3323 | 3334 |
3388 /* We set up the default font-related attributes of a face to prefer | 3399 /* We set up the default font-related attributes of a face to prefer |
3389 a moderate font. */ | 3400 a moderate font. */ |
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); |
3397 } | 3412 } |
3398 | 3413 |