X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/fabc1281e9cde34ff9a19d843316d2ceca8647ad..6b49792308dd84fdea8ae8daff5abdad0c978509:/src/nsfont.m diff --git a/src/nsfont.m b/src/nsfont.m index 412a6777c6..b13c96aa6e 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -23,7 +23,6 @@ Author: Adrian Robert (arobert@cogsci.ucsd.edu) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" @@ -625,7 +624,7 @@ 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 int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, - int with_background); + bool with_background); struct font_driver nsfont_driver = { @@ -822,7 +821,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) font_info->glyphs = xzalloc (0x100 * sizeof *font_info->glyphs); font_info->metrics = xzalloc (0x100 * sizeof *font_info->metrics); - BLOCK_INPUT; + block_input (); /* for metrics */ sfont = [nsfont screenFont]; @@ -833,7 +832,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) font = (struct font *) font_info; font->pixel_size = [sfont pointSize]; font->driver = &nsfont_driver; - font->encoding_type = FONT_ENCODING_NOT_DECIDED; font->encoding_charset = -1; font->repertory_charset = -1; font->default_ascent = 0; @@ -934,7 +932,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) font->props[FONT_FULLNAME_INDEX] = make_unibyte_string (font_info->name, strlen (font_info->name)); } - UNBLOCK_INPUT; + unblock_input (); return font_object; } @@ -1042,12 +1040,12 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs, /* Draw glyphs between FROM and TO of S->char2b at (X Y) pixel - position of frame F with S->FACE and S->GC. If WITH_BACKGROUND - is nonzero, fill the background in advance. It is assured that - WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */ + position of frame F with S->FACE and S->GC. If WITH_BACKGROUND, + fill the background in advance. It is assured that WITH_BACKGROUND + is false when (FROM > 0 || TO < S->nchars). */ static int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, - int with_background) + bool with_background) /* NOTE: focus and clip must be set also, currently assumed (true in nsterm.m call) from ==0, to ==nchars */ { @@ -1318,7 +1316,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block) fprintf (stderr, "%p\tFinding glyphs for glyphs in block %d\n", font_info, block); - BLOCK_INPUT; + block_input (); #ifdef NS_IMPL_COCOA if (firstTime) @@ -1330,7 +1328,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block) font_info->glyphs[block] = xmalloc (0x100 * sizeof (unsigned short)); if (!unichars || !(font_info->glyphs[block])) - abort (); + emacs_abort (); /* create a string containing all Unicode characters in this block */ for (idx = block<<8, i = 0; i < 0x100; idx++, i++) @@ -1375,7 +1373,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block) #endif } - UNBLOCK_INPUT; + unblock_input (); xfree (unichars); } @@ -1400,12 +1398,12 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block) numGlyphs = 0x10000; #endif - BLOCK_INPUT; + block_input (); sfont = [font_info->nsfont screenFont]; font_info->metrics[block] = xzalloc (0x100 * sizeof (struct font_metrics)); if (!(font_info->metrics[block])) - abort (); + emacs_abort (); metrics = font_info->metrics[block]; for (g = block<<8, i =0; i<0x100 && g < numGlyphs; g++, i++, metrics++) @@ -1429,7 +1427,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block) metrics->ascent = r.size.height - metrics->descent; /*-lrint (hshrink* [sfont descender] - expand * hd/2); */ } - UNBLOCK_INPUT; + unblock_input (); }