summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-04-27 18:33:39 +0900
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2019-04-27 18:33:39 +0900
commit886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28 (patch)
treeb5770d9fc10a704ad8aeb3474c6940121252c770 /src/font.c
parent015a6e1df2772bd43680df5cbeaffccf98a881da (diff)
parent8dc00b2f1e6523c634df3e24379afbe712a32b27 (diff)
downloademacs-886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28.tar.gz
Merge branch 'master' into harfbuzz
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/font.c b/src/font.c
index fc8efa7f235..f1cb7561070 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1,6 +1,6 @@
/* font.c -- "Font" primitives.
-Copyright (C) 2006-2018 Free Software Foundation, Inc.
+Copyright (C) 2006-2019 Free Software Foundation, Inc.
Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
@@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "fontset.h"
#include "font.h"
#include "termhooks.h"
+#include "pdumper.h"
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
@@ -1006,7 +1007,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
}
-/* Parse NAME (null terminated) as XLFD and store information in FONT
+/* Parse NAME (NUL terminated) as XLFD and store information in FONT
(font-spec or font-entity). Size property of FONT is set as
follows:
specified XLFD fields FONT property
@@ -1352,7 +1353,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
return len < nbytes ? len : -1;
}
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
(font-spec or font-entity). NAME is supplied in either the
Fontconfig or GTK font name format. If NAME is successfully
parsed, return 0. Otherwise return -1.
@@ -1724,7 +1725,7 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
#endif
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
(font-spec or font-entity). If NAME is successfully parsed, return
0. Otherwise return -1. */
@@ -2174,13 +2175,12 @@ font_score (Lisp_Object entity, Lisp_Object *spec_prop)
static Lisp_Object
font_vconcat_entity_vectors (Lisp_Object list)
{
- EMACS_INT nargs = XFIXNAT (Flength (list));
+ ptrdiff_t nargs = list_length (list);
Lisp_Object *args;
USE_SAFE_ALLOCA;
SAFE_ALLOCA_LISP (args, nargs);
- ptrdiff_t i;
- for (i = 0; i < nargs; i++, list = XCDR (list))
+ for (ptrdiff_t i = 0; i < nargs; i++, list = XCDR (list))
args[i] = XCAR (list);
Lisp_Object result = Fvconcat (nargs, args);
SAFE_FREE ();
@@ -2781,7 +2781,7 @@ font_list_entities (struct frame *f, Lisp_Object spec)
{
Lisp_Object copy;
- val = driver_list->driver->list (f, scratch_font_spec);
+ val = (driver_list->driver->list) (f, scratch_font_spec);
/* We put zero_vector in the font-cache to indicate that
no fonts matching SPEC were found on the system.
Failure to have this indication in the font cache can
@@ -3241,7 +3241,7 @@ font_find_for_lface (struct frame *f, Lisp_Object *attrs, Lisp_Object spec, int
if (! NILP (alters))
{
- EMACS_INT alterslen = XFIXNAT (Flength (alters));
+ EMACS_INT alterslen = list_length (alters);
SAFE_ALLOCA_LISP (family, alterslen + 2);
for (i = 0; CONSP (alters); i++, alters = XCDR (alters))
family[i] = XCAR (alters);
@@ -5314,9 +5314,10 @@ syms_of_font (void)
sort_shift_bits[FONT_SIZE_INDEX] = 16;
sort_shift_bits[FONT_WIDTH_INDEX] = 23;
/* Note that the other elements in sort_shift_bits are not used. */
+ PDUMPER_REMEMBER_SCALAR (sort_shift_bits);
- staticpro (&font_charset_alist);
font_charset_alist = Qnil;
+ staticpro (&font_charset_alist);
DEFSYM (Qopentype, "opentype");
@@ -5358,13 +5359,13 @@ syms_of_font (void)
DEFSYM (QL2R, "L2R");
DEFSYM (QR2L, "R2L");
- staticpro (&scratch_font_spec);
scratch_font_spec = Ffont_spec (0, NULL);
- staticpro (&scratch_font_prefer);
+ staticpro (&scratch_font_spec);
scratch_font_prefer = Ffont_spec (0, NULL);
+ staticpro (&scratch_font_prefer);
- staticpro (&Vfont_log_deferred);
Vfont_log_deferred = make_nil_vector (3);
+ staticpro (&Vfont_log_deferred);
#if 0
#ifdef HAVE_LIBOTF