+2008-09-29 Adrian Robert <Adrian.B.Robert@gmail.com>
+
+ * nsfont.m (nsfont_trait_distance): Fix bug.
+ (nsfont_list): Return a list rather than a vector (syncs with Handa
+ changes of 2008-05-14).
+ (nsfont_open): Improve logging.
+
2008-09-29 Andreas Schwab <schwab@suse.de>
* keyboard.c (syms_of_keyboard) <input-decode-map>: Doc fix.
{
fprintf (stderr, "created font_entity:\n ");
debug_print (font_entity);
- }
+ }
[suffix release];
free (escapedFamily);
static int
nsfont_trait_distance (unsigned int traits1, unsigned int traits2)
{
- int i, d =0;
- for (i =0; i<sizeof (unsigned int)*8; i++)
+ int i, d = 0;
+ for (i = 0; i < sizeof (unsigned int) * 8; i++)
{
d += (traits1 & 0x1) ^ (traits2 & 0x1);
- traits1 >> 1;
- traits2 >> 1;
+ traits1 >>= 1;
+ traits2 >>= 1;
}
return d;
}
/* List fonts exactly matching with FONT_SPEC on FRAME. The value
- is a vector of font-entities. This is the sole API that
+ is a **list** of font-entities. This is the sole API that
allocates font-entities. */
static Lisp_Object
nsfont_list (Lisp_Object frame, Lisp_Object font_spec)
if (NSFONT_TRACE)
fprintf (stderr, " Returning %d entities.\n", XINT (Flength (list)));
- return (NILP (list) ? Qnil : Fvconcat (1, &list));/* Qnil was null_vector */
+ return list;
}
family = nsfont_get_family (font_entity);
if (NSFONT_TRACE)
{
- fprintf (stderr, "family: '%s'\ttraits = %ld\tbold = %d\n",
- [family UTF8String], traits, traits & NSBoldFontMask);
+ fprintf (stderr, "family: '%s'\ttraits = %ld\tbold = %d\titalic = %d\n",
+ [family UTF8String], traits, traits & NSBoldFontMask,
+ traits & NSItalicFontMask);
}
/* see http://cocoadev.com/forums/comments.php?DiscussionID =74 */
}
}
+//NSLog(@"%@\n",nsfont);
+
#if 0
{
NSNumber *cached = [fontCache objectForKey: nsfont];