/* Font back-end driver for the NeXT/Open/GNUstep and MacOSX window system.
See font.h
- Copyright (C) 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#define NSFONT_TRACE 0
extern Lisp_Object Qns;
-extern Lisp_Object Qnormal, Qbold, Qitalic, Qcondensed, Qexpanded;
+extern Lisp_Object Qnormal, Qbold, Qitalic;
static Lisp_Object Qapple, Qroman, Qmedium;
+static Lisp_Object Qcondensed, Qexpanded;
extern Lisp_Object Qappend;
extern float ns_antialias_threshold;
extern int ns_tmp_flags;
make_number (100 + 100
* ns_attribute_fvalue (desc, NSFontSlantTrait)));*/
FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
- traits & NSFontCondensedTrait ? Qcondensed :
- traits & NSFontExpandedTrait ? Qexpanded : Qnormal);
+ traits & NSFontCondensedTrait ? Qcondensed :
+ traits & NSFontExpandedTrait ? Qexpanded : Qnormal);
/* FONT_SET_STYLE (font_entity, FONT_WIDTH_INDEX,
make_number (100 + 100
* ns_attribute_fvalue (desc, NSFontWidthTrait)));*/
if (isMatch)
[fkeys removeObject: NSFontFamilyAttribute];
- matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
+ if ([fkeys count] > 0)
+ matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys];
+ else
+ matchingDescs = [NSMutableArray array];
+
if (NSFONT_TRACE)
NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc,
[matchingDescs count]);
block_input ();
/* for metrics */
+#ifdef NS_IMPL_COCOA
+ sfont = [nsfont screenFontWithRenderingMode:
+ NSFontAntialiasedIntegerAdvancementsRenderingMode];
+#else
sfont = [nsfont screenFont];
+#endif
+
if (sfont == nil)
sfont = nsfont;
else
CGContextSetShouldAntialias (gcontext, 1);
+ CGContextSetShouldSmoothFonts (gcontext, NO);
CGContextSetTextMatrix (gcontext, fliptf);
if (bgCol != nil)
#endif
block_input ();
- sfont = [font_info->nsfont screenFont];
+#ifdef NS_IMPL_COCOA
+ sfont = [font_info->nsfont screenFontWithRenderingMode:
+ NSFontAntialiasedIntegerAdvancementsRenderingMode];
+#else
+ sfont = [font_info->nsfont screenFont];
+#endif
font_info->metrics[block] = xzalloc (0x100 * sizeof (struct font_metrics));
if (!(font_info->metrics[block]))
{
nsfont_driver.type = Qns;
register_font_driver (&nsfont_driver, NULL);
+ DEFSYM (Qcondensed, "condensed");
+ DEFSYM (Qexpanded, "expanded");
DEFSYM (Qapple, "apple");
DEFSYM (Qroman, "roman");
DEFSYM (Qmedium, "medium");