aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorKenichi Handa2012-11-13 23:24:26 +0900
committerKenichi Handa2012-11-13 23:24:26 +0900
commit0cdbf84521791935fdfeabf2e84f585cc64db325 (patch)
tree68a169af3af4a8859685682ab07c05e8f9ff93b3 /src/font.c
parente1bf05c1fbf63087801c242208212df133921ed1 (diff)
parent5745cae6984ed60299a89485aaea8f2f3fb67382 (diff)
downloademacs-0cdbf84521791935fdfeabf2e84f585cc64db325.tar.gz
emacs-0cdbf84521791935fdfeabf2e84f585cc64db325.zip
merge trunk
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/font.c b/src/font.c
index 1ec5929506e..c57ca3ccec4 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4006,16 +4006,11 @@ The optional argument FRAME specifies the frame that the face attributes
4006are to be displayed on. If omitted, the selected frame is used. */) 4006are to be displayed on. If omitted, the selected frame is used. */)
4007 (Lisp_Object font, Lisp_Object frame) 4007 (Lisp_Object font, Lisp_Object frame)
4008{ 4008{
4009 struct frame *f; 4009 struct frame *f = decode_live_frame (frame);
4010 Lisp_Object plist[10]; 4010 Lisp_Object plist[10];
4011 Lisp_Object val; 4011 Lisp_Object val;
4012 int n = 0; 4012 int n = 0;
4013 4013
4014 if (NILP (frame))
4015 frame = selected_frame;
4016 CHECK_LIVE_FRAME (frame);
4017 f = XFRAME (frame);
4018
4019 if (STRINGP (font)) 4014 if (STRINGP (font))
4020 { 4015 {
4021 int fontset = fs_query_fontset (font, 0); 4016 int fontset = fs_query_fontset (font, 0);
@@ -4165,18 +4160,15 @@ how close they are to PREFER. */)
4165 4160
4166DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0, 4161DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0,
4167 doc: /* List available font families on the current frame. 4162 doc: /* List available font families on the current frame.
4168Optional argument FRAME, if non-nil, specifies the target frame. */) 4163If FRAME is omitted or nil, the selected frame is used. */)
4169 (Lisp_Object frame) 4164 (Lisp_Object frame)
4170{ 4165{
4171 FRAME_PTR f; 4166 struct frame *f = decode_live_frame (frame);
4172 struct font_driver_list *driver_list; 4167 struct font_driver_list *driver_list;
4173 Lisp_Object list; 4168 Lisp_Object list = Qnil;
4169
4170 XSETFRAME (frame, f);
4174 4171
4175 if (NILP (frame))
4176 frame = selected_frame;
4177 CHECK_LIVE_FRAME (frame);
4178 f = XFRAME (frame);
4179 list = Qnil;
4180 for (driver_list = f->font_driver_list; driver_list; 4172 for (driver_list = f->font_driver_list; driver_list;
4181 driver_list = driver_list->next) 4173 driver_list = driver_list->next)
4182 if (driver_list->driver->list_family) 4174 if (driver_list->driver->list_family)
@@ -4544,11 +4536,9 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
4544 (Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame) 4536 (Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame)
4545{ 4537{
4546 EMACS_INT isize; 4538 EMACS_INT isize;
4539 struct frame *f = decode_live_frame (frame);
4547 4540
4548 CHECK_FONT_ENTITY (font_entity); 4541 CHECK_FONT_ENTITY (font_entity);
4549 if (NILP (frame))
4550 frame = selected_frame;
4551 CHECK_LIVE_FRAME (frame);
4552 4542
4553 if (NILP (size)) 4543 if (NILP (size))
4554 isize = XINT (AREF (font_entity, FONT_SIZE_INDEX)); 4544 isize = XINT (AREF (font_entity, FONT_SIZE_INDEX));
@@ -4556,7 +4546,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
4556 { 4546 {
4557 CHECK_NUMBER_OR_FLOAT (size); 4547 CHECK_NUMBER_OR_FLOAT (size);
4558 if (FLOATP (size)) 4548 if (FLOATP (size))
4559 isize = POINT_TO_PIXEL (XFLOAT_DATA (size), XFRAME (frame)->resy); 4549 isize = POINT_TO_PIXEL (XFLOAT_DATA (size), f->resy);
4560 else 4550 else
4561 isize = XINT (size); 4551 isize = XINT (size);
4562 if (! (INT_MIN <= isize && isize <= INT_MAX)) 4552 if (! (INT_MIN <= isize && isize <= INT_MAX))
@@ -4564,7 +4554,7 @@ DEFUN ("open-font", Fopen_font, Sopen_font, 1, 3, 0,
4564 if (isize == 0) 4554 if (isize == 0)
4565 isize = 120; 4555 isize = 120;
4566 } 4556 }
4567 return font_open_entity (XFRAME (frame), font_entity, isize); 4557 return font_open_entity (f, font_entity, isize);
4568} 4558}
4569 4559
4570DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0, 4560DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0,
@@ -4572,10 +4562,7 @@ DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0,
4572 (Lisp_Object font_object, Lisp_Object frame) 4562 (Lisp_Object font_object, Lisp_Object frame)
4573{ 4563{
4574 CHECK_FONT_OBJECT (font_object); 4564 CHECK_FONT_OBJECT (font_object);
4575 if (NILP (frame)) 4565 font_close_object (decode_live_frame (frame), font_object);
4576 frame = selected_frame;
4577 CHECK_LIVE_FRAME (frame);
4578 font_close_object (XFRAME (frame), font_object);
4579 return Qnil; 4566 return Qnil;
4580} 4567}
4581 4568
@@ -4860,7 +4847,7 @@ where
4860If the named font is not yet loaded, return nil. */) 4847If the named font is not yet loaded, return nil. */)
4861 (Lisp_Object name, Lisp_Object frame) 4848 (Lisp_Object name, Lisp_Object frame)
4862{ 4849{
4863 FRAME_PTR f; 4850 struct frame *f;
4864 struct font *font; 4851 struct font *font;
4865 Lisp_Object info; 4852 Lisp_Object info;
4866 Lisp_Object font_object; 4853 Lisp_Object font_object;
@@ -4869,10 +4856,7 @@ If the named font is not yet loaded, return nil. */)
4869 4856
4870 if (! FONTP (name)) 4857 if (! FONTP (name))
4871 CHECK_STRING (name); 4858 CHECK_STRING (name);
4872 if (NILP (frame)) 4859 f = decode_live_frame (frame);
4873 frame = selected_frame;
4874 CHECK_LIVE_FRAME (frame);
4875 f = XFRAME (frame);
4876 4860
4877 if (STRINGP (name)) 4861 if (STRINGP (name))
4878 { 4862 {