diff options
| author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-05-05 08:21:49 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2019-05-05 08:21:49 +0900 |
| commit | f208d5ae77cf381c6f1db9b1aef76d5e9805a106 (patch) | |
| tree | d8047fb6b76a577eb69925e96f85142aabbbb943 /src/ftxfont.c | |
| parent | 27511b9821d3a4d3dcb7d8bf50c37d1a46247362 (diff) | |
| download | emacs-f208d5ae77cf381c6f1db9b1aef76d5e9805a106.tar.gz | |
Add new font backend drivers for text shaping by HarfBuzz
* etc/NEWS: Mention new font backend drivers xfthb and ftcrhb.
* src/font.h [HAVE_HARFBUZZ]: Include hb.h.
(struct font_driver) [HAVE_HARFBUZZ]: New members begin_hb_font and
end_hb_font.
(ftfont_match, ftfont_list): Remove externs.
(ftfont_match2, ftfont_list2):
(fthbfont_combining_capability, fthbfont_begin_hb_font)
(fthbfont_shape) [HAVE_HARFBUZZ]:
(xfthbfont_driver) [HAVE_XFT && HAVE_HARFBUZZ]:
(ftcrhbfont_driver) [USE_CAIRO && HAVE_HARFBUZZ]: Add externs.
* src/ftcrfont.c (ftcrfont_list): Use ftfont_list2.
(ftcrfont_match): Use ftfont_match2.
(ftcrfont_open): Get font type from entity.
(ftcrfont_open) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
(ftcrfont_shape) [HAVE_HARFBUZZ]: Make shaping fail.
(ftcrhbfont_list, ftcrhbfont_match)
(ftcrhbfont_begin_hb_font) [HAVE_HARFBUZZ]: New functions.
(ftcrhbfont_driver) [HAVE_HARFBUZZ]: New variable.
(syms_of_ftcrfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register it.
(syms_of_ftcrfont) [HAVE_HARFBUZZ]: New symbol Qftcrhb.
* src/ftfont.c: Include math.h for lround.
(fthbfont_driver) [HAVE_HARFBUZZ]: New variable.
(ftfont_get_hb_font) [HAVE_HARFBUZZ]: Remove function.
(ftfont_list, ftfont_match): Make static.
(ftfont_list2, ftfont_match2): New functions.
(ftfont_open2) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
(ftfont_open): Get font type from entity.
(ftfont_shape, ftfont_combining_capability, ftfont_driver) [HAVE_HARFBUZZ]:
Move HarfBuzz specific part from here ...
(fthbfont_shape, fthbfont_combining_capability)
(fthbfont_driver) [HAVE_HARFBUZZ]: ... to here. New functions and variable.
(fthbfont_begin_hb_font) [HAVE_HARFBUZZ]: New function.
(fthbfont_shape_by_hb) [HAVE_HARFBUZZ]: Rename from ftfont_shape_by_hb.
Don't take FreeType specific arguments ft_face and matrix. Use begin_hb_font
and end_hb_font font driver functions. Use text_extents font driver functions
instead of ftfont_glyph_metrics.
(syms_of_ftfont) [HAVE_HARFBUZZ]: New symbol Qfreetypehb.
(syms_of_ftfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register
fthbfont_drivert.
* src/ftxfont.c (ftxfont_list): Use ftfont_list2.
(ftxfont_match): Use ftfont_match2.
(ftxfont_driver) [HAVE_HARFBUZZ]: Don't initialize shape member explicitly.
* src/xfns.c (Fx_create_frame) [USE_CAIRO && HAVE_HARFBUZZ]:
(Fx_create_frame) [HAVE_XFT && HAVE_HARFBUZZ]: Register HarfBuzz versions of
font drivers.
* src/xftfont.c (xftfont_list): Use ftfont_list2.
(xftfont_match): Use ftfont_match2.
(xftfont_open): Get font type from entity.
(xftfont_open) [HAVE_HARFBUZZ]: Use HarfBuzz version of driver if specified.
(xftfont_shape) [HAVE_HARFBUZZ]: Make shaping fail.
(xfthbfont_list, xfthbfont_match, xfthbfont_begin_hb_font)
(xfthbfont_end_hb_font) [HAVE_HARFBUZZ]: New functions.
(xftfont_driver) [HAVE_HARFBUZZ]: Don't initialize shape member explicitly.
(xfthbfont_driver) [HAVE_HARFBUZZ]: New variable.
(syms_of_xftfont_for_pdumper) [HAVE_HARFBUZZ]: Initialize and register it.
(syms_of_xftfont) [HAVE_HARFBUZZ]: New symbol Qxfthb.
Diffstat (limited to 'src/ftxfont.c')
| -rw-r--r-- | src/ftxfont.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/ftxfont.c b/src/ftxfont.c index a549fd723bb..949ef4c503b 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -209,21 +209,13 @@ ftxfont_draw_background (struct frame *f, struct font *font, GC gc, int x, int y static Lisp_Object ftxfont_list (struct frame *f, Lisp_Object spec) { - Lisp_Object list = ftfont_list (f, spec), tail; - - for (tail = list; CONSP (tail); tail = XCDR (tail)) - ASET (XCAR (tail), FONT_TYPE_INDEX, Qftx); - return list; + return ftfont_list2 (f, spec, Qftx); } static Lisp_Object ftxfont_match (struct frame *f, Lisp_Object spec) { - Lisp_Object entity = ftfont_match (f, spec); - - if (VECTORP (entity)) - ASET (entity, FONT_TYPE_INDEX, Qftx); - return entity; + return ftfont_match2 (f, spec, Qftx); } static Lisp_Object @@ -362,7 +354,7 @@ struct font_driver const ftxfont_driver = .otf_capability = ftfont_otf_capability, #endif .end_for_frame = ftxfont_end_for_frame, -#if (defined HAVE_M17N_FLT && defined HAVE_LIBOTF) || defined HAVE_HARFBUZZ +#if defined HAVE_M17N_FLT && defined HAVE_LIBOTF .shape = ftfont_shape, #endif #ifdef HAVE_OTF_GET_VARIATION_GLYPHS |
