diff options
| author | Eli Zaretskii | 2019-05-31 11:30:36 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-05-31 11:30:36 +0300 |
| commit | fba3687db414306da780d1faeb13fe947d2e6da6 (patch) | |
| tree | 5518fa631be611f8534bc67ed0a9140788a39650 /doc | |
| parent | b40dde705af4d53853de6185a2468153b442dc9a (diff) | |
| download | emacs-fba3687db414306da780d1faeb13fe947d2e6da6.tar.gz emacs-fba3687db414306da780d1faeb13fe947d2e6da6.zip | |
Add HarfBuzz font backend for MS-Windows
* src/w32uniscribe.c [HAVE_HARFBUZZ]: Include math.h and
hb.h.
(bswap_32): Define for GCC 4.3.0 and later; else include
<byteswap.h> from Gnulib.
(struct uniscribe_font_info): Extend for HarfBuzz; 'cache' is
now a 'void *' (all users changed).
[HAVE_HARFBUZZ]: Define typedefs for HarfBuzz functions to be
loaded dynamically from the HarfBuzz DLL. Define macros to
call those functions via function pointers.
(uniscribe_open) [HAVE_HARFBUZZ]: Use the HarfBuzz font driver
if the type of the font entity is 'harfbuzz'.
(uniscribe_close) [HAVE_HARFBUZZ]: For fonts using the
HarfBuzz backend, call hb_font_destroy to free memory used for
the cached hb_font data.
(uniscribe_shape): Fix assignment of character codepoints to
glyphs from a single cluster.
(w32hb_list, w32hb_match, free_cb, w32hb_get_font_table)
(w32hb_get_font, w32hb_encode_char, w32hb_begin_font)
(w32uni_combining, w32uni_general, w32uni_mirroring)
(get_hb_unicode_funcs, w32hb_shape)
(w32hb_combining_capability, load_harfbuzz_funcs)
[HAVE_HARFBUZZ]: New functions.
(syms_of_w32uniscribe_for_pdumper) [HAVE_HARFBUZZ]: Load the
HarfBuzz DLL and register the HarfBuzz backend with its
functions.
* src/w32font.c (syms_of_w32font) <Qharfbuzz>: New DEFSYM.
* src/w32fns.c (Fx_create_frame, w32_create_tip_frame)
[HAVE_HARFBUZZ]: Register the harfbuzz font backend.
* src/lisp.h (get_unicode_property): Declare prototype.
* src/font.h (harfbuzz_font_driver) [HAVE_NTGUI]: Declare.
* src/chartab.c (get_unicode_property): New function, body
taken from get-unicode-property-internal.
(Fget_unicode_property_internal): Call get_unicode_property
after validating input.
* doc/lispref/frames.texi (Font and Color Parameters):
* doc/emacs/msdos.texi (Windows Fonts): Document support for
HarfBuzz text shaping on MS-Windows.
* configure.ac (HAVE_HARFBUZZ): Move out of the X-specific
part, and consider HarfBuzz also for HAVE_W32 systems.
Require HarfBuzz v1.2.3 for w32.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/msdos.texi | 37 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 27 |
2 files changed, 37 insertions, 27 deletions
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi index 9fc4b6262fb..27a7cd80968 100644 --- a/doc/emacs/msdos.texi +++ b/doc/emacs/msdos.texi | |||
| @@ -985,21 +985,28 @@ fontconfig library used in modern Free desktops: | |||
| 985 | The old XLFD based format is also supported for backwards compatibility. | 985 | The old XLFD based format is also supported for backwards compatibility. |
| 986 | 986 | ||
| 987 | @cindex font backend selection (MS-Windows) | 987 | @cindex font backend selection (MS-Windows) |
| 988 | Emacs 23 and later supports a number of font backends. Currently, | 988 | Emacs on MS-Windows supports a number of font backends. Currently, |
| 989 | the @code{gdi} and @code{uniscribe} backends are supported on Windows. | 989 | the @code{gdi}, @code{uniscribe}, and @code{harfbuzz} backends are |
| 990 | The @code{gdi} font backend is available on all versions of Windows, | 990 | available. The @code{gdi} font backend is available on all versions |
| 991 | and supports all fonts that are natively supported by Windows. The | 991 | of Windows, and supports all fonts that are natively supported by |
| 992 | @code{uniscribe} font backend is available on Windows 2000 and later, | 992 | Windows. The @code{uniscribe} font backend is available on Windows |
| 993 | and supports TrueType and OpenType fonts. Some languages requiring | 993 | 2000 and later, and supports TrueType and OpenType fonts. The |
| 994 | complex layout can only be properly supported by the Uniscribe | 994 | @code{harfbuzz} font backend is available if Emacs was built with |
| 995 | backend. By default, both backends are enabled if supported, with | 995 | HarfBuzz support, and if the HarfBuzz DLL is installed on your system; |
| 996 | @code{uniscribe} taking priority over @code{gdi}. To override that | 996 | like @code{uniscribe}, this backend supports only TrueType and |
| 997 | and use the GDI backend even if Uniscribe is available, invoke Emacs | 997 | OpenType fonts. Some languages requiring complex layout can only be |
| 998 | with the @kbd{-xrm Emacs.fontBackend:gdi} command-line argument, or | 998 | properly supported by the Uniscribe or HarfBuzz backends. By default, |
| 999 | add a @code{Emacs.fontBackend} resource with the value @code{gdi} in | 999 | all backends are enabled if supported, with @code{harfbuzz} taking |
| 1000 | the Registry under either the | 1000 | priority over @code{uniscribe}, and @code{uniscribe} taking priority |
| 1001 | @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} or the | 1001 | over @code{gdi}. To override that and use the GDI backend even if |
| 1002 | @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs} key (@pxref{Resources}). | 1002 | Uniscribe is available, invoke Emacs with the @kbd{-xrm |
| 1003 | Emacs.fontBackend:gdi} command-line argument, or add a | ||
| 1004 | @code{Emacs.fontBackend} resource with the value @code{gdi} in the | ||
| 1005 | Registry under either the @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} | ||
| 1006 | or the @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs} key | ||
| 1007 | (@pxref{Resources}). Similarly, to use the Uniscribe backend even if | ||
| 1008 | HarfBuzz is available, use @kbd{-xrm Emacs.fontBackend:uniscribe} on | ||
| 1009 | the command line that invokes Emacs. | ||
| 1003 | 1010 | ||
| 1004 | @cindex font properties (MS Windows) | 1011 | @cindex font properties (MS Windows) |
| 1005 | @noindent | 1012 | @noindent |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index c94b4e67aed..336075a1ca2 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -2278,18 +2278,21 @@ variable do not take effect immediately, only when you specify the | |||
| 2278 | @vindex font-backend@r{, a frame parameter} | 2278 | @vindex font-backend@r{, a frame parameter} |
| 2279 | @item font-backend | 2279 | @item font-backend |
| 2280 | A list of symbols, specifying the @dfn{font backends} to use for | 2280 | A list of symbols, specifying the @dfn{font backends} to use for |
| 2281 | drawing fonts in the frame, in order of priority. On X, there are | 2281 | drawing characters on the frame, in order of priority. In Emacs built |
| 2282 | currently three available font backends if Emacs was built without the | 2282 | without Cairo drawing on X, there are currently three available font |
| 2283 | Cairo drawing: @code{x} (the X core font driver), @code{xft} (the Xft | 2283 | backends: @code{x} (the X core font driver), @code{xft} (the Xft font |
| 2284 | font driver), and @code{xfthb} (the Xft font driver with HarfBuzz text | 2284 | driver), and @code{xfthb} (the Xft font driver with HarfBuzz text |
| 2285 | shaping). If built with the Cairo drawing, then there are two | 2285 | shaping). If built with the Cairo drawing, there are two available |
| 2286 | available font backends: @code{ftcr} (the FreeType font driver on | 2286 | font backends on X: @code{ftcr} (the FreeType font driver on Cairo) |
| 2287 | Cairo) and @code{ftcrhb} (the FreeType font driver on Cairo with | 2287 | and @code{ftcrhb} (the FreeType font driver on Cairo with HarfBuzz |
| 2288 | HarfBuzz text shaping). On MS-Windows, there are currently two | 2288 | text shaping). On MS-Windows, there are currently three available |
| 2289 | available font backends: @code{gdi} and @code{uniscribe} | 2289 | font backends: @code{gdi} (the core MS-Windows font driver), |
| 2290 | (@pxref{Windows Fonts,,, emacs, The GNU Emacs Manual}). On other | 2290 | @code{uniscribe} (font driver for OTF and TTF fonts with text shaping |
| 2291 | systems, there is only one available font backend, so it does not make | 2291 | by the Uniscribe engine), and @code{harfbuzz} (font driver for OTF and |
| 2292 | sense to modify this frame parameter. | 2292 | TTF fonts with HarfBuzz text shaping) (@pxref{Windows Fonts,,, emacs, |
| 2293 | The GNU Emacs Manual}). On other systems, there is only one available | ||
| 2294 | font backend, so it does not make sense to modify this frame | ||
| 2295 | parameter. | ||
| 2293 | 2296 | ||
| 2294 | @vindex background-mode@r{, a frame parameter} | 2297 | @vindex background-mode@r{, a frame parameter} |
| 2295 | @item background-mode | 2298 | @item background-mode |