diff options
| author | Dmitry Antipov | 2014-07-08 18:50:45 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-08 18:50:45 +0400 |
| commit | 96f17a2f73d1a29c7cdc279daa1fb7f1b7f58aff (patch) | |
| tree | eff4991614caccccefdc7d9b10f795728070159e /src/macfont.m | |
| parent | d64a4984c147d0c4550aa1e9e3b9a5db10b3de6a (diff) | |
| download | emacs-96f17a2f73d1a29c7cdc279daa1fb7f1b7f58aff.tar.gz emacs-96f17a2f73d1a29c7cdc279daa1fb7f1b7f58aff.zip | |
* font.c (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]:
New function, with an intention to avoid code duplication between
a few font drivers.
* font.h (font_build_object) [HAVE_XFT || HAVE_FREETYPE || HAVE_NS]:
Add prototype.
* ftfont.c (ftfont_open):
* macfont.m (macfont_open):
* xftfont.c (xftfont_open): Use it.
Diffstat (limited to 'src/macfont.m')
| -rw-r--r-- | src/macfont.m | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/macfont.m b/src/macfont.m index 82ee54cdc63..60f261d5549 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -2444,8 +2444,7 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size) | |||
| 2444 | int size; | 2444 | int size; |
| 2445 | FontRef macfont; | 2445 | FontRef macfont; |
| 2446 | FontSymbolicTraits sym_traits; | 2446 | FontSymbolicTraits sym_traits; |
| 2447 | char name[256]; | 2447 | int i, total_width; |
| 2448 | int len, i, total_width; | ||
| 2449 | CGGlyph glyph; | 2448 | CGGlyph glyph; |
| 2450 | CGFloat ascent, descent, leading; | 2449 | CGFloat ascent, descent, leading; |
| 2451 | 2450 | ||
| @@ -2472,17 +2471,8 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size) | |||
| 2472 | if (! macfont) | 2471 | if (! macfont) |
| 2473 | return Qnil; | 2472 | return Qnil; |
| 2474 | 2473 | ||
| 2475 | font_object = font_make_object (VECSIZE (struct macfont_info), entity, size); | 2474 | font_object = font_build_object (VECSIZE (struct macfont_info), |
| 2476 | ASET (font_object, FONT_TYPE_INDEX, macfont_driver.type); | 2475 | Qmac_ct, entity, size); |
| 2477 | len = font_unparse_xlfd (entity, size, name, 256); | ||
| 2478 | if (len > 0) | ||
| 2479 | ASET (font_object, FONT_NAME_INDEX, make_string (name, len)); | ||
| 2480 | len = font_unparse_fcname (entity, size, name, 256); | ||
| 2481 | if (len > 0) | ||
| 2482 | ASET (font_object, FONT_FULLNAME_INDEX, make_string (name, len)); | ||
| 2483 | else | ||
| 2484 | ASET (font_object, FONT_FULLNAME_INDEX, | ||
| 2485 | AREF (font_object, FONT_NAME_INDEX)); | ||
| 2486 | font = XFONT_OBJECT (font_object); | 2476 | font = XFONT_OBJECT (font_object); |
| 2487 | font->pixel_size = size; | 2477 | font->pixel_size = size; |
| 2488 | font->driver = &macfont_driver; | 2478 | font->driver = &macfont_driver; |