]> git.eshelyaron.com Git - emacs.git/commitdiff
Respect vertical centering preferences under Android
authorPo Lu <luangruo@yahoo.com>
Mon, 11 Sep 2023 04:56:37 +0000 (12:56 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 11 Sep 2023 04:57:21 +0000 (12:57 +0800)
* src/sfntfont.c (sfntfont_open): Match XLFD name against
Vvertical_centering_font_regexp; if they agree, set
font->vertical_centering.  Also set a suitable full name.

src/sfntfont.c

index 877f7a3830d7635cbe558aac79992ee24f35fc76..64dbffad03f817cd1127b2a64cd5296c560891e2 100644 (file)
@@ -3313,6 +3313,21 @@ sfntfont_open (struct frame *f, Lisp_Object font_entity,
   open_fonts = font_info;
 #endif /* HAVE_MMAP */
 
+  /* Now ascertain if vertical centering is desired by matching the
+     font XLFD against vertical-centering-font-regexp.  */
+
+  if (!NILP (font->props[FONT_NAME_INDEX]))
+    font->vertical_centering
+      = (STRINGP (Vvertical_centering_font_regexp)
+        && (fast_string_match_ignore_case
+            (Vvertical_centering_font_regexp,
+             font->props[FONT_NAME_INDEX]) >= 0));
+
+  /* And set a reasonable full name, namely the name of the font
+     file.  */
+  font->props[FONT_FULLNAME_INDEX]
+    = DECODE_FILE (build_unibyte_string (desc->path));
+
   /* All done.  */
   unblock_input ();
   return font_object;