Commit faf10bd8 authored by YAMAMOTO Mitsuharu's avatar YAMAMOTO Mitsuharu

Support X core font driver on cairo (Bug#28236)

* configure.ac (HAVE_X_WINDOWS): Add xfont.o to FONT_OBJ if HAVE_CAIRO.

* doc/lispref/frames.texi (Font and Color Parameters): Mention X core font
driver with Cairo drawing.

* src/font.c (syms_of_font) [HAVE_X_WINDOWS && USE_CAIRO]: Call syms_of_xfont.

* src/xfns.c (x_create_tip_frame) [USE_CAIRO]: Register xfont_driver.

* src/xterm.c (x_cr_gc_clip) [USE_CAIRO]: New function extracted from
x_begin_cr_clip.
(x_begin_cr_clip) [USE_CAIRO]: Use it.
(xlib_surface_key, saved_drawable_key) [USE_CAIRO]: New variables.
(x_cr_destroy_xlib_surface, x_try_cr_xlib_drawable)
(x_end_cr_xlib_drawable) [USE_CAIRO]: New functions.
(x_draw_composite_glyph_string_foreground)
(x_draw_glyph_string_foreground) [USE_CAIRO]: Get Xlib surface when drawing
text with X core fonts into bitmap surfaces.  Add fallback code for drawing
into outline surfaces.
parent 88c49ac3
Pipeline #1930 failed with stage
in 9 seconds
......@@ -5261,7 +5261,7 @@ if test "${HAVE_X_WINDOWS}" = "yes" ; then
XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o"
FONT_OBJ=xfont.o
if test "$HAVE_CAIRO" = "yes"; then
FONT_OBJ="ftfont.o ftcrfont.o"
FONT_OBJ="$FONT_OBJ ftfont.o ftcrfont.o"
elif test "$HAVE_XFT" = "yes"; then
FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
elif test "$HAVE_FREETYPE" = "yes"; then
......
......@@ -2282,11 +2282,11 @@ drawing characters on the frame, in order of priority. In Emacs built
without Cairo drawing on X, there are currently three available font
backends: @code{x} (the X core font driver), @code{xft} (the Xft font
driver), and @code{xfthb} (the Xft font driver with HarfBuzz text
shaping). If built with the Cairo drawing, there are two available
font backends on X: @code{ftcr} (the FreeType font driver on Cairo)
and @code{ftcrhb} (the FreeType font driver on Cairo with HarfBuzz
text shaping). On MS-Windows, there are currently three available
font backends: @code{gdi} (the core MS-Windows font driver),
shaping). If built with the Cairo drawing, there are also three
available font backends on X: @code{x}, @code{ftcr} (the FreeType font
driver on Cairo), and @code{ftcrhb} (the FreeType font driver on Cairo
with HarfBuzz text shaping). On MS-Windows, there are currently three
available font backends: @code{gdi} (the core MS-Windows font driver),
@code{uniscribe} (font driver for OTF and TTF fonts with text shaping
by the Uniscribe engine), and @code{harfbuzz} (font driver for OTF and
TTF fonts with HarfBuzz text shaping) (@pxref{Windows Fonts,,, emacs,
......
......@@ -5497,10 +5497,10 @@ cause Xft crashes. Only has an effect in Xft builds. */);
#ifdef HAVE_FREETYPE
syms_of_ftfont ();
#ifdef HAVE_X_WINDOWS
syms_of_xfont ();
#ifdef USE_CAIRO
syms_of_ftcrfont ();
#else
syms_of_xfont ();
syms_of_ftxfont ();
#ifdef HAVE_XFT
syms_of_xftfont ();
......
......@@ -3794,8 +3794,8 @@ This function is an internal primitive--use `make-frame' instead. */)
register_font_driver (&ftxfont_driver, f);
#endif /* not HAVE_XFT */
#endif /* HAVE_FREETYPE */
register_font_driver (&xfont_driver, f);
#endif /* not USE_CAIRO */
register_font_driver (&xfont_driver, f);
image_cache_refcount =
FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment