win32/generate-msvcprojs.mak: Simplify enabling PangoFT2

... in the gtk-3 Visual Studio project.  This will allow one who wishes to use
the font features items that uses the older PangoFT2-based APIs that is used
before Pango 1.44.0 and HarfBuzz-2.2.0 an easier way to do that, by
regenerating the gtk-3 project files with the necessary items enabled.

The font features demo still needs to be explicitly enabled, though, as
before.
This commit is contained in:
Chun-wei Fan 2022-08-08 18:56:24 +08:00
parent e567d4a33a
commit 713fab7596
2 changed files with 47 additions and 9 deletions

View File

@ -61,12 +61,12 @@ the Pango 1.44.0 and HarfBuzz 2.2.0 (or later) headers and libraries
to ensure that you have your HarfBuzz .lib file named as such, which
is the default .lib name for HarfBuzz builds.
Alternatively, they can be manually enabled by making sure that
`HAVE_HARFBUZZ` and `HAVE_PANGOFT2` are defined in `config.h.win32`,
Alternatively, they can be manually enabled by running `nmake /f generate-msvc.mak regenerate-gtk-vsproj FONT_FEATURES_USE_PANGOFT2=1`
meaning that PangoFT2 must be present, which depends on HarfBuzz,
FontConfig and FreeType. You will then need to add to the `gtk3`
projects the .lib's of PangoFT2, HarfBuzz and FreeType in the
`Additional Libraries` entry under the linker settings.
FontConfig and FreeType. You will then need to ensure the `gtk-3`
projects have the correct .lib's of PangoFT2, HarfBuzz and FreeType
in the `Additional Libraries` entry under the linker settings, as they
assume the most common names are used there.
Please note that the font features demo is not built into gtk3-demo
by default. To do that, run in a Visual Studio command prompt:

View File

