MSVC builds: Add support to build DirectWrite shaping backend
authorChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 9 Dec 2015 06:57:15 +0000 (14:57 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 3 Feb 2016 12:17:09 +0000 (20:17 +0800)
Add into the NMake Makefiles to build the DirectWrite shaping backend,
but as PR #134 mentions, this is considered to be in an experimental state,
so don't include this in the build by default for now.  This is most probably
going to replace the Uniscribe backend eventually, since DirectWrite is meant
to be Uniscribe's replacement, and is needed for Windows Store apps if a
system shaping API is to be used.

win32/README.txt
win32/config-msvc.mak
win32/config.h.win32.in
win32/info-msvc.mak

index 1cb965c3d58dd6d7bd51aeaba8c357e54462b418..e2ead01d081e64216133f61bd5294b4b107717c4 100644 (file)
@@ -68,6 +68,10 @@ ICU: Enables the build HarfBuzz-ICU, which is now the recommended layout engine
      for ICU (International Components for Unicode), which deprecated ICU LE.\r
      Requires the ICU libraries.\r
 \r
+DIRECTWRITE: Enable (experimental) DirectWrite platform shaper support,\r
+             requires a rather recent Windows SDK, and at least Windows Vista/\r
+             Server 2008 with SP2 and platform update.\r
+\r
 PYTHON: Full path to the Python interpretor to be used, if it is not in %PATH%.\r
 \r
 PERL: Full path to the PERL interpretor to be used, if it is not in %PATH%.\r
index 70f4c1b4e440b80ccbd055f89ed224c3348c77d8..e0c6468e35ad500f598287857165e74fcd528ff4 100644 (file)
@@ -20,6 +20,9 @@ CAIRO_LIB = cairo.lib
 # Graphite2 is needed for building SIL Graphite2 support
 GRAPHITE2_LIB = graphite2.lib
 
+# Directwrite is needed for DirectWrite shaping support
+DIRECTWRITE_LIB = dwrite.lib
+
 # Please do not change anything beneath this line unless maintaining the NMake Makefiles
 # Bare minimum features and sources built into HarfBuzz on Windows
 HB_DEFINES =
@@ -185,4 +188,11 @@ HB_CFLAGS =        \
 HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
 !endif
 
+!if "$(DIRECTWRITE)" == "1"
+HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
+HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
+HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers)
+HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB)
+!endif
+
 HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"
index 4f42b83ea11fc5d818714c2013d34701df8b0f6d..73ad205d5445fb3a9cf921cb5b3d136ef2b376b1 100644 (file)
@@ -18,6 +18,9 @@
 /* Define to 1 if you have the <dlfcn.h> header file. */
 /* #undef HAVE_DLFCN_H */
 
+/* Have DirectWrite Library */
+/* #undef HAVE_DIRECTWRITE */
+
 /* Have simple TrueType Layout backend */
 #define HAVE_FALLBACK 1
 
index c009639b7e908e43a90e5ac9cc453af996c46a48..bc85dc9c97204cdf622d9c2f1186840afa9c445c 100644 (file)
@@ -23,6 +23,10 @@ INC_FEATURES = $(INC_FEATURES) FreeType
 INC_FEATURES = $(INC_FEATURES) Graphite2
 !endif
 
+!if "$(DIRECTWRITE)" == "1"
+INC_FEATURES = $(INC_FEATURES) DirectWrite
+!endif
+
 !if "$(ICU)" == "1"
 BUILT_LIBRARIES = $(BUILT_LIBRARIES) HarfBuzz-ICU
 !endif
@@ -76,6 +80,9 @@ help:
        @echo HarfBuzz DLL is built with OpenType, fallback and Uniscribe support
        @echo with a bundled Unicode implementation (UCDN).
        @echo ======
+       @echo DIRECTWRITE:
+       @echo Enable DirectWrite support, requires a recent enough Windows SDK.
+       @echo.
        @echo GRAPHITE2:
        @echo Enable graphite2 support, requires the SIL Graphite2 library
        @echo.