summaryrefslogtreecommitdiff
path: root/src/sfntfont.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-09-11 12:56:37 +0800
committerPo Lu <luangruo@yahoo.com>2023-09-11 12:57:21 +0800
commitf6d2ae766a13403b8bf6cfb31b0743c34493e246 (patch)
treeb3d4667795d3ca5c6820c30544027c740ee42d4c /src/sfntfont.c
parent0e37a291cae26e91e761868570be713fbe1c1c1a (diff)
downloademacs-f6d2ae766a13403b8bf6cfb31b0743c34493e246.tar.gz
Respect vertical centering preferences under Android
* 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.
Diffstat (limited to 'src/sfntfont.c')
-rw-r--r--src/sfntfont.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sfntfont.c b/src/sfntfont.c
index 877f7a3830d..64dbffad03f 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -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;