@ -331,13 +331,13 @@ gtk-3.win32.vs10.sourcefiles.filters:
vs9\$(GDK_VS9_PROJ): gdk-3.sourcefiles vs9\$(GDK_VS9_PROJ)in
vs9\$(GDKWIN32_VS9_PROJ).pre: gdk3-win32.sourcefiles vs9\$(GDKWIN32_VS9_PROJ)in
vs9\$(GDKBROADWAY_VS9_PROJ): gdk3-broadway.sourcefiles vs9\$(GDKBROADWAY_VS9_PROJ)in
vs9\$(GTK_VS9_PROJ): gtk-3.sourcefiles vs9\$(GTK_VS9_PROJ)in
vs9\$(GTK_VS9_PROJ).pre: gtk-3.sourcefiles vs9\$(GTK_VS9_PROJ)in
vs9\$(GAILUTIL_VS9_PROJ): gailutil-3.sourcefiles vs9\$(GAILUTIL_VS9_PROJ)in
vs10\$(GDK_VS1X_PROJ): gdk-3.vs10.sourcefiles vs10\$(GDK_VS1X_PROJ)in
vs10\$(GDKWIN32_VS1X_PROJ).pre: gdk3-win32.vs10.sourcefiles vs10\$(GDKWIN32_VS1X_PROJ)in
vs10\$(GDKBROADWAY_VS1X_PROJ): gdk3-broadway.vs10.sourcefiles vs10\$(GDKBROADWAY_VS1X_PROJ)in
vs10\$(GTK_VS1X_PROJ): gtk-3.vs10.sourcefiles vs10\$(GTK_VS1X_PROJ)in
vs10\$(GTK_VS1X_PROJ).pre: gtk-3.vs10.sourcefiles vs10\$(GTK_VS1X_PROJ)in
vs10\$(GAILUTIL_VS1X_PROJ): gailutil-3.vs10.sourcefiles vs10\$(GAILUTIL_VS1X_PROJ)in
vs10\$(GDK_VS1X_PROJ_FILTERS): gdk-3.vs10.sourcefiles.filters vs10\$(GDK_VS1X_PROJ_FILTERS)in
@ -360,14 +360,14 @@ vs10\$(DEMO_VS1X_PROJ_FILTERS): gtk3-demo.vs10.sourcefiles.filters vs10\$(DEMO_V
vs9\$(GDKWIN32_VS9_PROJ).pre \
vs9\$(GDKBROADWAY_VS9_PROJ) \
vs9\$(GDK_VS9_PROJ) \
vs9\$(GTK_VS9_PROJ) \
vs9\$(GTK_VS9_PROJ).pre \
vs9\$(GAILUTIL_VS9_PROJ) \
vs9\$(BROADWAYD_VS9_PROJ) \
vs9\$(DEMO_VS9_PROJ).pre \
vs10\$(GDKWIN32_VS1X_PROJ).pre \
vs10\$(GDKBROADWAY_VS1X_PROJ) \
vs10\$(GDK_VS1X_PROJ) \
vs10\$(GTK_VS1X_PROJ) \
vs10\$(GTK_VS1X_PROJ).pre \
vs10\$(GAILUTIL_VS1X_PROJ) \
vs10\$(BROADWAYD_VS1X_PROJ) \
vs10\$(DEMO_VS1X_PROJ).pre \
@ -415,6 +415,44 @@ vs9\$(GDKWIN32_VS9_PROJ) vs10\$(GDKWIN32_VS1X_PROJ):
@move $** $@
!endif
# Generate the gtk-3 project with or without using the older PangoFT2 +
# HarfBuzz APIs for the font features support (this code is not used if
# Pango 1.44.0 and HarfBuzz 2.2.0 or later are used)
!ifdef FONT_FEATURES_USE_PANGOFT2
vs9\$(GTK_VS9_PROJ): vs9\$(GTK_VS9_PROJ).pre2
@echo Generating final $@ using older PangoFT2 APIs...
@$(PYTHON) replace.py -a=replace-str -i=$** -o=$@ \
--instring="AdditionalDependencies=\"$$(" \
--outstring="AdditionalDependencies=\"$(DEMO_DEP_LIBS_PANGOFT2_VS9) $$("
@del $**
vs10\$(GTK_VS1X_PROJ): vs10\$(GTK_VS1X_PROJ).pre2
@echo Generating final $@ using older PangoFT2 APIs...
@$(PYTHON) replace.py -a=replace-str -i=$** -o=$@ \
--instring=";%(AdditionalDependencies)<" \
--outstring=";$(DEMO_DEP_LIBS_PANGOFT2_VS1X);%(AdditionalDependencies)<"
@del $**
vs9\$(GTK_VS9_PROJ).pre2: vs9\$(GTK_VS9_PROJ).pre
@$(PYTHON) replace.py -a=replace-str -i=$** -o=$@ \
--instring="$$(GtkDefines" \
--outstring="HAVE_HARFBUZZ;HAVE_PANGOFT;$$(GtkDefines"
@del $**
vs10\$(GTK_VS1X_PROJ).pre2: vs10\$(GTK_VS1X_PROJ).pre
@$(PYTHON) replace.py -a=replace-str -i=$** -o=$@ \
--instring="$$(GtkDefines);%" \
--outstring="HAVE_HARFBUZZ;HAVE_PANGOFT;$$(GtkDefines);%"
@del $**
!else
vs9\$(GTK_VS9_PROJ): vs9\$(GTK_VS9_PROJ).pre
vs10\$(GTK_VS1X_PROJ): vs10\$(GTK_VS1X_PROJ).pre
vs9\$(GTK_VS9_PROJ) vs10\$(GTK_VS1X_PROJ):
@echo Generating final $@...
@move $** $@
!endif
!ifdef FONT_FEATURES_DEMO
!ifdef FONT_FEATURES_USE_PANGOFT2
DEMO_MSG = with font features demo using PangoFT2