]> code.delx.au - gnu-emacs/blobdiff - src/nsfont.m
remove_slash_colon need not be inline
[gnu-emacs] / src / nsfont.m
index 98c25fcdedd07191457778a05f357db3df1f04ce..f5e89d32bfc9c0ca21065fefc3cdba26609d5dd1 100644 (file)
@@ -1,6 +1,6 @@
 /* Font back-end driver for the NeXT/Open/GNUstep and MacOSX window system.
    See font.h
-   Copyright (C) 2006-2014 Free Software Foundation, Inc.
+   Copyright (C) 2006-2015 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -45,11 +45,6 @@ Author: Adrian Robert (arobert@cogsci.ucsd.edu)
 #define NSFONT_TRACE 0
 #define LCD_SMOOTHING_MARGIN 2
 
-extern Lisp_Object Qns;
-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;
 
 
@@ -627,8 +622,8 @@ static Lisp_Object nsfont_open (struct frame *f, Lisp_Object font_entity,
 static void nsfont_close (struct font *font);
 static int nsfont_has_char (Lisp_Object entity, int c);
 static unsigned int nsfont_encode_char (struct font *font, int c);
-static int nsfont_text_extents (struct font *font, unsigned int *code,
-                                int nglyphs, struct font_metrics *metrics);
+static void nsfont_text_extents (struct font *font, unsigned int *code,
+                                int nglyphs, struct font_metrics *metrics);
 static int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
                         bool with_background);
 
@@ -988,9 +983,9 @@ nsfont_encode_char (struct font *font, int c)
 /* Perform the size computation of glyphs of FONT and fill in members
    of METRICS.  The glyphs are specified by their glyph codes in
    CODE (length NGLYPHS). */
-static int
-nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs,
-                     struct font_metrics *metrics)
+static void
+nsfont_text_extents (struct font *font, unsigned int *code,
+                    int nglyphs, struct font_metrics *metrics)
 {
   struct nsfont_info *font_info = (struct nsfont_info *)font;
   struct font_metrics *pcm;
@@ -1000,7 +995,7 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs,
 
   memset (metrics, 0, sizeof (struct font_metrics));
 
-  for (i =0; i<nglyphs; i++)
+  for (i = 0; i < nglyphs; i++)
     {
       /* get metrics for this glyph, filling cache if need be */
       /* TODO: get metrics for whole string from an NSLayoutManager
@@ -1024,8 +1019,6 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs,
     }
 
   metrics->width = totalWidth;
-
-  return totalWidth; /* not specified in doc, but xfont.c does it */
 }
 
 
@@ -1041,8 +1034,13 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
   static unsigned char cbuf[1024];
   unsigned char *c = cbuf;
 #ifdef NS_IMPL_GNUSTEP
+#if GNUSTEP_GUI_MAJOR_VERSION > 0 || GNUSTEP_GUI_MINOR_VERSION > 22
+  static CGFloat advances[1024];
+  CGFloat *adv = advances;
+#else
   static float advances[1024];
   float *adv = advances;
+#endif
 #else
   static CGSize advances[1024];
   CGSize *adv = advances;
@@ -1490,7 +1488,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
         characterIndex: (NSUInteger)charIndex
 {
   len = glyphIndex+length;
-  for (i =glyphIndex; i<len; i++) 
+  for (i =glyphIndex; i<len; i++)
     cglyphs[i] = glyphs[i-glyphIndex];
   if (len > maxGlyph)
     maxGlyph = len;