From: Adrian Robert Date: Tue, 30 Sep 2008 01:03:00 +0000 (+0000) Subject: * nsfont.m (nsfont_trait_distance): Fix bug. (nsfont_list): Return a list rather... X-Git-Tag: emacs-pretest-23.0.90~2724 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bc98b35df8565aac8a1008ea233db339faab89c;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 19a6f91070c..d9d8b73dcb0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-09-29 Adrian Robert + + * 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 * keyboard.c (syms_of_keyboard) : Doc fix. diff --git a/src/nsfont.m b/src/nsfont.m index 8761e57ca6e..813b04be662 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -178,7 +178,7 @@ nsfont_fmember_to_entity (NSString *family, NSArray *famMember) { fprintf (stderr, "created font_entity:\n "); debug_print (font_entity); - } + } [suffix release]; free (escapedFamily); @@ -190,12 +190,12 @@ nsfont_fmember_to_entity (NSString *family, NSArray *famMember) static int nsfont_trait_distance (unsigned int traits1, unsigned int traits2) { - int i, d =0; - for (i =0; i> 1; - traits2 >> 1; + traits1 >>= 1; + traits2 >>= 1; } return d; } @@ -267,7 +267,7 @@ nsfont_get_cache (FRAME_PTR frame) /* 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) @@ -349,7 +349,7 @@ 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; } @@ -540,8 +540,9 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) 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 */ @@ -576,6 +577,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) } } +//NSLog(@"%@\n",nsfont); + #if 0 { NSNumber *cached = [fontCache objectForKey: nsfont];