summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am6
-rw-r--r--NEWS33
-rw-r--r--README.win3228
-rw-r--r--acinclude.m496
-rwxr-xr-xautogen.sh1
-rw-r--r--build/Makefile.am1
-rw-r--r--build/win32/Makefile.am1
-rw-r--r--build/win32/vs9/Makefile.am11
-rw-r--r--build/win32/vs9/README.txt35
-rw-r--r--build/win32/vs9/install.vcproj78
-rw-r--r--build/win32/vs9/pango.sln79
-rw-r--r--build/win32/vs9/pango.vcprojin211
-rw-r--r--build/win32/vs9/pango.vsprops137
-rw-r--r--build/win32/vs9/pangocairo.vcprojin170
-rw-r--r--build/win32/vs9/pangoft2.vcprojin408
-rw-r--r--build/win32/vs9/pangowin32.vcproj165
-rw-r--r--build/win32/vs9/stdint.h36
-rw-r--r--build/win32/vs9/unistd.h1
-rw-r--r--config.h.win32.in151
-rw-r--r--configure.in52
-rw-r--r--docs/pango-docs.sgml3
-rw-r--r--docs/pango-sections.txt1
-rw-r--r--docs/tmpl/atsui-fonts.sgml9
-rw-r--r--examples/Makefile.am1
-rw-r--r--git.mk7
-rw-r--r--modules/basic/Makefile.am3
-rw-r--r--modules/basic/basic-atsui.c15
-rw-r--r--modules/basic/basic-fc.c1
-rw-r--r--modules/basic/basic-win32.c187
-rw-r--r--modules/hebrew/hebrew-fc.c1
-rw-r--r--modules/indic/indic-fc.c1
-rw-r--r--modules/indic/indic-lang.c73
-rw-r--r--modules/indic/indic-ot-class-tables.c12
-rw-r--r--modules/khmer/khmer-fc.c1
-rw-r--r--modules/thai/thai-fc.c2
-rw-r--r--modules/tibetan/tibetan-fc.c1
-rw-r--r--pango-view/Makefile.am19
-rw-r--r--pango-view/viewer-render.c49
-rw-r--r--pango/Makefile.am207
-rw-r--r--pango/glyphstring.c4
-rw-r--r--pango/mini-fribidi/Makefile.am10
-rw-r--r--pango/module-defs-fc.c.win3240
-rw-r--r--pango/module-defs-lang.c.win3211
-rw-r--r--pango/module-defs-win32.c.win3226
-rw-r--r--pango/module-defs.h.win3274
-rw-r--r--pango/modules.c44
-rw-r--r--pango/pango-engine-private.h2
-rw-r--r--pango/pango-engine.c3
-rw-r--r--pango/pango-gravity.c2
-rw-r--r--pango/pango-impl-utils.h26
-rw-r--r--pango/pango-layout.c28
-rw-r--r--pango/pango-ot-buffer.c23
-rw-r--r--pango/pango-utils.c26
-rw-r--r--pango/pangoatsui-fontmap.c8
-rw-r--r--pango/pangoatsui-private.h2
-rw-r--r--pango/pangoatsui.c30
-rw-r--r--pango/pangoatsui.h3
-rw-r--r--pango/pangocairo-atsuifont.c101
-rw-r--r--pango/pangocairo-fcfont.c13
-rw-r--r--pango/pangocairo-font.c83
-rw-r--r--pango/pangocairo-private.h6
-rw-r--r--pango/pangocairo-win32font.c31
-rw-r--r--pango/pangocairo.rc.in30
-rw-r--r--pango/pangofc-font.c90
-rw-r--r--pango/pangofc-private.h48
-rw-r--r--pango/pangoft2.def2
-rw-r--r--pango/pangowin32-private.h7
-rw-r--r--pango/pangowin32.c29
-rw-r--r--pango/pangowin32.def3
-rw-r--r--pango/shape.c34
-rw-r--r--tests/Makefile.am19
71 files changed, 2562 insertions, 589 deletions
diff --git a/Makefile.am b/Makefile.am
index 01aa688f..b0b56ec6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in.
-SUBDIRS= pango modules pango-view examples docs tools tests
+SUBDIRS= pango modules pango-view examples docs tools tests build
EXTRA_DIST = \
autogen.sh \
@@ -31,9 +31,11 @@ EXTRA_DIST = \
MAINTAINERS \
HACKING \
README.win32 \
+ config.h.win32 \
pango-zip.sh.in \
sanitize-la.sh \
pango.doap
+
MAINTAINERCLEANFILES = \
$(srcdir)/INSTALL \
$(srcdir)/aclocal.m4 \
@@ -98,6 +100,6 @@ if HAVE_WIN32
pkgconfig_DATA += pangowin32.pc
endif
-DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection
-include $(top_srcdir)/git.mk
diff --git a/NEWS b/NEWS
index eda0c982..4cc571ba 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,36 @@
+Overview of changes between 1.26.2 and 1.27.1
+=============================================
+- Enable introspection again
+- Misc HarfBuzz bug fixes
+- Improve PangoLayout line breaking
+- Revert usage of CoreText in ATSUI backend
+- Fix FT_Face finalizer call
+- Bugs fixed:
+ Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X
+ Bug 610183 - Pango doesn't compile with gcc 3.3.3
+ Bug 582697 - Add pango-view --pixels option
+
+Overview of changes between 1.26.1 and 1.26.2
+=============================================
+- Fix non-standard C++ usage
+- Fix OpenType mark ligation
+- Bugs fixed:
+ Bug 602823 - void function cannot return value
+ Bug 602660 - [HB] don't use flexible arrays
+ Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler
+
+Overview of changes between 1.26.0 and 1.26.1
+=============================================
+- Finally fix GPOS positioning and kerning with non-identity cairo matrices
+- [HB] Fix lookup_flag ignoring
+- Fix leak with non-mmapped fonts
+- Allow using uninstalled glib
+- Bugs fixed:
+ Bug 341481 - pangocairo kerning problem with nonidentity scaling
+ Bug 587768 - [patch] Don't build pango-view twice
+ Bug 594101 - [Indic] character class data updates to support unicode 5.1
+ Bug 596837 - Typo in pango_cairo_show_layout documentation
+
Overview of changes between 1.25.6 and 1.26.0
=============================================
- New stable release series
diff --git a/README.win32 b/README.win32
index 68fcd8ab..283b6cb8 100644
--- a/README.win32
+++ b/README.win32
@@ -6,11 +6,11 @@ pangowin32). Much of the GDI font API calls are in cairo.
The pangoft2 backend was originally written with Win32 in mind, but
its main use nowadays is on other platforms than Win32.
-There are two ways to build Pango for Win32:
+There are three ways to build Pango for Win32:
1) Use gcc (mingw), libtool, make, like on Unix.
-If building from CVS, run the autogen.sh script that runs aclocal,
+If building from git, run the autogen.sh script that runs aclocal,
automake, autoconf and configure to build makefiles etc. This is what
tml@novell.com uses. Pass the same switches to autogen.sh that you
would pass to the configure script.
@@ -20,31 +20,15 @@ make should be enough. But, as always, you need to understand what is
happening and follow the progress in case manual intervention is
needed.
-If you want to support complex scripts (which you should!), you need
-the usp10.h header from the Platform SDK. Otherwise the basic-win32
-shaper module won' use Uniscribe and for instance Arabic and Indic
-scripts will look like crap. (Yes, complex script support *is*
-important. It is one of the main selling points of GTK+ and Pango.)
-Pass the --with-usp10 flag to the configure script to tell it where
-you have the Platform SDK (or other source of an "usp10.h" or
-"include/usp10.h" file).
-
tml ran the configure script like this when building binaries for
Pango 1.10.0:
-PATH=/devel/dist/glib-2.8.0/bin:$PATH ACLOCAL_FLAGS="-I /devel/dist/glib-2.8.0/share/aclocal" PKG_CONFIG_PATH=/devel/dist/glib-2.8.0/lib/pkgconfig:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3' CPPFLAGS='-I/opt/gnu/include' LDFLAGS='-L/opt/gnu/lib' CFLAGS=-O ./configure --disable-gtk-doc --with-usp10=/opt/psdk --without-x --prefix=c:/devel/target/pango-1.10.0
-
-The pango.modules file tends not to get automatically set up correctly
-on Win32. Check that. Also make sure you set up a pango.aliases file
-if you want to support non-Latin scripts. pango.aliases file used by
-tml looks like this:
+PATH=/devel/dist/glib-2.8.0/bin:$PATH ACLOCAL_FLAGS="-I /devel/dist/glib-2.8.0/share/aclocal" PKG_CONFIG_PATH=/devel/dist/glib-2.8.0/lib/pkgconfig:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3' CPPFLAGS='-I/opt/gnu/include' LDFLAGS='-L/opt/gnu/lib' CFLAGS=-O ./configure --disable-gtk-doc --without-x --prefix=c:/devel/target/pango-1.10.0
-tahoma = "tahoma,browallia new,mingliu,simhei,gulimche,ms gothic,latha,mangal"
-sans = "arial,browallia new,mingliu,simhei,gulimche,ms gothic,latha,mangal"
-serif = "times new roman,angsana new,mingliu,simsun,gulimche,ms gothic,latha,mangal"
-monospace = "courier new,courier monothai,mingliu,simsun,gulimche,ms gothic,latha,mangal"
+2) Use Visual Studio 2008. Use the solution file in
+build/win32/vs9. See the README.txt there for more information.
-2) Use MSVC and nmake. Use the makefile.msc makefiles. These makefiles
+3) Use MSVC and nmake. Use the makefile.msc makefiles. These makefiles
are supported by Hans Breuer. They requires manual editing. You need
to have the source code to some suitable version of glib in a sibling
directory. Ask Hans for advice.
diff --git a/acinclude.m4 b/acinclude.m4
index 48fd5d8e..8899c7c4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -55,3 +55,99 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
])
+dnl REMOVE THIS WHEN introspection.m4 is widely available
+dnl
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+ dnl enable/disable introspection
+ m4_if([$2], [require],
+ [dnl
+ enable_introspection=yes
+ ],[dnl
+ AC_ARG_ENABLE(introspection,
+ AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+ [Enable introspection for this build]),,
+ [enable_introspection=auto])
+ ])dnl
+
+ AC_MSG_CHECKING([for gobject-introspection])
+
+ dnl presence/version checking
+ AS_CASE([$enable_introspection],
+ [no], [dnl
+ found_introspection="no (disabled, use --enable-introspection to enable)"
+ ],dnl
+ [yes],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+ AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+ found_introspection=yes,
+ AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+ ],dnl
+ [auto],[dnl
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+ ],dnl
+ [dnl
+ AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+ ])dnl
+
+ AC_MSG_RESULT([$found_introspection])
+
+ INTROSPECTION_SCANNER=
+ INTROSPECTION_COMPILER=
+ INTROSPECTION_GENERATE=
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+ INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+ INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+ INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+ INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+ AC_SUBST(INTROSPECTION_COMPILER)
+ AC_SUBST(INTROSPECTION_GENERATE)
+ AC_SUBST(INTROSPECTION_GIRDIR)
+ AC_SUBST(INTROSPECTION_TYPELIBDIR)
+ AC_SUBST(INTROSPECTION_CFLAGS)
+ AC_SUBST(INTROSPECTION_LIBS)
+ AC_SUBST(INTROSPECTION_MAKEFILE)
+
+ AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])
diff --git a/autogen.sh b/autogen.sh
index 2482946f..e8a3cf7a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,6 +7,7 @@ test -z "$srcdir" && srcdir=.
REQUIRED_AUTOMAKE_VERSION=1.9
PKG_NAME="pango"
+#REQUIRED_M4MACROS=introspection.m4
(test -f $srcdir/configure.in \
&& test -f $srcdir/README \
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 00000000..0f81afe3
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = win32
diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am
new file mode 100644
index 00000000..ea035c25
--- /dev/null
+++ b/build/win32/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = vs9
diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am
new file mode 100644
index 00000000..88ec9805
--- /dev/null
+++ b/build/win32/vs9/Makefile.am
@@ -0,0 +1,11 @@
+EXTRA_DIST = \
+ pango.sln \
+ pango.vsprops \
+ pango.vcprojin \
+ pango.vcproj \
+ pangoft2.vcprojin \
+ pangoft2.vcproj \
+ pangowin32.vcproj \
+ pangocairo.vcprojin \
+ pangocairo.vcproj \
+ install.vcproj
diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt
new file mode 100644
index 00000000..b7c4e908
--- /dev/null
+++ b/build/win32/vs9/README.txt
@@ -0,0 +1,35 @@
+Note that all this is rather experimental.
+
+This VS9 solution and the projects it includes are intented to be used
+in a Pango source tree unpacked from a tarball. In a git checkout you
+first need to use some Unix-like environment or manual work to expand
+files as needed, for instance the .vcprojin files here into .vcproj
+files.
+
+Set up the source tree as follows under some arbitrary top folder
+<root>:
+
+<root>\pango\<this-pango-source-tree>
+<root>\vs9\<PlatformName>
+
+*this* file you are now reading is thus located at
+<root>\pango\<this-pango-source-tree>\build\win32\vs9\README.txt.
+
+<PlatformName> is either Win32 or x64, as in VS9 project files.
+
+You should unpack the glib-dev zip file into
+<root>\vs9\<PlatformName>, so that for instance glib.h ends up at
+<root>\vs9\<PlatformName>\include\glib-2.0\glib.h.
+
+The "install" project will copy build results and headers into their
+appropriate location under <root>\vs9\<PlatformName>. For instance,
+built DLLs go into <root>\vs9\<PlatformName>\bin, built LIBs into
+<root>\vs9\<PlatformName>\lib and headers into
+<root>\vs9\<PlatformName>\include\pangpo-1.0. This is then from where
+project files higher in the stack are supposed to look for them, not
+from a specific Pango source tree like this one. It is important to
+keep separate the concept of a "source tree", where also non-public
+headers are present, and an "install tree" where only public headers
+are present.
+
+--Tor Lillqvist <tml@iki.fi>
diff --git a/build/win32/vs9/install.vcproj b/build/win32/vs9/install.vcproj
new file mode 100644
index 00000000..3b9dad66
--- /dev/null
+++ b/build/win32/vs9/install.vcproj
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="install"
+ ProjectGUID="{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
+ RootNamespace="install"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ OutputDirectory="$(GlibEtcInstallRoot)"
+
+ConfigurationType="10"
+ CharacterSet="2"
+ DeleteExtensionsOnClean=""
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="$(PangoDoInstall)"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ OutputDirectory="$(GlibEtcInstallRoot)"
+ ConfigurationType="10"
+ CharacterSet="2"
+ DeleteExtensionsOnClean=""
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="$(PangoDoInstall)"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ OutputDirectory="$(GlibEtcInstallRoot)"
+ ConfigurationType="10"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ DeleteExtensionsOnClean=""
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="$(PangoDoInstall)"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ OutputDirectory="$(GlibEtcInstallRoot)"
+ ConfigurationType="10"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ DeleteExtensionsOnClean=""
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="$(PangoDoInstall)"
+ />
+ </Configuration>
+ </Configurations>
+</VisualStudioProject>
diff --git a/build/win32/vs9/pango.sln b/build/win32/vs9/pango.sln
new file mode 100644
index 00000000..ededa745
--- /dev/null
+++ b/build/win32/vs9/pango.sln
@@ -0,0 +1,79 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}"
+ ProjectSection(ProjectDependencies) = postProject
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}"
+ ProjectSection(ProjectDependencies) = postProject
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}"
+ ProjectSection(ProjectDependencies) = postProject
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}"
+ ProjectSection(ProjectDependencies) = postProject
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.Build.0 = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.Build.0 = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.Build.0 = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.Build.0 = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64
+ {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64
+ {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/build/win32/vs9/pango.vcprojin b/build/win32/vs9/pango.vcprojin
new file mode 100644
index 00000000..ad7db04f
--- /dev/null
+++ b/build/win32/vs9/pango.vcprojin
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="pango"
+ ProjectGUID="{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}"
+ RootNamespace="pango"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pango.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pango.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pango.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pango.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\..\..\pango\pango.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File RelativePath="..\..\..\modules\arabic\arabic-lang.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_lang"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\indic\indic-lang.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_lang"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_lang"
+ />
+ </FileConfiguration>
+ </File>
+#include "libpango.sourcefiles"
+#include "mini-fribidi/libmini-fribidi.sourcefiles"
+ </Filter>
+ </Files>
+</VisualStudioProject>
diff --git a/build/win32/vs9/pango.vsprops b/build/win32/vs9/pango.vsprops
new file mode 100644
index 00000000..f2350069
--- /dev/null
+++ b/build/win32/vs9/pango.vsprops
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="pangoprops"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)\$(PlatformName)\obj"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\..;..\..\..\pango;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\fontconfig;$(GlibEtcInstallRoot)\include\freetype2"
+ PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES"
+ ForcedIncludeFiles="msvc_recommended_pragmas.h"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gio-2.0.lib gmodule-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib"
+ AdditionalLibraryDirectories="$(GlibEtcInstallRoot)\lib"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="
+if exist ..\..\..\config.h goto DONE_CONFIG_H&#x0D;&#x0A;
+copy ..\..\..\config.h.win32 ..\..\..\config.h&#x0D;&#x0A;
+:DONE_CONFIG_H&#x0D;&#x0A;
+
+if exist ..\..\..\pango\DONE_MODULE_DEFS_H goto DONE_MODULE_DEFS_H&#x0D;&#x0A;
+copy /y ..\..\..\pango\module-defs.h.win32 ..\..\..\pango\module-defs.h&#x0D;&#x0A;
+copy ..\..\..\pango\module-defs.h.win32 ..\..\..\pango\DONE_MODULE_DEFS_H&#x0D;&#x0A;
+:DONE_MODULE_DEFS_H&#x0D;&#x0A;
+
+if exist ..\..\..\pango\module-defs-lang.c goto DONE_MODULE_DEFS_LANG_C&#x0D;&#x0A;
+copy ..\..\..\pango\module-defs-lang.c.win32 ..\..\..\pango\module-defs-lang.c&#x0D;&#x0A;
+:DONE_MODULE_DEFS_LANG_C&#x0D;&#x0A;
+
+if exist ..\..\..\pango\module-defs-fc.c goto DONE_MODULE_DEFS_FC_C&#x0D;&#x0A;
+copy ..\..\..\pango\module-defs-fc.c.win32 ..\..\..\pango\module-defs-fc.c&#x0D;&#x0A;
+:DONE_MODULE_DEFS_FC_C&#x0D;&#x0A;
+
+if exist ..\..\..\pango\module-defs-win32.c goto DONE_MODULE_DEFS_WIN32_C&#x0D;&#x0A;
+copy ..\..\..\pango\module-defs-win32.c.win32 ..\..\..\pango\module-defs-win32.c&#x0D;&#x0A;
+:DONE_MODULE_DEFS_WIN32_C&#x0D;&#x0A;
+"
+ />
+ <UserMacro
+ Name="PangoApiVersion"
+ Value="1.0"
+ />
+ <UserMacro
+ Name="PangoBinaryVersion"
+ Value="1.6.0"
+ />
+ <UserMacro
+ Name="PangoDummyPrefix"
+ Value="/dummy"
+ />
+ <UserMacro
+ Name="PangoDefines"
+ Value="G_LOG_DOMAIN=\&quot;Pango\&quot;;PANGO_ENABLE_BACKEND;PANGO_ENABLE_ENGINE;SYSCONFDIR=\&quot;$(PangoDummyPrefix)/etc\&quot;;LIBDIR=\&quot;$(PangoDummyPrefix)/lib\&quot;"
+ />
+ <UserMacro
+ Name="PangoDoInstall"
+ Value="
+echo on&#x0D;&#x0A;
+mkdir $(OutDir)\bin&#x0D;&#x0A;
+copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(OutDir)\bin&#x0D;&#x0A;
+copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(OutDir)\bin&#x0D;&#x0A;
+
+mkdir $(OutDir)\lib&#x0D;&#x0A;
+copy $(ConfigurationName)\$(PlatformName)\bin\*-$(PangoApiVersion).lib $(OutDir)\lib&#x0D;&#x0A;
+
+mkdir $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-attributes.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-bidi-type.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-break.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-context.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-coverage.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-engine.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-enum-types.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-features.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-font.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-fontmap.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-fontset.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-glyph-item.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-glyph.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-gravity.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-item.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-language.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-layout.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-matrix.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-modules.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-ot.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-renderer.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-script.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-tabs.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-types.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pango-utils.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangocairo.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangofc-decoder.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangofc-font.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangofc-fontmap.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangoft2.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+copy ..\..\..\pango\pangowin32.h $(OutDir)\include\pango-$(PangoApiVersion)\pango&#x0D;&#x0A;
+"
+ />
+ <UserMacro
+ Name="PangoLibtoolCompatibleDllPrefix"
+ Value="lib"
+ />
+ <UserMacro
+ Name="PangoLibtoolCompatibleDllSuffix"
+ Value="-$(PangoApiVersion)-0"
+ />
+ <UserMacro
+ Name="PangoSeparateVS9DllPrefix"
+ Value=""
+ />
+ <UserMacro
+ Name="PangoSeparateVS9DllSuffix"
+ Value="-1-vs9"
+ />
+ <!-- Change these two to PangoLibtoolCompatibleDllPrefix and
+ PangoLibtoolCompatibleDllSuffix if that is what you want -->
+ <UserMacro
+ Name="PangoDllPrefix"
+ Value="$(PangoSeparateVS9DllPrefix)"
+ />
+ <UserMacro
+ Name="PangoDllSuffix"
+ Value="$(PangoSeparateVS9DllSuffix)"
+ />
+ <UserMacro
+ Name="GlibEtcInstallRoot"
+ Value="..\..\..\..\..\vs9\$(PlatformName)"
+ />
+</VisualStudioPropertySheet>
diff --git a/build/win32/vs9/pangocairo.vcprojin b/build/win32/vs9/pangocairo.vcprojin
new file mode 100644
index 00000000..8b30b3ed
--- /dev/null
+++ b/build/win32/vs9/pangocairo.vcprojin
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="pangocairo"
+ ProjectGUID="{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}"
+ RootNamespace="pangocairo"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="cairo.lib fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangocairo.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="cairo.lib fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangocairo.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="cairo.lib fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangocairo.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="cairo.lib fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangocairo.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\..\..\pango\pangocairo.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File RelativePath="..\..\..\pango\pangocairo-fcfont.c" />
+ <File RelativePath="..\..\..\pango\pangocairo-fcfontmap.c" />
+ <File RelativePath="..\..\..\pango\pangocairo-win32font.c" />
+ <File RelativePath="..\..\..\pango\pangocairo-win32fontmap.c" />
+#include "libpangocairo.sourcefiles"
+ </Filter>
+ </Files>
+</VisualStudioProject>
diff --git a/build/win32/vs9/pangoft2.vcprojin b/build/win32/vs9/pangoft2.vcprojin
new file mode 100644
index 00000000..caf6e928
--- /dev/null
+++ b/build/win32/vs9/pangoft2.vcprojin
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="pangoft2"
+ ProjectGUID="{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}"
+ RootNamespace="pangoft2"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines);HAVE_GLIB"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangoft2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangoft2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangoft2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="fontconfig.lib freetype.lib"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangoft2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\..\..\pango\pangoft2.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File RelativePath="..\..\..\modules\arabic\arabic-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_arabic_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\arabic\arabic-ot.c" />
+ <File RelativePath="..\..\..\modules\basic\basic-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_basic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_basic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_basic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_basic_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\hangul\hangul-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hangul_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hangul_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hangul_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hangul_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\hebrew\hebrew-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hebrew_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hebrew_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hebrew_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_hebrew_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\hebrew\hebrew-shaper.c" />
+ <File RelativePath="..\..\..\modules\indic\indic-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_indic_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\indic\indic-ot.c" />
+ <File RelativePath="..\..\..\modules\indic\indic-ot-class-tables.c" />
+ <File RelativePath="..\..\..\modules\indic\mprefixups.c" />
+ <File RelativePath="..\..\..\modules\khmer\khmer-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_khmer_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_khmer_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_khmer_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_khmer_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\syriac\syriac-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_syriac_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_syriac_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_syriac_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_syriac_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\syriac\syriac-ot.c" />
+ <File RelativePath="..\..\..\modules\thai\thai-charprop.c" />
+ <File RelativePath="..\..\..\modules\thai\thai-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_thai_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_thai_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_thai_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_thai_fc"
+ />
+ </FileConfiguration>
+ </File>
+ <File RelativePath="..\..\..\modules\thai\thai-shaper.c" />
+ <File RelativePath="..\..\..\modules\tibetan\tibetan-fc.c">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc"
+ />
+ </FileConfiguration>
+ </File>
+#include "opentype/libharfbuzz.sourcefiles"
+#include "libpangoft2.sourcefiles"
+ </Filter>
+ </Files>
+</VisualStudioProject>
diff --git a/build/win32/vs9/pangowin32.vcproj b/build/win32/vs9/pangowin32.vcproj
new file mode 100644
index 00000000..80e1f205
--- /dev/null
+++ b/build/win32/vs9/pangowin32.vcproj
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="pangowin32"
+ ProjectGUID="{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}"
+ RootNamespace="pangowin32"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="."
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangowin32.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangowin32.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="1"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;$(PangoDefines)"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangowin32.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ InheritedPropertySheets=".\pango.vsprops"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="$(PangoDefines)"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\$(PangoDllPrefix)$(ProjectName)$(PangoDllSuffix).dll"
+ LinkIncremental="2"
+ ModuleDefinitionFile="..\..\..\pango\pangowin32.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)-$(PangoApiVersion).lib"
+ TargetMachine="17"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\..\..\pango\pangowin32.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File RelativePath="..\..\..\modules\basic\basic-win32.c" />
+ <File RelativePath="..\..\..\pango\module-defs-win32.c" />
+ <File RelativePath="..\..\..\pango\pangowin32.c" />
+ <File RelativePath="..\..\..\pango\pangowin32-fontcache.c" />
+ <File RelativePath="..\..\..\pango\pangowin32-fontmap.c" />
+ </Filter>
+ </Files>
+</VisualStudioProject>
diff --git a/build/win32/vs9/stdint.h b/build/win32/vs9/stdint.h
new file mode 100644
index 00000000..fcab43a8
--- /dev/null
+++ b/build/win32/vs9/stdint.h
@@ -0,0 +1,36 @@
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned uint32_t;
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+typedef signed char int_least8_t;
+typedef unsigned char uint_least8_t;
+typedef short int_least16_t;
+typedef unsigned short uint_least16_t;
+typedef int int_least32_t;
+typedef unsigned uint_least32_t;
+typedef long long int_least64_t;
+typedef unsigned long long uint_least64_t;
+typedef char int_fast8_t;
+typedef unsigned char uint_fast8_t;
+typedef short int_fast16_t;
+typedef unsigned short uint_fast16_t;
+typedef int int_fast32_t;
+typedef unsigned int uint_fast32_t;
+typedef long long int_fast64_t;
+typedef unsigned long long uint_fast64_t;
+#ifdef _WIN64
+typedef __int64 intptr_t;
+#else
+typedef int intptr_t;
+#endif
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+typedef __int64 intmax_t;
+typedef unsigned __int64 uintmax_t;
diff --git a/build/win32/vs9/unistd.h b/build/win32/vs9/unistd.h
new file mode 100644
index 00000000..8655b1d5
--- /dev/null
+++ b/build/win32/vs9/unistd.h
@@ -0,0 +1 @@
+#include <io.h>
diff --git a/config.h.win32.in b/config.h.win32.in
new file mode 100644
index 00000000..1864ad04
--- /dev/null
+++ b/config.h.win32.in
@@ -0,0 +1,151 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+/* Actually, this version of config.h is manually edited from the above */
+
+/* Have usable Cairo library and font backend */
+#define HAVE_CAIRO 1
+
+/* Whether Cairo can use ATSUI for fonts */
+/* #undef HAVE_CAIRO_ATSUI */
+
+/* Whether Cairo can use FreeType for fonts */
+#define HAVE_CAIRO_FREETYPE 1
+
+/* Whether Cairo has PDF support */
+#define HAVE_CAIRO_PDF 1
+
+/* Whether Cairo has PNG support */
+#define HAVE_CAIRO_PNG 1
+
+/* Whether Cairo has PS support */
+#define HAVE_CAIRO_PS 1
+
+/* Whether Cairo can use the Win32 GDI for fonts */
+#define HAVE_CAIRO_WIN32 1
+
+/* Whether Cairo has Xlib support */
+/* #undef HAVE_CAIRO_XLIB */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_DIRENT_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the `flockfile' function. */
+/* #undef HAVE_FLOCKFILE */
+
+/* Have FreeType 2 library */
+#define HAVE_FREETYPE 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+/* #undef HAVE_GETPAGESIZE */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/*#undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+/* #undef HAVE_MEMORY_H */
+
+/* Define to 1 if you have the `mprotect' function. */
+/* #undef HAVE_MPROTECT */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strtok_r' function. */
+/* #undef HAVE_STRTOK_R */
+
+/* Define to 1 if you have the `sysconf' function. */
+/* #undef HAVE_SYSCONF */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+/* #undef HAVE_SYS_MMAN_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Have X libraries */
+/* #undef HAVE_X */
+
+/* Have Xft library */
+/* #undef HAVE_XFT */
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Module interface version */
+#define MODULE_VERSION "1.6.0"
+
+/* Name of package */
+#define PACKAGE "pango"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=pango"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "pango"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "pango @PANGO_VERSION"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "pango"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "@PANGO_VERSION@"
+
+/* PANGO binary age */
+#define PANGO_BINARY_AGE @PANGO_BINARY_AGE@
+
+/* PANGO interface age */
+#define PANGO_INTERFACE_AGE @PANGO_INTERFACE_AGE@
+
+/* PANGO major version */
+#define PANGO_VERSION_MAJOR @PANEG_VERSION_MAJOR@
+
+/* PANGO micro version */
+#define PANGO_VERSION_MICRO @PANGO_VERSION_MICRO@
+
+/* PANGO minor version */
+#define PANGO_VERSION_MINOR @PANGO_VERSION_MINOR@
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Whether to load modules via .la files rather than directly */
+/* #undef USE_LA_MODULES */
+
+/* Version number of package */
+#define VERSION "@PANGO_VERSION@"
+
+/* Define to 1 if the X Window System is missing or not being used. */
+/* #undef X_DISPLAY_MISSING */
diff --git a/configure.in b/configure.in
index b3fb74b4..8445bc2c 100644
--- a/configure.in
+++ b/configure.in
@@ -21,16 +21,13 @@ dnl
dnl The triplet
m4_define([pango_version_major], [1])
-m4_define([pango_version_minor], [26])
+m4_define([pango_version_minor], [29])
m4_define([pango_version_micro], [0])
m4_define([pango_version],
[pango_version_major.pango_version_minor.pango_version_micro])
dnl The X.Y in -lpango-X.Y line. This is expected to stay 1.0 until Pango 2.
m4_define([pango_api_version], [1.0])
-dnl Number of releases since we've added interfaces
-dnl XXX For 1.25 release simply remove it and make it automatic.
-m4_define([pango_interface_age], [0])
m4_if(m4_eval(pango_version_minor % 2), [1],
[
dnl for unstable releases
@@ -228,19 +225,6 @@ AC_ARG_ENABLE(rebuilds,
AM_CONDITIONAL(CROSS_COMPILING, [test $cross_compiling = yes])
-# define a MAINT-like variable REBUILD which is set if Perl
-# is found, so autogenerated sources can be rebuilt
-
-AC_CHECK_PROGS(PERL, perl5 perl)
-
-REBUILD=\#
-if test "x$enable_rebuilds" = "xyes" && \
- test -n "$PERL" && \
- $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
- REBUILD=
-fi
-AC_SUBST(REBUILD)
-
have_x=false
if test "x$pango_os_win32" != xyes; then
AC_PATH_XTRA
@@ -501,27 +485,8 @@ PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=tr
#
# Checks for GObject Introspection
#
-have_introspection=false
-PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.4, have_introspection=true, have_introspection=false)
-AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection)
-
-G_IR_SCANNER=
-G_IR_COMPILER=
-G_IR_GENERATE=
-GIRDIR=
-TYPELIBDIR=
-if $have_introspection; then
- G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
- G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
- G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
-fi
-AC_SUBST(G_IR_SCANNER)
-AC_SUBST(G_IR_COMPILER)
-AC_SUBST(G_IR_GENERATE)
-AC_SUBST(GIRDIR)
-AC_SUBST(TYPELIBDIR)
+
+GOBJECT_INTROSPECTION_CHECK([0.6.14])
#
# Modules to build
@@ -605,7 +570,7 @@ for module in $included_modules; do
*-win32) INCLUDED_WIN32_MODULES="$INCLUDED_WIN32_MODULES $included_path" ;;
*-atsui) INCLUDED_ATSUI_MODULES="$INCLUDED_ATSUI_MODULES $included_path" ;;
*-lang) INCLUDED_LANG_MODULES="$INCLUDED_LANG_MODULES $included_path" ;;
- *) AC_MSG_ERROR([specified module $module not recognized]) ;;
+ *) IFS="$pango_save_ifs" AC_MSG_ERROR([specified module $module not recognized]) ;;
esac
done
IFS="$pango_save_ifs"
@@ -798,9 +763,9 @@ for module in $included_modules; do
module_c=`echo $module | sed s/-/_/`
cat >> pango/module-defs.h <<EOTEXT
extern void _pango_${module_c}_script_engine_list (PangoEngineInfo **engines, int *n_engines);
-extern PangoEngine *_pango_${module_c}_script_engine_init (GTypeModule *module);
+extern void _pango_${module_c}_script_engine_init (GTypeModule *module);
extern void _pango_${module_c}_script_engine_exit (void);
-extern void _pango_${module_c}_script_engine_create (const char *id);
+extern PangoEngine *_pango_${module_c}_script_engine_create (const char *id);
EOTEXT
done
@@ -1002,6 +967,7 @@ pango/mini-fribidi/Makefile
pango/pango.rc
pango/pangoft2.rc
pango/pangowin32.rc
+pango/pangocairo.rc
pango/pangox.rc
pango/pangoxft.rc
pango-view/Makefile
@@ -1020,6 +986,9 @@ docs/Makefile
docs/version.xml
tools/Makefile
tests/Makefile
+build/Makefile
+build/win32/Makefile
+build/win32/vs9/Makefile
pango.pc
pangox.pc
pangowin32.pc
@@ -1033,6 +1002,7 @@ pangoft2-uninstalled.pc
pangoxft-uninstalled.pc
pangocairo-uninstalled.pc
pango-zip.sh
+config.h.win32
])
AC_CONFIG_FILES([tests/runtests.sh],
diff --git a/docs/pango-docs.sgml b/docs/pango-docs.sgml
index a3b47612..a769ec1f 100644
--- a/docs/pango-docs.sgml
+++ b/docs/pango-docs.sgml
@@ -135,4 +135,7 @@
<index id="index-1.26" role="1.26">
<title>Index of new symbols in 1.26</title>
</index>
+ <index id="index-1.28" role="1.28">
+ <title>Index of new symbols in 1.26</title>
+ </index>
</book>
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index e4cfbc92..7b89b875 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -891,6 +891,7 @@ pango_cairo_font_map_get_type
<FILE>atsui-fonts</FILE>
PANGO_RENDER_TYPE_ATSUI
pango_atsui_font_get_cgfont
+pango_atsui_font_get_atsfont
<SUBSECTION Standard>
PANGO_ATSUI_FONT
PANGO_ATSUI_FONT_CLASS
diff --git a/docs/tmpl/atsui-fonts.sgml b/docs/tmpl/atsui-fonts.sgml
index 0d851773..19b03445 100644
--- a/docs/tmpl/atsui-fonts.sgml
+++ b/docs/tmpl/atsui-fonts.sgml
@@ -35,3 +35,12 @@ g_quark_from_string()) is used to identify the renderer in pango_find_map().
@Returns:
+<!-- ##### FUNCTION pango_atsui_font_get_atsfont ##### -->
+<para>
+
+</para>
+
+@font:
+@Returns:
+
+
diff --git a/examples/Makefile.am b/examples/Makefile.am
index a2c5a2b8..4cb54baf 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -18,6 +18,7 @@ if HAVE_CAIRO_PNG
noinst_PROGRAMS += cairosimple cairotwisted cairoshape
cairosimple_LDADD = \
+ -lm \
../pango/libpango-$(PANGO_API_VERSION).la \
../pango/libpangocairo-$(PANGO_API_VERSION).la \
$(GLIB_LIBS) \
diff --git a/git.mk b/git.mk
index 088ef0b5..5ab41bab 100644
--- a/git.mk
+++ b/git.mk
@@ -172,8 +172,11 @@ gitignore-recurse-maybe:
$(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \
fi;
gitignore-recurse:
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
+ @for subdir in $(DIST_SUBDIRS); do \
+ case " $(SUBDIRS) " in \
+ *" $$subdir "*) :;; \
+ *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \
+ esac; \
done
gitignore: $(srcdir)/.gitignore gitignore-recurse
diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am
index 8035e3b3..646a61ec 100644
--- a/modules/basic/Makefile.am
+++ b/modules/basic/Makefile.am
@@ -47,7 +47,8 @@ endif
endif
pango_basic_win32_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS)
-pango_basic_win32_la_LIBADD = $(pangowin32libs) -lgdi32
+pango_basic_win32_la_LIBADD = $(pangowin32libs) -lgdi32 -lusp10
+libpango_basic_win32_la_LIBADD = -lgdi32 -lusp10
pango_basic_win32_la_SOURCES = basic-win32.c
libpango_basic_win32_la_SOURCES = basic-win32.c
libpango_basic_win32_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_basic_win32
diff --git a/modules/basic/basic-atsui.c b/modules/basic/basic-atsui.c
index a3df773d..369a596a 100644
--- a/modules/basic/basic-atsui.c
+++ b/modules/basic/basic-atsui.c
@@ -86,21 +86,24 @@ basic_engine_shape (PangoEngineShape *engine,
const char *p;
PangoATSUIFont *afont = PANGO_ATSUI_FONT (font);
ATSUStyle style;
- CGFontRef fontID;
+ ATSUFontID fontID;
ATSUAttributeTag styleTags[] = { kATSUFontTag };
ATSUAttributeValuePtr styleValues[] = { &fontID };
- ByteCount styleSizes[] = { sizeof (CGFontRef) };
+ ByteCount styleSizes[] = { sizeof (ATSUFontID) };
utf16 = g_utf8_to_utf16 (text, length, NULL, &n16, NULL);
- err = ATSUCreateTextLayout (&text_layout);
- err = ATSUSetTextPointerLocation (text_layout, utf16, 0, n16, n16);
+ err = ATSUCreateTextLayoutWithTextPtr (utf16, 0, n16, n16,
+ 0,
+ NULL,
+ NULL,
+ &text_layout);
err = ATSUCreateStyle(&style);
- fontID = pango_atsui_font_get_cgfont (afont);
+ fontID = pango_atsui_font_get_atsfont (afont);
err = ATSUSetAttributes(style,
- sizeof(styleTags) / sizeof(styleTags[0]),
+ (ItemCount)(sizeof(styleTags) / sizeof(styleTags[0])),
styleTags, styleSizes, styleValues);
err = ATSUSetRunStyle(text_layout,
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index b3619c3e..cd5cebea 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -27,6 +27,7 @@
#define PANGO_ENABLE_BACKEND 1 /* XXX */
#include <glib/gprintf.h>
+
#include "pango-engine.h"
#include "pango-utils.h"
#include "pangofc-font.h"
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index ecb139e0..7a27d501 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -30,6 +30,13 @@
#include <glib.h>
#include "pangowin32.h"
+
+extern HFONT _pango_win32_font_get_hfont (PangoFont *font);
+
+#ifndef PANGO_MODULE_PREFIX
+#define PANGO_MODULE_PREFIX _pango_basic_win32
+#endif
+
#include "pango-engine.h"
#include "pango-utils.h"
@@ -43,55 +50,8 @@ static gboolean pango_win32_debug = FALSE;
#include <usp10.h>
-static gboolean have_uniscribe = FALSE;
-
static HDC hdc;
-typedef HRESULT (WINAPI *pScriptGetProperties) (const SCRIPT_PROPERTIES ***,
- int *);
-
-typedef HRESULT (WINAPI *pScriptItemize) (const WCHAR *,
- int,
- int,
- const SCRIPT_CONTROL *,
- const SCRIPT_STATE *,
- SCRIPT_ITEM *,
- int *);
-
-typedef HRESULT (WINAPI *pScriptShape) (HDC,
- SCRIPT_CACHE *,
- const WCHAR *,
- int,
- int,
- SCRIPT_ANALYSIS *,
- WORD *,
- WORD *,
- SCRIPT_VISATTR *,
- int *);
-
-typedef HRESULT (WINAPI *pScriptPlace) (HDC,
- SCRIPT_CACHE *,
- const WORD *,
- int,
- const SCRIPT_VISATTR *,
- SCRIPT_ANALYSIS *,
- int *,
- GOFFSET *,
- ABC *);
-
-typedef HRESULT (WINAPI *pScriptFreeCache) (SCRIPT_CACHE *);
-
-typedef HRESULT (WINAPI *pScriptIsComplex) (WCHAR *,
- int,
- DWORD);
-
-static pScriptGetProperties script_get_properties;
-static pScriptItemize script_itemize;
-static pScriptShape script_shape;
-static pScriptPlace script_place;
-static pScriptFreeCache script_free_cache;
-static pScriptIsComplex script_is_complex;
-
#ifdef BASIC_WIN32_DEBUGGING
static const SCRIPT_PROPERTIES **scripts;
static int nscripts;
@@ -495,8 +455,7 @@ itemize_shape_and_place (PangoFont *font,
wchar_t *wtext,
int wlen,
const PangoAnalysis *analysis,
- PangoGlyphString *glyphs,
- SCRIPT_CACHE *script_cache)
+ PangoGlyphString *glyphs)
{
int i;
int item, nitems, item_step;
@@ -505,6 +464,11 @@ itemize_shape_and_place (PangoFont *font,
SCRIPT_STATE state;
SCRIPT_ITEM items[100];
double scale = pango_win32_font_get_metrics_factor (font);
+ HFONT hfont = _pango_win32_font_get_hfont (font);
+ static GHashTable *script_cache_hash = NULL;
+
+ if (!script_cache_hash)
+ script_cache_hash = g_hash_table_new (g_int64_hash, g_int64_equal);
memset (&control, 0, sizeof (control));
memset (&state, 0, sizeof (state));
@@ -517,8 +481,8 @@ itemize_shape_and_place (PangoFont *font,
g_print (G_STRLOC ": ScriptItemize: uDefaultLanguage:%04x uBidiLevel:%d\n",
control.uDefaultLanguage, state.uBidiLevel);
#endif
- if ((*script_itemize) (wtext, wlen, G_N_ELEMENTS (items), &control, NULL,
- items, &nitems))
+ if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items), &control, NULL,
+ items, &nitems))
{
#ifdef BASIC_WIN32_DEBUGGING
if (pango_win32_debug)
@@ -551,9 +515,11 @@ itemize_shape_and_place (PangoFont *font,
int advances[1000];
GOFFSET offsets[1000];
ABC abc;
- int script = items[item].a.eScript;
+ gint32 script = items[item].a.eScript;
int ng;
int char_offset;
+ SCRIPT_CACHE *script_cache;
+ gint64 font_and_script_key;
memset (advances, 0, sizeof (advances));
memset (offsets, 0, sizeof (offsets));
@@ -579,16 +545,40 @@ itemize_shape_and_place (PangoFont *font,
items[item].a.fNoGlyphIndex ? " fNoGlyphIndex" : "",
items[item].iCharPos, items[item+1].iCharPos-1, itemlen);
#endif
+ /* Create a hash key based on hfont and script engine */
+ font_and_script_key = (((gint64) ((gint32) hfont)) << 32) | script;
+
+ /* Get the script cache for this hfont and script */
+ script_cache = g_hash_table_lookup (script_cache_hash, &font_and_script_key);
+ if (!script_cache)
+ {
+ gint64 *key_n;
+ SCRIPT_CACHE *new_script_cache;
+
+ key_n = g_new (gint64, 1);
+ *key_n = font_and_script_key;
+
+ new_script_cache = g_new0 (SCRIPT_CACHE, 1);
+ script_cache = new_script_cache;
+
+ /* Insert the new value */
+ g_hash_table_insert (script_cache_hash, key_n, new_script_cache);
+
+#ifdef BASIC_WIN32_DEBUGGING
+ if (pango_win32_debug)
+ g_print (" New SCRIPT_CACHE for font %p and script %d\n", hfont, script);
+#endif
+ }
items[item].a.fRTL = analysis->level % 2;
- if ((*script_shape) (hdc, &script_cache[script],
- wtext + items[item].iCharPos, itemlen,
- G_N_ELEMENTS (iglyphs),
- &items[item].a,
- iglyphs,
- log_clusters,
- visattrs,
- &nglyphs))
+ if (ScriptShape (hdc, script_cache,
+ wtext + items[item].iCharPos, itemlen,
+ G_N_ELEMENTS (iglyphs),
+ &items[item].a,
+ iglyphs,
+ log_clusters,
+ visattrs,
+ &nglyphs))
{
#ifdef BASIC_WIN32_DEBUGGING
if (pango_win32_debug)
@@ -611,9 +601,9 @@ itemize_shape_and_place (PangoFont *font,
nglyphs, glyphs->log_clusters + ng,
char_offset);
- if ((*script_place) (hdc, &script_cache[script], iglyphs, nglyphs,
- visattrs, &items[item].a,
- advances, offsets, &abc))
+ if (ScriptPlace (hdc, script_cache, iglyphs, nglyphs,
+ visattrs, &items[item].a,
+ advances, offsets, &abc))
{
#ifdef BASIC_WIN32_DEBUGGING
if (pango_win32_debug)
@@ -671,9 +661,7 @@ uniscribe_shape (PangoFont *font,
{
wchar_t *wtext;
long wlen;
- int i;
gboolean retval = TRUE;
- SCRIPT_CACHE script_cache[100];
if (!pango_win32_font_select_font (font, hdc))
return FALSE;
@@ -684,11 +672,7 @@ uniscribe_shape (PangoFont *font,
if (retval)
{
- memset (script_cache, 0, sizeof (script_cache));
- retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs, script_cache);
- for (i = 0; i < G_N_ELEMENTS (script_cache); i++)
- if (script_cache[i])
- (*script_free_cache)(&script_cache[i]);
+ retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs);
}
if (retval)
@@ -726,7 +710,7 @@ text_is_simple (const char *text,
if (wtext == NULL)
return TRUE;
- retval = ((*script_is_complex) (wtext, wlen, SIC_COMPLEX) == S_FALSE);
+ retval = (ScriptIsComplex (wtext, wlen, SIC_COMPLEX) == S_FALSE);
g_free (wtext);
@@ -756,8 +740,7 @@ basic_engine_shape (PangoEngineShape *engine,
g_return_if_fail (length >= 0);
g_return_if_fail (analysis != NULL);
- if (have_uniscribe &&
- !text_is_simple (text, length) &&
+ if (!text_is_simple (text, length) &&
uniscribe_shape (font, text, length, analysis, glyphs))
return;
@@ -846,33 +829,10 @@ basic_engine_shape (PangoEngineShape *engine,
static void
init_uniscribe (void)
{
- HMODULE usp10_dll;
-
- have_uniscribe = FALSE;
-
- if ((usp10_dll = LoadLibrary ("usp10.dll")) != NULL)
- {
- (script_get_properties = (pScriptGetProperties)
- GetProcAddress (usp10_dll, "ScriptGetProperties")) &&
- (script_itemize = (pScriptItemize)
- GetProcAddress (usp10_dll, "ScriptItemize")) &&
- (script_shape = (pScriptShape)
- GetProcAddress (usp10_dll, "ScriptShape")) &&
- (script_place = (pScriptPlace)
- GetProcAddress (usp10_dll, "ScriptPlace")) &&
- (script_free_cache = (pScriptFreeCache)
- GetProcAddress (usp10_dll, "ScriptFreeCache")) &&
- (script_is_complex = (pScriptIsComplex)
- GetProcAddress (usp10_dll, "ScriptIsComplex")) &&
- (have_uniscribe = TRUE);
- }
- if (have_uniscribe)
- {
#ifdef BASIC_WIN32_DEBUGGING
- (*script_get_properties) (&scripts, &nscripts);
+ ScriptGetProperties (&scripts, &nscripts);
#endif
- hdc = pango_win32_get_dc ();
- }
+ hdc = pango_win32_get_dc ();
}
static void
@@ -909,28 +869,25 @@ PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines,
script_engines[0].scripts = basic_scripts;
script_engines[0].n_scripts = G_N_ELEMENTS (basic_scripts);
- if (have_uniscribe)
- {
#if 0
- int i;
- GArray *ranges = g_array_new (FALSE, FALSE, sizeof (PangoEngineRange));
+ int i;
+ GArray *ranges = g_array_new (FALSE, FALSE, sizeof (PangoEngineRange));
- /* Walk through scripts supported by the Uniscribe implementation on this
- * machine, and mark corresponding Unicode ranges.
- */
- for (i = 0; i < nscripts; i++)
- {
- }
+ /* Walk through scripts supported by the Uniscribe implementation on this
+ * machine, and mark corresponding Unicode ranges.
+ */
+ for (i = 0; i < nscripts; i++)
+ {
+ }
- /* Sort range array */
- g_array_sort (ranges, compare_range);
- script_engines[0].ranges = ranges;
- script_engines[0].n_ranges = ranges->len;
+ /* Sort range array */
+ g_array_sort (ranges, compare_range);
+ script_engines[0].ranges = ranges;
+ script_engines[0].n_ranges = ranges->len;
#else
- script_engines[0].scripts = uniscribe_scripts;
- script_engines[0].n_scripts = G_N_ELEMENTS (uniscribe_scripts);
+ script_engines[0].scripts = uniscribe_scripts;
+ script_engines[0].n_scripts = G_N_ELEMENTS (uniscribe_scripts);
#endif
- }
*engines = script_engines;
*n_engines = G_N_ELEMENTS (script_engines);
diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c
index fcfed2b4..12f25c5e 100644
--- a/modules/hebrew/hebrew-fc.c
+++ b/modules/hebrew/hebrew-fc.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <pango/pango-ot.h>
+
#include "pango-engine.h"
#include "pango-utils.h"
#include "pangofc-font.h"
diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c
index 6ba90c1a..3a232be4 100644
--- a/modules/indic/indic-fc.c
+++ b/modules/indic/indic-fc.c
@@ -252,6 +252,7 @@ indic_engine_shape (PangoEngineShape *engine,
pango_glyph_string_set_size (glyphs, n_glyphs);
buffer = pango_ot_buffer_new (fc_font);
+ pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0);
set_glyphs(font, wc_out, tags, n_glyphs, buffer,
(indic_shape_engine->classTable->scriptFlags & SF_PROCESS_ZWJ) != 0);
diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c
index a3915208..dc01b6fe 100644
--- a/modules/indic/indic-lang.c
+++ b/modules/indic/indic-lang.c
@@ -34,6 +34,73 @@ typedef PangoEngineLangClass IndicEngineLangClass;
#define INDIC_ENGINE_INFO(script) \
{#script ENGINE_SUFFIX, PANGO_ENGINE_TYPE_LANG, RENDER_TYPE, script##_scripts, G_N_ELEMENTS(script##_scripts)}
+#define DEV_RRA 0x0931 /* 0930 + 093c */
+#define DEV_QA 0x0958 /* 0915 + 093c */
+#define DEV_YA 0x095F /* 092f + 003c */
+#define DEV_KHHA 0x0959
+#define DEV_GHHA 0x095A
+#define DEV_ZA 0x095B
+#define DEV_DDDHA 0x095C
+#define DEV_RHA 0x095D
+#define DEV_FA 0x095E
+#define DEV_YYA 0x095F
+
+/* Bengali */
+/* for split matras in all brahmi based script */
+#define BENGALI_SIGN_O 0x09CB /* 09c7 + 09be */
+#define BENGALI_SIGN_AU 0x09CC /* 09c7 + 09d7 */
+#define BENGALI_RRA 0x09DC
+#define BENGALI_RHA 0x09DD
+#define BENGALI_YYA 0x09DF
+
+/* Gurumukhi */
+#define GURUMUKHI_LLA 0x0A33
+#define GURUMUKHI_SHA 0x0A36
+#define GURUMUKHI_KHHA 0x0A59
+#define GURUMUKHI_GHHA 0x0A5A
+#define GURUMUKHI_ZA 0x0A5B
+#define GURUMUKHI_RRA 0x0A5C
+#define GURUMUKHI_FA 0x0A5E
+
+/* Oriya */
+#define ORIYA_AI 0x0B48
+#define ORIYA_O 0x0B4B
+#define ORIYA_AU 0x0B4C
+
+/* Telugu */
+#define TELUGU_EE 0x0C47
+#define TELUGU_AI 0x0C48
+
+/* Tamil */
+#define TAMIL_O 0x0BCA
+#define TAMIL_OO 0x0BCB
+#define TAMIL_AU 0x0BCC
+
+/* Kannada */
+#define KNDA_EE 0x0CC7
+#define KNDA_AI 0x0CC8
+#define KNDA_O 0x0CCA
+#define KNDA_OO 0x0CCB
+
+/* Malayalam */
+#define MLYM_O 0x0D4A
+#define MLYM_OO 0x0D4B
+#define MLYM_AU 0x0D4C
+
+#define IS_COMPOSITE_WITH_BRAHMI_NUKTA(c) ( \
+ (c >= BENGALI_RRA && c <= BENGALI_YYA) || \
+ (c >= DEV_QA && c <= DEV_YA) || (c == DEV_RRA) || (c >= DEV_KHHA && c <= DEV_YYA) || \
+ (c >= KNDA_EE && c <= KNDA_AI) ||(c >= KNDA_O && c <= KNDA_OO) || \
+ (c == TAMIL_O) || (c == TAMIL_OO) || (c == TAMIL_AU) || \
+ (c == TELUGU_EE) || (c == TELUGU_AI) || \
+ (c == ORIYA_AI) || (c == ORIYA_O) || (c == ORIYA_AU) || \
+ (c >= GURUMUKHI_KHHA && c <= GURUMUKHI_RRA) || (c == GURUMUKHI_FA)|| (c == GURUMUKHI_LLA)|| (c == GURUMUKHI_SHA) || \
+ FALSE)
+#define IS_SPLIT_MATRA_BRAHMI(c) ( \
+ (c == BENGALI_SIGN_O) || (c == BENGALI_SIGN_AU) || \
+ (c >= MLYM_O && c <= MLYM_AU) || \
+ FALSE)
+
static PangoEngineScriptInfo deva_scripts[] = {
{ PANGO_SCRIPT_DEVANAGARI, "*" }
@@ -110,6 +177,12 @@ indic_engine_break (PangoEngineLang *engine G_GNUC_UNUSED,
{
this_wc = g_utf8_get_char (p);
next = g_utf8_next_char (p);
+
+ if (G_UNLIKELY (
+ IS_COMPOSITE_WITH_BRAHMI_NUKTA(this_wc) || IS_SPLIT_MATRA_BRAHMI(this_wc))) {
+ attrs[i+1].backspace_deletes_character = FALSE;
+ }
+
if (next != NULL && next < (text + length))
{
next_wc = g_utf8_get_char (next);
diff --git a/modules/indic/indic-ot-class-tables.c b/modules/indic/indic-ot-class-tables.c
index a2dc7613..fca63aec 100644
--- a/modules/indic/indic-ot-class-tables.c
+++ b/modules/indic/indic-ot-class-tables.c
@@ -123,7 +123,7 @@ static const IndicOTCharClass bengCharClasses[] =
_rv, _xx, _ct, _xx, _xx, _xx, _ct, _ct, _ct, _ct, _xx, _xx, _nu, _xx, _dr, _dl, /* 09B0 - 09BF */
_dr, _db, _db, _db, _db, _xx, _xx, _dl, _dl, _xx, _xx, _s1, _s2, _vr, _xx, _xx, /* 09C0 - 09CF */
_xx, _xx, _xx, _xx, _xx, _xx, _xx, _dr, _xx, _xx, _xx, _xx, _cn, _cn, _xx, _cn, /* 09D0 - 09DF */
- _iv, _iv, _dv, _dv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 09E0 - 09EF */
+ _iv, _iv, _db, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 09E0 - 09EF */
_rv, _ct, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 09F0 - 09FA */
};
@@ -136,7 +136,7 @@ static const IndicOTCharClass guruCharClasses[] =
_dr, _db, _db, _xx, _xx, _xx, _xx, _da, _da, _xx, _xx, _da, _da, _vr, _xx, _xx, /* 0A40 - 0A4F */
_xx, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _cn, _cn, _cn, _ct, _xx, _cn, _xx, /* 0A50 - 0A5F */
_xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0A60 - 0A6F */
- _ma, _ma, _ct, _ct, _xx, _db /* 0A70 - 0A75 */
+ _ma, _ma, _iv, _iv, _xx, _db /* 0A70 - 0A75 */
};
static const IndicOTCharClass gujrCharClasses[] =
@@ -164,7 +164,7 @@ static const IndicOTCharClass oryaCharClasses[] =
static const IndicOTCharClass tamlCharClasses[] =
{
- _xx, _xx, _ma, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, /* 0B80 - 0B8F */
+ _xx, _xx, _ma, _xx, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, /* 0B80 - 0B8F */
_iv, _xx, _iv, _iv, _iv, _ct, _xx, _xx, _xx, _ct, _ct, _xx, _ct, _xx, _ct, _ct, /* 0B90 - 0B9F */
_xx, _xx, _xx, _ct, _ct, _xx, _xx, _xx, _ct, _ct, _ct, _xx, _xx, _xx, _ct, _ct, /* 0BA0 - 0BAF */
_ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _dr, _dr, /* 0BB0 - 0BBF */
@@ -181,9 +181,9 @@ static const IndicOTCharClass teluCharClasses[] =
_iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C10 - 0C1F */
_bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C20 - 0C2F */
_bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _xx, _xx, _da, _da, /* 0C30 - 0C3F */
- _da, _dr, _dr, _dr, _dr, _xx, _da, _da, _s1, _xx, _da, _da, _da, _vr, _xx, _xx, /* 0C40 - 0C4F */
+ _da, _dr, _dr, _lm, _lm, _xx, _da, _da, _s1, _xx, _da, _da, _da, _vr, _xx, _xx, /* 0C40 - 0C4F */
_xx, _xx, _xx, _xx, _xx, _da, _db, _xx, _bb, _bb, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C50 - 0C5F */
- _iv, _iv, _db, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C60 - 0C6F */
+ _iv, _iv, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C60 - 0C6F */
_xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 0C70 - 0C7F */
};
@@ -200,7 +200,7 @@ static const IndicOTCharClass kndaCharClasses[] =
_xx, _xx, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, _iv, /* 0C80 - 0C8F */
_iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C90 - 0C9F */
_bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, /* 0CA0 - 0CAF */
- _rb, _ct, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _nu, _xx, _dr, _da, /* 0CB0 - 0CBF */
+ _rb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _nu, _xx, _dr, _da, /* 0CB0 - 0CBF */
_s1, _dr, _dr, _lm, _lm, _xx, _da, _s2, _s3, _xx, _s4, _s5, _da, _vr, _xx, _xx, /* 0CC0 - 0CCF */
_xx, _xx, _xx, _xx, _xx, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _ct, _xx, /* 0CD0 - 0CDF */
_iv, _iv, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 0CE0 - 0CEF */
diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c
index 04c5c830..14357d78 100644
--- a/modules/khmer/khmer-fc.c
+++ b/modules/khmer/khmer-fc.c
@@ -481,6 +481,7 @@ khmer_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
return;
buffer = pango_ot_buffer_new (fc_font);
+ pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0);
wcs = g_utf8_to_ucs4_fast (text, length, &n_chars);
diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c
index 66dccbb4..80c945da 100644
--- a/modules/thai/thai-fc.c
+++ b/modules/thai/thai-fc.c
@@ -32,6 +32,7 @@
#include <glib.h>
#include "pango-ot.h"
+
#include "pango-engine.h"
#include "pangofc-font.h"
@@ -298,6 +299,7 @@ thai_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
thai_set_glyphs (font_info, text, length, analysis->script, glyphs);
buffer = pango_ot_buffer_new (PANGO_FC_FONT (font));
+ pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0);
for (i = 0; i < glyphs->num_glyphs; i++)
pango_ot_buffer_add_glyph (buffer,
diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c
index 51600fc8..4e894165 100644
--- a/modules/tibetan/tibetan-fc.c
+++ b/modules/tibetan/tibetan-fc.c
@@ -443,6 +443,7 @@ tibetan_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
return;
buffer = pango_ot_buffer_new (fc_font);
+ pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0);
wcs = g_utf8_to_ucs4_fast (text, length, &n_chars);
diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am
index 7a5e25ed..dbfd81a0 100644
--- a/pango-view/Makefile.am
+++ b/pango-view/Makefile.am
@@ -84,20 +84,25 @@ endif
#########################################################
-MAINTAINERCLEANFILES = pango-view.1
+MAINTAINERCLEANFILES = pango-view.1.in
+EXTRA_DIST += pango-view.1.in
+CLEANFILES += pango-view.1
-dist_man_MANS = pango-view.1
+nodist_man_MANS = pango-view.1
-$(srcdir)/pango-view.1: ../configure.in $(pango_view_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) pango-view$(EXEEXT)
- $(AM_V_GEN) $(top_builddir)/missing --run \
+# The indirection through pango-view.1.in is to make parallel build work.
+# See bug 587768.
+$(srcdir)/pango-view.1.in: ../configure.in $(pango_view_SOURCES)
+ $(AM_V_GEN) $(top_srcdir)/missing --run \
help2man --no-info --section=1 \
--help-option="--help-all" --output="$@.tmp" \
--name 'Pango text viewer' ./pango-view \
&& mv "$@.tmp" "$@" \
- || ($(RM) "$@"; \
- echo Failed to update pango-view.1, the man page may be outdated >&2; \
+ || (echo Failed to update pango-view.1, the man page may be outdated >&2; \
(test -f "$@" || echo help2man is required to generate this file. >> "$@"));
+pango-view.1: pango-view$(EXEEXT)
+ $(AM_V_GEN) $(MAKE) $(AM_MAKEFLAGS) pango-view.1.in && \
+ cp $(srcdir)/pango-view.1.in $@
#########################################################
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index c698b459..8e3cc7f8 100644
--- a/pango-view/viewer-render.c
+++ b/pango-view/viewer-render.c
@@ -34,10 +34,14 @@
gboolean opt_display = TRUE;
int opt_dpi = 96;
+gboolean opt_pixels = FALSE;
const char *opt_font = "";
gboolean opt_header = FALSE;
const char *opt_output = NULL;
-int opt_margin = 10;
+int opt_margin_t = 10;
+int opt_margin_r = 10;
+int opt_margin_b = 10;
+int opt_margin_l = 10;
int opt_markup = FALSE;
gboolean opt_rtl = FALSE;
double opt_rotate = 0;
@@ -247,8 +251,8 @@ do_output (PangoContext *context,
PangoMatrix *orig_matrix;
gboolean supports_matrix;
int rotated_width, rotated_height;
- int x = opt_margin;
- int y = opt_margin;
+ int x = opt_margin_l;
+ int y = opt_margin_t;
int width, height;
width = 0;
@@ -330,8 +334,8 @@ do_output (PangoContext *context,
width = MAX (width, rect.width);
height += rect.height;
- width += 2 * opt_margin;
- height += 2 * opt_margin;
+ width += opt_margin_l + opt_margin_r;
+ height += opt_margin_t + opt_margin_b;
if (width_out)
*width_out = width;
@@ -542,6 +546,30 @@ parse_background (const char *name,
name, arg, data, error);
}
+static gboolean
+parse_margin (const char *name G_GNUC_UNUSED,
+ const char *arg,
+ gpointer data G_GNUC_UNUSED,
+ GError **error)
+{
+ switch (sscanf (arg, "%d %d %d %d", &opt_margin_t, &opt_margin_r, &opt_margin_b, &opt_margin_l))
+ {
+ case 0:
+ {
+ g_set_error(error,
+ G_OPTION_ERROR,
+ G_OPTION_ERROR_BAD_VALUE,
+ "Argument for --margin must be one to four space-separated numbers");
+ return FALSE;
+ }
+ case 1: opt_margin_r = opt_margin_t;
+ case 2: opt_margin_b = opt_margin_t;
+ case 3: opt_margin_l = opt_margin_r;
+ }
+ return TRUE;
+}
+
+
static gchar *
backends_to_string (void)
{
@@ -622,7 +650,7 @@ parse_backend (const char *name G_GNUC_UNUSED,
}
-static gboolean
+static G_GNUC_NORETURN gboolean
show_version(const char *name G_GNUC_UNUSED,
const char *arg G_GNUC_UNUSED,
gpointer data G_GNUC_UNUSED,
@@ -679,14 +707,16 @@ parse_options (int argc, char *argv[])
"Align paragraph lines to be justified", NULL},
{"language", 0, 0, G_OPTION_ARG_STRING, &opt_language,
"Language to use for font selection", "en_US/etc"},
- {"margin", 0, 0, G_OPTION_ARG_INT, &opt_margin,
- "Set the margin on the output in pixels", "pixels"},
+ {"margin", 0, 0, G_OPTION_ARG_CALLBACK, &parse_margin,
+ "Set the margin on the output in pixels", "CSS-style numbers in pixels"},
{"markup", 0, 0, G_OPTION_ARG_NONE, &opt_markup,
"Interpret text as Pango markup", NULL},
{"output", 'o', 0, G_OPTION_ARG_STRING, &opt_output,
"Save rendered image to output file", "file"},
{"pangorc", 0, 0, G_OPTION_ARG_STRING, &opt_pangorc,
"pangorc file to use (default is ./pangorc)", "file"},
+ {"pixels", 0, 0, G_OPTION_ARG_NONE, &opt_pixels,
+ "Use pixel units instead of points (sets dpi to 72)", NULL},
{"rtl", 0, 0, G_OPTION_ARG_NONE, &opt_rtl,
"Set base direction to right-to-left", NULL},
{"rotate", 0, 0, G_OPTION_ARG_DOUBLE, &opt_rotate,
@@ -736,6 +766,9 @@ parse_options (int argc, char *argv[])
g_free(backend_options);
g_free(backend_desc);
+ if (opt_pixels)
+ opt_dpi = 72;
+
if ((opt_text && argc != 1) || (!opt_text && argc != 2))
{
if (opt_text && argc != 1)
diff --git a/pango/Makefile.am b/pango/Makefile.am
index e1285b5d..7e033b42 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -4,8 +4,11 @@
# which are more like other make's VPATH.
GPATH = $(srcdir)
-EXTRA_DIST =
-BUILT_GIRSOURCES =
+include $(INTROSPECTION_MAKEFILE)
+
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = --warn-all --add-include-path=$(srcdir) --add-include-path=.
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=.
SUBDIRS = mini-fribidi
@@ -36,7 +39,7 @@ endif
# ------------------- libpango -------------------
lib_LTLIBRARIES = libpango-1.0.la
-BUILT_GIRSOURCES += Pango-1.0.gir
+INTROSPECTION_GIRS += Pango-1.0.gir
libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS)
libpango_1_0_la_LIBADD = \
@@ -124,8 +127,7 @@ pangoinclude_HEADERS = \
pango-enum-types.h
pango-enum-types.h: s-enum-types-h
- $(AM_V_GEN) true
-s-enum-types-h: @REBUILD@ $(pango_headers) Makefile
+s-enum-types-h: $(pango_headers) Makefile.am
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
@@ -137,8 +139,7 @@ s-enum-types-h: @REBUILD@ $(pango_headers) Makefile
&& echo timestamp > $(@F)
pango-enum-types.c: s-enum-types-c
- $(AM_V_GEN) true
-s-enum-types-c: @REBUILD@ $(pango_headers) Makefile
+s-enum-types-c: $(pango_headers) Makefile.am
$(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#include <pango.h>" \
--fprod "\n/* enumerations from \"@filename@\" */" \
@@ -153,25 +154,17 @@ s-enum-types-c: @REBUILD@ $(pango_headers) Makefile
pango-features.h:
$(AM_V_GEN) cd $(top_builddir) && ./config.status pango/pango-features.h
-Pango-1.0.gir: $(libpango_1_0_la_SOURCES)
-Pango-1.0.gir: $(pango_headers)
-Pango-1.0.gir: libpango-1.0.la
-Pango-1.0.gir: $(G_IR_SCANNER) Makefile
- $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace Pango --nsversion=1.0 \
- --add-include-path=$(srcdir) --add-include-path=. \
- --include=GObject-2.0 \
- --include=cairo-1.0 \
- --library=libpango-1.0.la \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg cairo \
- --pkg freetype2 \
- -I$(top_srcdir) \
- $(PANGO_CFLAGS) \
- $(libpango_1_0_la_SOURCES) \
+pango_introspection_files = \
+ $(libpango_1_0_la_SOURCES) \
$(pango_headers) \
- pango-enum-types.h
+ pango-enum-types.h
+Pango-1.0.gir: libpango-1.0.la
+
+Pango_1_0_gir_PACKAGES = gobject-2.0 cairo freetype2
+Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0
+Pango_1_0_gir_LIBS = libpango-1.0.la
+Pango_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS)
+Pango_1_0_gir_FILES = $(filter-out %-private.h, $(pango_introspection_files))
# ------------------- libpangox -------------------
@@ -217,7 +210,7 @@ libpangox_1_0_la_SOURCES = \
if HAVE_FREETYPE
pangoinclude_HEADERS += $(pangoft2_headers)
lib_LTLIBRARIES += libpangoft2-1.0.la
-BUILT_GIRSOURCES += PangoFT2-1.0.gir
+INTROSPECTION_GIRS += PangoFT2-1.0.gir
endif
pangoft2_headers = \
@@ -267,32 +260,25 @@ endif
pangoft2-win32-res.o: pangoft2.rc
$(AM_V_GEN) $(WINDRES) $< $@
-PangoFT2-1.0.gir: $(pangoft2_headers)
-PangoFT2-1.0.gir: $(libpangoft2_1_0_la_SOURCES)
+pangoft2_introspection_files = \
+ $(pangoft2_headers) \
+ $(pangoft2_public_sources)
+
PangoFT2-1.0.gir: libpangoft2-1.0.la
-PangoFT2-1.0.gir: Pango-1.0.gir $(G_IR_SCANNER) Makefile
- $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoFT2 --nsversion=1.0 \
- --add-include-path=$(srcdir) --add-include-path=. \
- --include=GObject-2.0 \
- --include=Pango-1.0 \
- --include=freetype2-2.0 \
- --include=fontconfig-2.0 \
- --library=libpangoft2-1.0.la \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg freetype2 \
- --pkg pangoft2 \
- -I$(top_srcdir) \
- $(pangoft2_headers) \
- $(pangoft2_public_sources)
+PangoFT2-1.0.gir: Pango-1.0.gir
+
+PangoFT2_1_0_gir_PACKAGES = gobject-2.0 freetype2 pangoft2
+PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 freetype2-2.0 fontconfig-2.0
+PangoFT2_1_0_gir_LIBS = libpangoft2-1.0.la
+PangoFT2_1_0_gir_CFLAGS = -I$(top_srcdir)
+PangoFT2_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoft2_introspection_files)))
# ------------------- libpangoxft -------------------
if HAVE_XFT
pangoinclude_HEADERS += $(pangoxft_headers)
lib_LTLIBRARIES += libpangoxft-1.0.la
-BUILT_GIRSOURCES += PangoXft-1.0.gir
+INTROSPECTION_GIRS += PangoXft-1.0.gir
endif
pangoxft_headers = pangoxft.h pangoxft-render.h
@@ -323,33 +309,25 @@ libpangoxft_1_0_la_SOURCES = \
pangoxft-private.h \
pangoxft-render.c
+pangoxft_introspection_files = \
+ $(pangoxft_headers) \
+ $(libpangoxft_1_0_la_SOURCES)
-PangoXft-1.0.gir: $(pangoxft_headers)
-PangoXft-1.0.gir: $(libpangoxft_1_0_la_SOURCES)
PangoXft-1.0.gir: libpangoxft-1.0.la
-PangoXft-1.0.gir: Pango-1.0.gir PangoFT2-1.0.gir $(G_IR_SCANNER) Makefile
- $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoXft --nsversion=1.0 \
- --add-include-path=$(srcdir) --add-include-path=. \
- --include=GObject-2.0 \
- --include=xft-2.0 \
- --include=xlib-2.0 \
- --include=PangoFT2-1.0 \
- --library=libpangoxft-1.0.la \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg freetype2 \
- -I$(top_srcdir) \
- $(PANGO_CFLAGS) \
- $(pangoxft_headers) \
- $(libpangoxft_1_0_la_SOURCES)
+PangoXft-1.0.gir: PangoFT2-1.0.gir
+
+PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2
+PangoXft_1_0_gir_INCLUDES = GObject-2.0 PangoFT2-1.0 xft-2.0 xlib-2.0
+PangoXft_1_0_gir_LIBS = libpangoxft-1.0.la
+PangoXft_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS)
+PangoXft_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoxft_introspection_files)))
# ------------------- libpangocairo -------------------
if HAVE_CAIRO
pangoinclude_HEADERS += $(pangocairo_headers)
lib_LTLIBRARIES += libpangocairo-1.0.la
-BUILT_GIRSOURCES += PangoCairo-1.0.gir
+INTROSPECTION_GIRS += PangoCairo-1.0.gir
endif
pangocairo_headers = pangocairo.h
@@ -362,18 +340,23 @@ libpangocairo_1_0_la_LIBADD = \
$(libm)
libpangocairo_1_0_la_DEPENDENCIES = \
libpango-$(PANGO_API_VERSION).la
-libpangocairo_1_0_la_SOURCES = \
+pangocairo_core_sources = \
pangocairo-context.c \
pangocairo-font.c \
pangocairo-fontmap.c \
pangocairo-render.c \
pangocairo-private.h
+libpangocairo_1_0_la_SOURCES = $(pangocairo_core_sources)
+
if HAVE_CAIRO_WIN32
if PLATFORM_WIN32
-libpangocairo_1_0_la_LDFLAGS += -export-symbols $(srcdir)/pangocairo.def
-libpangocairo_1_0_la_DEPENDENCIES += pangocairo.def
+libpangocairo_1_0_la_LDFLAGS += -export-symbols $(srcdir)/pangocairo.def -Wl,pangocairo-win32-res.o
+libpangocairo_1_0_la_DEPENDENCIES += pangocairo-win32-res.o pangocairo.def
endif
+pangocairo-win32-res.o: pangocairo.rc
+ $(AM_V_GEN) $(WINDRES) $< $@
+
libpangocairo_1_0_la_LIBADD += libpangowin32-$(PANGO_API_VERSION).la $(WIN32_LIBS)
libpangocairo_1_0_la_DEPENDENCIES += libpangowin32-$(PANGO_API_VERSION).la
@@ -413,26 +396,18 @@ libpangocairo_1_0_la_LIBADD += $(INCLUDED_ATSUI_MODULES)
PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoATSUI-1.0
endif
-PangoCairo-1.0.gir: $(libpangocairo_1_0_la_SOURCES)
-PangoCairo-1.0.gir: $(pangocairo_headers)
+pangocairo_introspection_files = \
+ $(libpangocairo_1_0_la_SOURCES) \
+ $(pangocairo_headers)
+
PangoCairo-1.0.gir: libpangocairo-1.0.la
-PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir $(G_IR_SCANNER) Makefile
- $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoCairo --nsversion=1.0 \
- --add-include-path=$(srcdir) --add-include-path=. \
- --include=GObject-2.0 \
- --include=cairo-1.0 \
- --include=Pango-1.0 \
- --add-include-path=. \
- --include=$(PANGOCAIRO_FONT_BACKEND_GI_MODULE) \
- --library=libpangocairo-1.0.la \
- --libtool="$(LIBTOOL)" \
- --output $@ \
- --pkg gobject-2.0 \
- --pkg cairo \
- -I$(top_srcdir) \
- $(PANGO_CFLAGS) \
- $(libpangocairo_1_0_la_SOURCES) \
- $(pangocairo_headers)
+PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir
+
+PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo
+PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 $(PANGOCAIRO_FONT_BACKEND_GI_MODULE)
+PangoCairo_1_0_gir_LIBS = libpangocairo-1.0.la
+PangoCairo_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS)
+PangoCairo_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangocairo_introspection_files)))
# ------------------- libpangowin32 -------------------
@@ -543,14 +518,11 @@ pangocairo-$(PANGO_API_VERSION).lib: libpangocairo-$(PANGO_API_VERSION).la $(src
if HAVE_INTROSPECTION
-girdir = $(GIRDIR)
-gir_DATA = $(BUILT_GIRSOURCES)
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
-typelibsdir = $(TYPELIBDIR)
-typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
-
-%.typelib: %.gir $(G_IR_COMPILER)
- $(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F)
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
endif # HAVE_INTROSPECTION
@@ -579,9 +551,11 @@ pango_querymodules_LDADD += libpangowin32-$(PANGO_API_VERSION).la
endif
pango_querymodules_LDADD += libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS)
-EXTRA_DIST += \
+EXTRA_DIST = \
pango-enum-types.h \
module-defs.h \
+ module-defs.h.win32 \
+ module-defs-lang.c.win32 \
module-defs-fc.c.win32 \
module-defs-win32.c.win32 \
pango.def \
@@ -596,6 +570,8 @@ EXTRA_DIST += \
pangoft2.rc.in \
pangowin32.rc \
pangowin32.rc.in \
+ pangocairo.rc \
+ pangocairo.rc.in \
pangox.rc \
pangox.rc.in \
pangoxft.rc \
@@ -628,7 +604,9 @@ CLEANFILES = \
pango-enum-types.h \
s-enum-types-h \
pango-enum-types.c \
- s-enum-types-c
+ s-enum-types-c \
+ $(INTROSPECTION_GIRS) \
+ $(INTROSPECTION_GIRS:.gir=.typelib)
MOSTLYCLEANFILES = \
*.list \
@@ -651,4 +629,43 @@ uninstall-local: uninstall-ms-lib uninstall-def-files
TESTS = check.defs
+dist-hook: \
+ ../build/win32/vs9/pango.vcproj \
+ ../build/win32/vs9/pangoft2.vcproj \
+ ../build/win32/vs9/pangocairo.vcproj
+
+# pangowin32.vcproj is not automatically built, it is not being changed
+
+../build/win32/vs9/pango.vcproj: $(top_srcdir)/build/win32/vs9/pango.vcprojin mini-fribidi/libmini-fribidi.sourcefiles
+ -rm $@
+ for F in $(libpango_1_0_la_SOURCES); do \
+ case $$F in \
+ *.c) echo ' <File RelativePath="..\..\..\pango\'$$F'" />' \
+ ;; \
+ esac; \
+ done >libpango.sourcefiles
+ $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pango.vcprojin >$@
+
+../build/win32/vs9/pangoft2.vcproj: $(top_srcdir)/build/win32/vs9/pangoft2.vcprojin opentype/libharfbuzz.sourcefiles
+ -rm $@
+ for F in $(libpangoft2_1_0_la_SOURCES); do \
+ case $$F in \
+ *.c) echo ' <File RelativePath="..\..\..\pango\'$$F'" />' \
+ ;; \
+ esac; \
+ done >libpangoft2.sourcefiles
+ $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pangoft2.vcprojin >$@
+
+../build/win32/vs9/pangocairo.vcproj: $(top_srcdir)/build/win32/vs9/pangocairo.vcprojin
+# Backend-specific sources for the libpangocairo DLL are explicitly
+# listed in the vcprojin file
+ -rm $@
+ for F in $(pangocairo_core_sources); do \
+ case $$F in \
+ *.c) echo ' <File RelativePath="..\..\..\pango\'$$F'" />' \
+ ;; \
+ esac; \
+ done >libpangocairo.sourcefiles
+ $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pangocairo.vcprojin >$@
+
-include $(top_srcdir)/git.mk
diff --git a/pango/glyphstring.c b/pango/glyphstring.c
index 923a9360..dedd822c 100644
--- a/pango/glyphstring.c
+++ b/pango/glyphstring.c
@@ -347,7 +347,7 @@ pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
NULL}};
PangoGlyphItem glyph_item = {&item, glyphs};
- return pango_glyph_item_get_logical_widths (&glyph_item, text, logical_widths);
+ pango_glyph_item_get_logical_widths (&glyph_item, text, logical_widths);
}
/* The initial implementation here is script independent,
@@ -659,5 +659,3 @@ pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
}
}
}
-
-
diff --git a/pango/mini-fribidi/Makefile.am b/pango/mini-fribidi/Makefile.am
index a9e08d6e..a0baa6b0 100644
--- a/pango/mini-fribidi/Makefile.am
+++ b/pango/mini-fribidi/Makefile.am
@@ -30,4 +30,14 @@ EXTRA_DIST = \
fribidi_types.i
+dist-hook: libmini-fribidi.sourcefiles
+
+libmini-fribidi.sourcefiles: Makefile
+ for F in $(libmini_fribidi_la_SOURCES); do \
+ case $$F in \
+ *.c) echo ' <File RelativePath="..\..\..\pango\mini-fribidi\'$$F'" />' \
+ ;; \
+ esac; \
+ done >libmini-fribidi.sourcefiles
+
-include $(top_srcdir)/git.mk
diff --git a/pango/module-defs-fc.c.win32 b/pango/module-defs-fc.c.win32
index a6ae1cff..7a44537c 100644
--- a/pango/module-defs-fc.c.win32
+++ b/pango/module-defs-fc.c.win32
@@ -1,31 +1,17 @@
-/* Hand-written. Once the GNU configure mechanism is used
- * on Win32, too, can be generated.
-*/
+/* Autogenerated by configure and then saved for use when compiling with
+ Visual C. */
-#include "modules.h"
-
-#ifdef PANGO_MODULE_PREFIX
-/* by defining PANGO_MODULE_PREFIX the basic module gets include in the
- * backend library, here ../modules/basic/basic-fc.c
- * It helps the backend to not fall on its nose even with a screwed module
- * configuration. There should be at least enough fonts available to show
- * an error message ...
- */
-void _pango_basic_ft2_script_engine_list (PangoEngineInfo **engines,
- gint *n_engines);
-void _pango_basic_ft2_script_engine_init (GTypeModule *module);
-void _pango_basic_ft2_script_engine_exit (void);
-PangoEngine *_pango_basic_ft2_script_engine_create (const char *id);
-#endif
+#include "module-defs.h"
PangoIncludedModule _pango_included_fc_modules[] = {
-#ifdef PANGO_MODULE_PREFIX
- {
- _pango_basic_ft2_script_engine_list,
- _pango_basic_ft2_script_engine_init,
- _pango_basic_ft2_script_engine_exit,
- _pango_basic_ft2_script_engine_create
- },
-#endif
- { NULL, NULL, NULL },
+ { _pango_arabic_fc_script_engine_list, _pango_arabic_fc_script_engine_init, _pango_arabic_fc_script_engine_exit, _pango_arabic_fc_script_engine_create },
+ { _pango_basic_fc_script_engine_list, _pango_basic_fc_script_engine_init, _pango_basic_fc_script_engine_exit, _pango_basic_fc_script_engine_create },
+ { _pango_hangul_fc_script_engine_list, _pango_hangul_fc_script_engine_init, _pango_hangul_fc_script_engine_exit, _pango_hangul_fc_script_engine_create },
+ { _pango_hebrew_fc_script_engine_list, _pango_hebrew_fc_script_engine_init, _pango_hebrew_fc_script_engine_exit, _pango_hebrew_fc_script_engine_create },
+ { _pango_indic_fc_script_engine_list, _pango_indic_fc_script_engine_init, _pango_indic_fc_script_engine_exit, _pango_indic_fc_script_engine_create },
+ { _pango_khmer_fc_script_engine_list, _pango_khmer_fc_script_engine_init, _pango_khmer_fc_script_engine_exit, _pango_khmer_fc_script_engine_create },
+ { _pango_syriac_fc_script_engine_list, _pango_syriac_fc_script_engine_init, _pango_syriac_fc_script_engine_exit, _pango_syriac_fc_script_engine_create },
+ { _pango_thai_fc_script_engine_list, _pango_thai_fc_script_engine_init, _pango_thai_fc_script_engine_exit, _pango_thai_fc_script_engine_create },
+ { _pango_tibetan_fc_script_engine_list, _pango_tibetan_fc_script_engine_init, _pango_tibetan_fc_script_engine_exit, _pango_tibetan_fc_script_engine_create },
+ { NULL, NULL, NULL, NULL },
};
diff --git a/pango/module-defs-lang.c.win32 b/pango/module-defs-lang.c.win32
new file mode 100644
index 00000000..d1fe979d
--- /dev/null
+++ b/pango/module-defs-lang.c.win32
@@ -0,0 +1,11 @@
+/* Autogenerated and saved for builds using Microsoft's compiler,
+ * when the configure mechanism isn't used.
+ */
+
+#include "module-defs.h"
+
+PangoIncludedModule _pango_included_lang_modules[] = {
+ { _pango_arabic_lang_script_engine_list, _pango_arabic_lang_script_engine_init, _pango_arabic_lang_script_engine_exit, _pango_arabic_lang_script_engine_create },
+ { _pango_indic_lang_script_engine_list, _pango_indic_lang_script_engine_init, _pango_indic_lang_script_engine_exit, _pango_indic_lang_script_engine_create },
+ { NULL, NULL, NULL, NULL },
+};
diff --git a/pango/module-defs-win32.c.win32 b/pango/module-defs-win32.c.win32
index 80fc90a3..5c1698c6 100644
--- a/pango/module-defs-win32.c.win32
+++ b/pango/module-defs-win32.c.win32
@@ -1,25 +1,9 @@
-/* Hand-written, for builds using Microsoft's compiler and makefile.msc,
- * where the configure mechanism isn't used.
- */
+/* Autogenerated by configure and then saved for use when compiling with
+ Visual C. */
-#include "modules.h"
-
-#ifdef PANGO_MODULE_PREFIX
-void _pango_basic_win32_script_engine_list (PangoEngineInfo **engines,
- gint *n_engines);
-void _pango_basic_win32_script_engine_init (GTypeModule *module);
-void _pango_basic_win32_script_engine_exit (void);
-PangoEngine *_pango_basic_win32_script_engine_create (const char *id);
-#endif
+#include "module-defs.h"
PangoIncludedModule _pango_included_win32_modules[] = {
-#ifdef PANGO_MODULE_PREFIX
- {
- _pango_basic_win32_script_engine_list,
- _pango_basic_win32_script_engine_init,
- _pango_basic_win32_script_engine_exit,
- _pango_basic_win32_script_engine_create
- },
-#endif
- { NULL, NULL, NULL },
+ { _pango_basic_win32_script_engine_list, _pango_basic_win32_script_engine_init, _pango_basic_win32_script_engine_exit, _pango_basic_win32_script_engine_create },
+ { NULL, NULL, NULL, NULL },
};
diff --git a/pango/module-defs.h.win32 b/pango/module-defs.h.win32
new file mode 100644
index 00000000..463935ef
--- /dev/null
+++ b/pango/module-defs.h.win32
@@ -0,0 +1,74 @@
+/* Autogenerated by configure and then saved for use when compiling with
+ Visual C. */
+
+#include "modules.h"
+
+extern void _pango_arabic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_arabic_fc_script_engine_init (GTypeModule *module);
+extern void _pango_arabic_fc_script_engine_exit (void);
+extern PangoEngine *_pango_arabic_fc_script_engine_create (const char *id);
+
+extern void _pango_arabic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_arabic_lang_script_engine_init (GTypeModule *module);
+extern void _pango_arabic_lang_script_engine_exit (void);
+extern PangoEngine *_pango_arabic_lang_script_engine_create (const char *id);
+
+extern void _pango_basic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_basic_fc_script_engine_init (GTypeModule *module);
+extern void _pango_basic_fc_script_engine_exit (void);
+extern PangoEngine *_pango_basic_fc_script_engine_create (const char *id);
+
+extern void _pango_basic_win32_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_basic_win32_script_engine_init (GTypeModule *module);
+extern void _pango_basic_win32_script_engine_exit (void);
+extern PangoEngine *_pango_basic_win32_script_engine_create (const char *id);
+
+extern void _pango_basic_x_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_basic_x_script_engine_init (GTypeModule *module);
+extern void _pango_basic_x_script_engine_exit (void);
+extern PangoEngine *_pango_basic_x_script_engine_create (const char *id);
+
+extern void _pango_basic_atsui_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_basic_atsui_script_engine_init (GTypeModule *module);
+extern void _pango_basic_atsui_script_engine_exit (void);
+extern PangoEngine *_pango_basic_atsui_script_engine_create (const char *id);
+
+extern void _pango_hangul_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_hangul_fc_script_engine_init (GTypeModule *module);
+extern void _pango_hangul_fc_script_engine_exit (void);
+extern PangoEngine *_pango_hangul_fc_script_engine_create (const char *id);
+
+extern void _pango_hebrew_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_hebrew_fc_script_engine_init (GTypeModule *module);
+extern void _pango_hebrew_fc_script_engine_exit (void);
+extern PangoEngine *_pango_hebrew_fc_script_engine_create (const char *id);
+
+extern void _pango_indic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_indic_fc_script_engine_init (GTypeModule *module);
+extern void _pango_indic_fc_script_engine_exit (void);
+extern PangoEngine *_pango_indic_fc_script_engine_create (const char *id);
+
+extern void _pango_indic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_indic_lang_script_engine_init (GTypeModule *module);
+extern void _pango_indic_lang_script_engine_exit (void);
+extern PangoEngine *_pango_indic_lang_script_engine_create (const char *id);
+
+extern void _pango_khmer_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_khmer_fc_script_engine_init (GTypeModule *module);
+extern void _pango_khmer_fc_script_engine_exit (void);
+extern PangoEngine *_pango_khmer_fc_script_engine_create (const char *id);
+
+extern void _pango_syriac_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_syriac_fc_script_engine_init (GTypeModule *module);
+extern void _pango_syriac_fc_script_engine_exit (void);
+extern PangoEngine *_pango_syriac_fc_script_engine_create (const char *id);
+
+extern void _pango_thai_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_thai_fc_script_engine_init (GTypeModule *module);
+extern void _pango_thai_fc_script_engine_exit (void);
+extern PangoEngine *_pango_thai_fc_script_engine_create (const char *id);
+
+extern void _pango_tibetan_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines);
+extern void _pango_tibetan_fc_script_engine_init (GTypeModule *module);
+extern void _pango_tibetan_fc_script_engine_exit (void);
+extern PangoEngine *_pango_tibetan_fc_script_engine_create (const char *id);
diff --git a/pango/modules.c b/pango/modules.c
index e6c13349..dad8aae7 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -100,6 +100,22 @@ static void init_modules (void);
static GType pango_module_get_type (void);
+/* If a module cannot be used, or does not create an engine
+ * correctly, we print out an error containing module name and id,
+ * but to not flood the terminal with zillions of the message, we
+ * set a flag on the module to only err once per module.
+ */
+static GQuark
+get_warned_quark (void)
+{
+ static GQuark warned_quark = 0;
+
+ if (G_UNLIKELY (!warned_quark))
+ warned_quark = g_quark_from_static_string ("pango-module-warned");
+
+ return warned_quark;
+}
+
/**
* pango_find_map:
* @language: the language tag for which to find the map
@@ -172,7 +188,13 @@ pango_module_load (GTypeModule *module)
pango_module->library = g_module_open (pango_module->path, G_MODULE_BIND_LOCAL);
if (!pango_module->library)
{
- g_warning ("%s", g_module_error());
+ GQuark warned_quark = get_warned_quark ();
+ if (!g_object_get_qdata (G_OBJECT (pango_module), warned_quark))
+ {
+ g_warning ("%s", g_module_error());
+ g_object_set_qdata_full (G_OBJECT (pango_module), warned_quark,
+ GINT_TO_POINTER (1), NULL);
+ }
return FALSE;
}
@@ -186,7 +208,14 @@ pango_module_load (GTypeModule *module)
!g_module_symbol (pango_module->library, "script_engine_create",
(gpointer *)(void *)&pango_module->create))
{
- g_warning ("%s", g_module_error());
+ GQuark warned_quark = get_warned_quark ();
+ if (!g_object_get_qdata (G_OBJECT (pango_module), warned_quark))
+ {
+ g_warning ("%s", g_module_error());
+ g_object_set_qdata_full (G_OBJECT (pango_module), warned_quark,
+ GINT_TO_POINTER (1), NULL);
+ }
+
g_module_close (pango_module->library);
return FALSE;
@@ -263,16 +292,7 @@ pango_engine_pair_get_engine (PangoEnginePair *pair)
if (!pair->engine)
{
- /* If a module cannot be used, or doesn't not create an engine
- * correctly, we print out an error containing module name and id,
- * but to not flood the terminal with zillions of the message, we
- * set a flag on the module to only err once per module.
- */
- static GQuark warned_quark = 0;
-
- if (!warned_quark)
- warned_quark = g_quark_from_static_string ("pango-module-warned");
-
+ GQuark warned_quark = get_warned_quark ();
if (!g_object_get_qdata (G_OBJECT (pair->module), warned_quark))
{
g_warning ("Failed to load Pango module '%s' for id '%s'", pair->module->path, pair->info.id);
diff --git a/pango/pango-engine-private.h b/pango/pango-engine-private.h
index 5c88a4b1..7d743027 100644
--- a/pango/pango-engine-private.h
+++ b/pango/pango-engine-private.h
@@ -23,7 +23,7 @@
#ifndef __PANGO_ENGINE_PRIVATE_H__
#define __PANGO_ENGINE_PRIVATE_H__
-#include <pango-engine.h>
+#include <pango/pango-engine.h>
G_BEGIN_DECLS
diff --git a/pango/pango-engine.c b/pango/pango-engine.c
index 974e2d5a..50ba7f40 100644
--- a/pango/pango-engine.c
+++ b/pango/pango-engine.c
@@ -140,6 +140,9 @@ fallback_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
p = g_utf8_next_char (p);
}
+
+ if (analysis->level & 1)
+ pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs);
}
static PangoCoverageLevel
diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c
index 297199a5..7553a07e 100644
--- a/pango/pango-gravity.c
+++ b/pango/pango-gravity.c
@@ -182,7 +182,7 @@ const PangoScriptProperties script_properties[] =
/* Unicode-4.0 additions */
{LTR, NONE, S, FALSE}, /* Brai */
- {LTR, NONE, S, FALSE}, /* Cprt */
+ {RTL, NONE, S, FALSE}, /* Cprt */
{LTR, NONE, S, FALSE}, /* Limb */
{LTR, NONE, S, FALSE}, /* Osma */
{LTR, NONE, S, FALSE}, /* Shaw */
diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h
index 3ef3a0c4..6d6c8ff2 100644
--- a/pango/pango-impl-utils.h
+++ b/pango/pango-impl-utils.h
@@ -150,7 +150,31 @@ pango_utf8_strlen (const gchar *p, gssize max)
return len;
}
+
+/* To be made public at some point */
+
+static G_GNUC_UNUSED void
+pango_glyph_string_reverse_range (PangoGlyphString *glyphs,
+ int start, int end)
+{
+ int i, j;
+
+ for (i = start, j = end - 1; i < j; i++, j--)
+ {
+ PangoGlyphInfo glyph_info;
+ gint log_cluster;
+
+ glyph_info = glyphs->glyphs[i];
+ glyphs->glyphs[i] = glyphs->glyphs[j];
+ glyphs->glyphs[j] = glyph_info;
+
+ log_cluster = glyphs->log_clusters[i];
+ glyphs->log_clusters[i] = glyphs->log_clusters[j];
+ glyphs->log_clusters[j] = log_cluster;
+ }
+}
+
+
G_END_DECLS
#endif /* __PANGO_IMPL_UTILS_H__ */
-
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 77270c23..c60c7e8f 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3289,8 +3289,7 @@ process_item (PangoLayout *layout,
retry_break:
- /* See how much of the item we can stuff in the line
- */
+ /* See how much of the item we can stuff in the line. */
width = 0;
for (num_chars = 0; num_chars < item->num_chars; num_chars++)
{
@@ -3308,6 +3307,16 @@ process_item (PangoLayout *layout,
width += state->log_widths[state->log_widths_offset + num_chars];
}
+ /* If there's a space at the end of the line, include that also.
+ * The logic here should match zero_line_final_space().
+ * XXX Currently it doesn't quite match the logic there. We don't check
+ * the cluster here. But should be fine in practice. */
+ if (break_num_chars > 0 && break_num_chars < item->num_chars &&
+ layout->log_attrs[state->start_offset + break_num_chars - 1].is_white)
+ {
+ break_width -= state->log_widths[state->log_widths_offset + break_num_chars - 1];
+ }
+
if (layout->wrap == PANGO_WRAP_WORD_CHAR && force_fit && break_width > state->remaining_width && !retrying_with_char_breaks)
{
retrying_with_char_breaks = TRUE;
@@ -3343,17 +3352,11 @@ process_item (PangoLayout *layout,
length = g_utf8_offset_to_pointer (layout->text + item->offset, break_num_chars) - (layout->text + item->offset);
new_item = pango_item_split (item, length, break_num_chars);
-
- /* reshaping may slightly change the item width. update
- * remaining_width if we are justifying */
+ /* Add the width back, to the line, reshape, subtract the new width */
state->remaining_width += break_width;
-
insert_run (line, state, new_item, FALSE);
-
- if (layout->justify)
- break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs);
-
+ break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs);
state->remaining_width -= break_width;
state->log_widths_offset += break_num_chars;
@@ -4850,7 +4853,6 @@ zero_line_final_space (PangoLayoutLine *line,
PangoItem *item = run->item;
PangoGlyphString *glyphs = run->glyphs;
int glyph = item->analysis.level % 2 ? 0 : glyphs->num_glyphs - 1;
- const char *p;
/* if the final char of line forms a cluster, and it's
* a whitespace char, zero its glyph's width as it's been wrapped
@@ -4860,8 +4862,8 @@ zero_line_final_space (PangoLayoutLine *line,
!layout->log_attrs[state->start_offset - 1].is_white)
return;
- p = g_utf8_prev_char (layout->text + item->offset + item->length);
- if (p != layout->text + item->offset + glyphs->log_clusters[glyph])
+ if (glyphs->num_glyphs >= 2 &&
+ glyphs->log_clusters[glyph] == glyphs->log_clusters[glyph + (item->analysis.level % 2 ? 1 : -1)])
return;
state->remaining_width += glyphs->glyphs[glyph].geometry.width;
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index e818d618..e4b64360 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -23,6 +23,7 @@
#include "pango-ot-private.h"
#include "pangofc-private.h"
+#include "pango-impl-utils.h"
/* cache a single hb_buffer_t */
static hb_buffer_t *cached_buffer = NULL;
@@ -214,26 +215,6 @@ pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer,
*n_glyphs = hb_buffer_get_length (buffer->buffer);
}
-static void
-swap_range (PangoGlyphString *glyphs, int start, int end)
-{
- int i, j;
-
- for (i = start, j = end - 1; i < j; i++, j--)
- {
- PangoGlyphInfo glyph_info;
- gint log_cluster;
-
- glyph_info = glyphs->glyphs[i];
- glyphs->glyphs[i] = glyphs->glyphs[j];
- glyphs->glyphs[j] = glyph_info;
-
- log_cluster = glyphs->log_clusters[i];
- glyphs->log_clusters[i] = glyphs->log_clusters[j];
- glyphs->log_clusters[j] = log_cluster;
- }
-}
-
/**
* pango_ot_buffer_output
* @buffer: a #PangoOTBuffer
@@ -285,7 +266,7 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer,
}
if (buffer->rtl)
- swap_range (glyphs, 0, glyphs->num_glyphs);
+ pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs);
if (!buffer->applied_gpos)
pango_fc_font_kern_glyphs (buffer->font, glyphs);
}
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 100dbc7a..1e10448c 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -692,19 +692,23 @@ DllMain (HINSTANCE hinstDLL,
G_CONST_RETURN char *
pango_get_sysconf_subdirectory (void)
{
-#ifdef G_OS_WIN32
- static gchar *result = NULL;
+ static const gchar *result = NULL;
if (result == NULL)
{
+#ifdef G_OS_WIN32
gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
result = g_build_filename (root, "etc\\pango", NULL);
g_free (root);
- }
- return result;
#else
- return SYSCONFDIR "/pango";
+ const char *sysconfdir = g_getenv ("PANGO_SYSCONFDIR");
+ if (sysconfdir != NULL)
+ result = g_build_filename (sysconfdir, "pango", NULL);
+ else
+ result = SYSCONFDIR "/pango";
#endif
+ }
+ return result;
}
/**
@@ -721,11 +725,11 @@ pango_get_sysconf_subdirectory (void)
G_CONST_RETURN char *
pango_get_lib_subdirectory (void)
{
-#ifdef G_OS_WIN32
static gchar *result = NULL;
if (result == NULL)
{
+#ifdef G_OS_WIN32
gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
/* If we are running against an uninstalled copy of the Pango DLL,
* use the compile-time installation prefix.
@@ -735,11 +739,15 @@ pango_get_lib_subdirectory (void)
else
result = g_build_filename (root, "lib\\pango", NULL);
g_free (root);
- }
- return result;
#else
- return LIBDIR "/pango";
+ const char *libdir = g_getenv ("PANGO_LIBDIR");
+ if (libdir != NULL)
+ result = g_build_filename (libdir, "pango", NULL);
+ else
+ result = LIBDIR "/pango";
#endif
+ }
+ return result;
}
diff --git a/pango/pangoatsui-fontmap.c b/pango/pangoatsui-fontmap.c
index f433440d..12b86bba 100644
--- a/pango/pangoatsui-fontmap.c
+++ b/pango/pangoatsui-fontmap.c
@@ -672,11 +672,14 @@ pango_atsui_font_map_load_font (PangoFontMap *fontmap,
const gchar *family;
gchar *name;
gint size;
+ gboolean is_absolute;
size = pango_font_description_get_size (description);
if (size < 0)
return NULL;
+ is_absolute = pango_font_description_get_size_is_absolute (description);
+
family = pango_font_description_get_family (description);
family = family ? family : "";
name = g_utf8_casefold (family, -1);
@@ -695,7 +698,10 @@ pango_atsui_font_map_load_font (PangoFontMap *fontmap,
if (!find_best_match (font_family, description, &best_description, &best_face))
return NULL;
- pango_font_description_set_size (best_description, size);
+ if (is_absolute)
+ pango_font_description_set_absolute_size (best_description, size);
+ else
+ pango_font_description_set_size (best_description, size);
best_font = pango_atsui_font_map_lookup (atsuifontmap,
context,
diff --git a/pango/pangoatsui-private.h b/pango/pangoatsui-private.h
index 8c734f00..a5ab0cb7 100644
--- a/pango/pangoatsui-private.h
+++ b/pango/pangoatsui-private.h
@@ -95,6 +95,8 @@ void _pango_atsui_font_set_context_key (PangoATSUIFont
gpointer context_key);
void _pango_atsui_font_set_cgfont (PangoATSUIFont *font,
CGFontRef font_id);
+void _pango_atsui_font_set_atsfont (PangoATSUIFont *font,
+ ATSFontRef font_ref);
G_END_DECLS
diff --git a/pango/pangoatsui.c b/pango/pangoatsui.c
index 6aa970ed..da4b9a5a 100644
--- a/pango/pangoatsui.c
+++ b/pango/pangoatsui.c
@@ -33,6 +33,7 @@ struct _PangoATSUIFontPrivate
gpointer context_key;
CGFontRef font_id;
+ ATSFontRef font_ref;
PangoFontMap *fontmap;
};
@@ -177,13 +178,22 @@ _pango_atsui_font_set_context_key (PangoATSUIFont *afont,
void
_pango_atsui_font_set_cgfont (PangoATSUIFont *font,
- CGFontRef font_id)
+ CGFontRef font_id)
{
PangoATSUIFontPrivate *priv = font->priv;
priv->font_id = font_id;
}
+void
+_pango_atsui_font_set_atsfont (PangoATSUIFont *font,
+ ATSFontRef font_ref)
+{
+ PangoATSUIFontPrivate *priv = font->priv;
+
+ priv->font_ref = font_ref;
+}
+
/**
* pango_atsui_font_get_cgfont:
* @font: A #PangoATSUIFont
@@ -201,3 +211,21 @@ pango_atsui_font_get_cgfont (PangoATSUIFont *font)
return priv->font_id;
}
+
+/**
+ * pango_atsui_font_get_atsfont:
+ * @font: A #PangoATSUIFont
+ *
+ * Returns the ATSFontRef of a font.
+ *
+ * Return value: the ATSFontRef associated to @font.
+ *
+ * Since: 1.28
+ */
+ATSFontRef
+pango_atsui_font_get_atsfont (PangoATSUIFont *font)
+{
+ PangoATSUIFontPrivate *priv = font->priv;
+
+ return priv->font_ref;
+}
diff --git a/pango/pangoatsui.h b/pango/pangoatsui.h
index 12db6de3..3ca558e2 100644
--- a/pango/pangoatsui.h
+++ b/pango/pangoatsui.h
@@ -68,7 +68,8 @@ struct _PangoATSUIFontClass
#endif /* PANGO_ENABLE_BACKEND */
-CGFontRef pango_atsui_font_get_cgfont (PangoATSUIFont *font);
+CGFontRef pango_atsui_font_get_cgfont (PangoATSUIFont *font);
+ATSFontRef pango_atsui_font_get_atsfont (PangoATSUIFont *font);
#endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */
diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c
index 21472440..1c1ba550 100644
--- a/pango/pangocairo-atsuifont.c
+++ b/pango/pangocairo-atsuifont.c
@@ -36,8 +36,7 @@ struct _PangoCairoATSUIFont
PangoATSUIFont font;
PangoCairoFontPrivate cf_priv;
- double size;
- int absolute_size;
+ double size; /* Absolute size */
};
struct _PangoCairoATSUIFontClass
@@ -47,15 +46,15 @@ struct _PangoCairoATSUIFontClass
-static cairo_font_face_t *pango_cairo_atsui_font_create_font_face (PangoCairoFont *font);
-static PangoFontMetrics *pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font,
- PangoContext *context);
+static cairo_font_face_t *pango_cairo_atsui_font_create_font_face (PangoCairoFont *font);
+static PangoFontMetrics *pango_cairo_atsui_font_create_base_metrics_for_context (PangoCairoFont *font,
+ PangoContext *context);
static void
cairo_font_iface_init (PangoCairoFontIface *iface)
{
iface->create_font_face = pango_cairo_atsui_font_create_font_face;
- iface->create_metrics_for_context = pango_cairo_atsui_font_create_metrics_for_context;
+ iface->create_base_metrics_for_context = pango_cairo_atsui_font_create_base_metrics_for_context;
iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoATSUIFont, cf_priv);
}
@@ -114,49 +113,28 @@ max_glyph_width (PangoLayout *layout)
}
static PangoFontMetrics *
-pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font,
- PangoContext *context)
+pango_cairo_atsui_font_create_base_metrics_for_context (PangoCairoFont *font,
+ PangoContext *context)
{
PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font;
PangoATSUIFont *afont = (PangoATSUIFont *) font;
- CGFontRef cg_font;
- CTFontRef ct_font;
+ ATSFontRef ats_font;
+ ATSFontMetrics ats_metrics;
PangoFontMetrics *metrics;
- PangoFontDescription *font_desc;
- PangoLayout *layout;
- PangoRectangle extents;
- PangoLanguage *language = pango_context_get_language (context);
- const char *sample_str = pango_language_get_sample_string (language);
-
- cg_font = pango_atsui_font_get_cgfont (afont);
- ct_font = CTFontCreateWithGraphicsFont(cg_font, cafont->size, NULL, NULL);
metrics = pango_font_metrics_new ();
- metrics->ascent = CTFontGetAscent(ct_font) * PANGO_SCALE;
- metrics->descent = -CTFontGetDescent(ct_font) * PANGO_SCALE;
-
- metrics->underline_position = CTFontGetUnderlinePosition(ct_font) * PANGO_SCALE;
- metrics->underline_thickness = CTFontGetUnderlineThickness(ct_font) * PANGO_SCALE;
-
- metrics->strikethrough_position = metrics->ascent / 3;
- metrics->strikethrough_thickness = metrics->underline_thickness * PANGO_SCALE;
-
- layout = pango_layout_new (context);
- font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font);
- pango_layout_set_font_description (layout, font_desc);
- pango_layout_set_text (layout, sample_str, -1);
- pango_layout_get_extents (layout, NULL, &extents);
+ ats_font = pango_atsui_font_get_atsfont (afont);
+ ATSFontGetHorizontalMetrics (ats_font, kATSOptionFlagsDefault, &ats_metrics);
- metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str);
+ metrics->ascent = ats_metrics.ascent * cafont->size * PANGO_SCALE;
+ metrics->descent = -ats_metrics.descent * cafont->size * PANGO_SCALE;
- pango_layout_set_text (layout, "0123456789", -1);
- metrics->approximate_digit_width = max_glyph_width (layout);
+ metrics->underline_position = ats_metrics.underlinePosition * cafont->size * PANGO_SCALE;
+ metrics->underline_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE;
- pango_font_description_free (font_desc);
- g_object_unref (layout);
-
-
+ metrics->strikethrough_position = metrics->ascent / 3;
+ metrics->strikethrough_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE;
return metrics;
}
@@ -168,7 +146,8 @@ pango_cairo_atsui_font_describe_absolute (PangoFont *font)
PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font;
desc = pango_font_describe (font);
- pango_font_description_set_absolute_size (desc, cafont->absolute_size);
+ pango_font_description_set_absolute_size (desc,
+ cafont->size * PANGO_SCALE);
return desc;
}
@@ -214,7 +193,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
CFStringRef cfstr;
ATSFontRef font_ref;
CGFontRef font_id;
- double size;
+ double size, abs_size;
double dpi;
double m;
cairo_matrix_t font_matrix;
@@ -226,6 +205,23 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
font_ref = ATSFontFindFromPostScriptName (cfstr, kATSOptionFlagsDefault);
CFRelease (cfstr);
+ abs_size = size = pango_units_to_double (pango_font_description_get_size (desc));
+
+ if (context)
+ {
+ dpi = pango_cairo_context_get_resolution (context);
+
+ if (dpi <= 0)
+ dpi = cafontmap->dpi;
+ }
+ else
+ dpi = cafontmap->dpi;
+
+ if (pango_font_description_get_size_is_absolute (desc))
+ size *= 72. / dpi;
+ else
+ abs_size *= dpi / 72.;
+
/* We synthesize italic in two cases. The first is when
* NSFontManager has handed out a face that it claims has italic but
* it doesn't. The other is when an italic face is requested that
@@ -238,8 +234,6 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
NSString *nsname;
NSFont *nsfont, *converted_font;
- size = (double) pango_font_description_get_size (desc) / PANGO_SCALE;
-
nsname = [NSString stringWithUTF8String:postscript_name];
nsfont = [NSFont fontWithName:nsname size:size];
@@ -268,25 +262,10 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
_pango_atsui_font_set_font_description (afont, desc);
_pango_atsui_font_set_face (afont, face);
- size = (double) pango_font_description_get_size (desc) / PANGO_SCALE;
_pango_atsui_font_set_cgfont (afont, font_id);
+ _pango_atsui_font_set_atsfont (afont, font_ref);
- if (context)
- {
- dpi = pango_cairo_context_get_resolution (context);
-
- if (dpi <= 0)
- dpi = cafontmap->dpi;
- }
- else
- dpi = cafontmap->dpi;
-
- cafont->absolute_size = pango_font_description_get_size (desc);
-
- if (!pango_font_description_get_size_is_absolute (desc))
- size *= dpi / 72.;
-
- cafont->size = size;
+ cafont->size = abs_size;
/* When synthesizing italics, apply a shear matrix matching what Cocoa
* does. Cairo quartz had transformed text wrong before 1.5.13, stay
@@ -305,7 +284,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap,
else
cairo_matrix_init_identity (&font_matrix);
- cairo_matrix_scale (&font_matrix, size, size);
+ cairo_matrix_scale (&font_matrix, abs_size, abs_size);
_pango_cairo_font_private_initialize (&cafont->cf_priv,
(PangoCairoFont *) cafont,
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 3ac166e6..1393ce8e 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -64,19 +64,19 @@ pango_cairo_fc_font_create_font_face (PangoCairoFont *cfont)
}
static PangoFontMetrics *
-pango_cairo_fc_font_create_metrics_for_context (PangoCairoFont *cfont,
- PangoContext *context)
+pango_cairo_fc_font_create_base_metrics_for_context (PangoCairoFont *cfont,
+ PangoContext *context)
{
PangoFcFont *fcfont = (PangoFcFont *) (cfont);
- return pango_fc_font_create_metrics_for_context (fcfont, context);
+ return pango_fc_font_create_base_metrics_for_context (fcfont, context);
}
static void
cairo_font_iface_init (PangoCairoFontIface *iface)
{
iface->create_font_face = pango_cairo_fc_font_create_font_face;
- iface->create_metrics_for_context = pango_cairo_fc_font_create_metrics_for_context;
+ iface->create_base_metrics_for_context = pango_cairo_fc_font_create_base_metrics_for_context;
iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoFcFont, cf_priv);
}
@@ -166,7 +166,7 @@ get_font_size (const FcPattern *pattern)
double dpi;
if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
- return size * PANGO_SCALE;
+ return size;
/* Just in case FC_PIXEL_SIZE got unset between pango_fc_make_pattern()
* and here. That would be very weird.
@@ -240,8 +240,7 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
fc_matrix.yy,
0., 0.);
- cairo_matrix_scale (&font_matrix,
- size / PANGO_SCALE, size / PANGO_SCALE);
+ cairo_matrix_scale (&font_matrix, size, size);
_pango_cairo_font_private_initialize (&cffont->cf_priv,
(PangoCairoFont *) cffont,
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 35da71ce..1f6382b8 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -22,6 +22,7 @@
#include "config.h"
#include <math.h>
+#include <string.h>
#include "pangocairo.h"
#include "pangocairo-private.h"
@@ -206,6 +207,30 @@ _pango_cairo_font_install (PangoFont *font,
}
+static int
+max_glyph_width (PangoLayout *layout)
+{
+ int max_width = 0;
+ GSList *l, *r;
+
+ for (l = pango_layout_get_lines_readonly (layout); l; l = l->next)
+ {
+ PangoLayoutLine *line = l->data;
+
+ for (r = line->runs; r; r = r->next)
+ {
+ PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs;
+ int i;
+
+ for (i = 0; i < glyphs->num_glyphs; i++)
+ if (glyphs->glyphs[i].geometry.width > max_width)
+ max_width = glyphs->glyphs[i].geometry.width;
+ }
+ }
+
+ return max_width;
+}
+
typedef struct _PangoCairoFontMetricsInfo
{
const char *sample_str;
@@ -239,6 +264,14 @@ _pango_cairo_font_get_metrics (PangoFont *font,
PangoFontMap *fontmap;
PangoContext *context;
cairo_font_options_t *font_options;
+ PangoLayout *layout;
+ PangoRectangle extents;
+ PangoFontDescription *desc;
+ cairo_scaled_font_t *scaled_font;
+ cairo_matrix_t cairo_matrix;
+ PangoMatrix pango_matrix;
+ PangoMatrix identity = PANGO_MATRIX_INIT;
+
int height, shift;
/* XXX this is racy. need a ref'ing getter... */
@@ -253,14 +286,60 @@ _pango_cairo_font_get_metrics (PangoFont *font,
info->sample_str = sample_str;
+ scaled_font = _pango_cairo_font_private_get_scaled_font (cf_priv);
+
context = pango_font_map_create_context (fontmap);
pango_context_set_language (context, language);
+
font_options = cairo_font_options_create ();
- cairo_scaled_font_get_font_options (_pango_cairo_font_private_get_scaled_font (cf_priv), font_options);
+ cairo_scaled_font_get_font_options (scaled_font, font_options);
pango_cairo_context_set_font_options (context, font_options);
cairo_font_options_destroy (font_options);
- info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_metrics_for_context) (cfont, context);
+ info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_base_metrics_for_context) (cfont, context);
+
+ /* We now need to adjust the base metrics for ctm */
+ cairo_scaled_font_get_ctm (scaled_font, &cairo_matrix);
+ pango_matrix.xx = cairo_matrix.xx;
+ pango_matrix.yx = cairo_matrix.yx;
+ pango_matrix.xy = cairo_matrix.xy;
+ pango_matrix.yy = cairo_matrix.yy;
+ pango_matrix.x0 = 0;
+ pango_matrix.y0 = 0;
+ if (G_UNLIKELY (0 != memcmp (&identity, &pango_matrix, 4 * sizeof (double))))
+ {
+ double xscale = pango_matrix_get_font_scale_factor (&pango_matrix);
+ if (xscale) xscale = 1 / xscale;
+
+ info->metrics->ascent *= xscale;
+ info->metrics->descent *= xscale;
+ info->metrics->underline_position *= xscale;
+ info->metrics->underline_thickness *= xscale;
+ info->metrics->strikethrough_position *= xscale;
+ info->metrics->strikethrough_thickness *= xscale;
+ }
+
+
+ /* Set the matrix on the context so we don't have to adjust the derived
+ * metrics. */
+ pango_context_set_matrix (context, &pango_matrix);
+
+ /* Update approximate_*_width now */
+ layout = pango_layout_new (context);
+ desc = pango_font_describe_with_absolute_size (font);
+ pango_layout_set_font_description (layout, desc);
+ pango_font_description_free (desc);
+
+ pango_layout_set_text (layout, sample_str, -1);
+ pango_layout_get_extents (layout, NULL, &extents);
+
+ info->metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str);
+
+ pango_layout_set_text (layout, "0123456789", -1);
+ info->metrics->approximate_digit_width = max_glyph_width (layout);
+
+ g_object_unref (layout);
+
/* We may actually reuse ascent/descent we got from cairo here. that's
* in cf_priv->font_extents.
diff --git a/pango/pangocairo-private.h b/pango/pangocairo-private.h
index 3a4a9d0e..52a8b2f4 100644
--- a/pango/pangocairo-private.h
+++ b/pango/pangocairo-private.h
@@ -75,7 +75,7 @@ struct _PangoCairoFontPrivateScaledFontData
struct _PangoCairoFontPrivate
{
PangoCairoFont *cfont;
-
+
PangoCairoFontPrivateScaledFontData *data;
cairo_scaled_font_t *scaled_font;
@@ -95,8 +95,8 @@ struct _PangoCairoFontIface
GTypeInterface g_iface;
cairo_font_face_t *(*create_font_face) (PangoCairoFont *cfont);
- PangoFontMetrics *(*create_metrics_for_context) (PangoCairoFont *cfont,
- PangoContext *context);
+ PangoFontMetrics *(*create_base_metrics_for_context) (PangoCairoFont *cfont,
+ PangoContext *context);
gssize cf_priv_offset;
};
diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c
index 3493d582..59f7c0f6 100644
--- a/pango/pangocairo-win32font.c
+++ b/pango/pangocairo-win32font.c
@@ -54,16 +54,16 @@ struct _PangoCairoWin32FontClass
GType pango_cairo_win32_font_get_type (void);
-static cairo_font_face_t *pango_cairo_win32_font_create_font_face (PangoCairoFont *font);
-static PangoFontMetrics *pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font,
- PangoContext *context);
+static cairo_font_face_t *pango_cairo_win32_font_create_font_face (PangoCairoFont *font);
+static PangoFontMetrics *pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font,
+ PangoContext *context);
static void
cairo_font_iface_init (PangoCairoFontIface *iface)
{
iface->create_font_face = pango_cairo_win32_font_create_font_face;
- iface->create_metrics_for_context = pango_cairo_win32_font_create_metrics_for_context;
+ iface->create_base_metrics_for_context = pango_cairo_win32_font_create_base_metrics_for_context;
iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoWin32Font, cf_priv);
}
@@ -104,15 +104,10 @@ max_glyph_width (PangoLayout *layout)
}
static PangoFontMetrics *
-pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font,
- PangoContext *context)
+pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font,
+ PangoContext *context)
{
PangoFontMetrics *metrics;
- PangoFontDescription *font_desc;
- PangoLayout *layout;
- PangoRectangle extents;
- PangoLanguage *language = pango_context_get_language (context);
- const char *sample_str = pango_language_get_sample_string (language);
cairo_scaled_font_t *scaled_font;
cairo_font_extents_t font_extents;
double height;
@@ -144,20 +139,6 @@ pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font,
if (metrics->underline_position == 0)
metrics->underline_position = - metrics->underline_thickness;
- layout = pango_layout_new (context);
- font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font);
- pango_layout_set_font_description (layout, font_desc);
- pango_layout_set_text (layout, sample_str, -1);
- pango_layout_get_extents (layout, NULL, &extents);
-
- metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str);
-
- pango_layout_set_text (layout, "0123456789", -1);
- metrics->approximate_digit_width = max_glyph_width (layout);
-
- pango_font_description_free (font_desc);
- g_object_unref (layout);
-
return metrics;
}
diff --git a/pango/pangocairo.rc.in b/pango/pangocairo.rc.in
new file mode 100644
index 00000000..728cce70
--- /dev/null
+++ b/pango/pangocairo.rc.in
@@ -0,0 +1,30 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0
+ PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0
+ FILEFLAGSMASK 0
+ FILEFLAGS 0
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_UNKNOWN
+ BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904B0"
+ BEGIN
+ VALUE "CompanyName", "Red Hat Software"
+ VALUE "FileDescription", "PangoCairo"
+ VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0"
+ VALUE "InternalName", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@"
+ VALUE "LegalCopyright", "Copyright © 2010 Red Hat Software."
+ VALUE "OriginalFilename", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll"
+ VALUE "ProductName", "PangoCairo"
+ VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+ END
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 8fc5a579..d9b6fa8a 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -479,6 +479,18 @@ get_face_metrics (PangoFcFont *fcfont,
PANGO_FC_FONT_UNLOCK_FACE (fcfont);
}
+PangoFontMetrics *
+pango_fc_font_create_base_metrics_for_context (PangoFcFont *fcfont,
+ PangoContext *context)
+{
+ PangoFontMetrics *metrics;
+ metrics = pango_font_metrics_new ();
+
+ get_face_metrics (fcfont, metrics);
+
+ return metrics;
+}
+
static int
max_glyph_width (PangoLayout *layout)
{
@@ -503,42 +515,6 @@ max_glyph_width (PangoLayout *layout)
return max_width;
}
-PangoFontMetrics *
-pango_fc_font_create_metrics_for_context (PangoFcFont *fcfont,
- PangoContext *context)
-{
- PangoFontMetrics *metrics;
- PangoLayout *layout;
- PangoRectangle extents;
- PangoLanguage *language = pango_context_get_language (context);
- const char *sample_str = pango_language_get_sample_string (language);
- PangoFontDescription *desc = pango_font_describe_with_absolute_size (PANGO_FONT (fcfont));
-
- metrics = pango_font_metrics_new ();
-
- get_face_metrics (fcfont, metrics);
-
- layout = pango_layout_new (context);
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
-
- pango_layout_set_text (layout, sample_str, -1);
- pango_layout_get_extents (layout, NULL, &extents);
-
- metrics->approximate_char_width =
- extents.width / pango_utf8_strwidth (sample_str);
-
- pango_layout_set_text (layout, "0123456789", -1);
- metrics->approximate_digit_width = max_glyph_width (layout);
-
- g_object_unref (layout);
-
- return metrics;
-}
-
-/* This function is cut-and-pasted into pangocairo-fcfont.c - it might be
- * better to add a virtual fcfont->create_context (font).
- */
static PangoFontMetrics *
pango_fc_font_get_metrics (PangoFont *font,
PangoLanguage *language)
@@ -581,7 +557,28 @@ pango_fc_font_get_metrics (PangoFont *font,
context = pango_font_map_create_context (fontmap);
pango_context_set_language (context, language);
- info->metrics = pango_fc_font_create_metrics_for_context (fcfont, context);
+ info->metrics = pango_fc_font_create_base_metrics_for_context (fcfont, context);
+
+ { /* Compute derived metrics */
+ PangoLayout *layout;
+ PangoRectangle extents;
+ const char *sample_str = pango_language_get_sample_string (language);
+ PangoFontDescription *desc = pango_font_describe_with_absolute_size (font);
+
+ layout = pango_layout_new (context);
+ pango_layout_set_font_description (layout, desc);
+ pango_font_description_free (desc);
+
+ pango_layout_set_text (layout, sample_str, -1);
+ pango_layout_get_extents (layout, NULL, &extents);
+
+ info->metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str);
+
+ pango_layout_set_text (layout, "0123456789", -1);
+ info->metrics->approximate_digit_width = max_glyph_width (layout);
+
+ g_object_unref (layout);
+ }
g_object_unref (context);
g_object_unref (fontmap);
@@ -807,6 +804,9 @@ pango_fc_font_kern_glyphs (PangoFcFont *font,
FT_Vector kerning;
int i;
gboolean hinting = font->is_hinted;
+ gboolean scale = FALSE;
+ double xscale = 1;
+ PangoFcFontKey *key;
g_return_if_fail (PANGO_IS_FC_FONT (font));
g_return_if_fail (glyphs != NULL);
@@ -821,6 +821,20 @@ pango_fc_font_kern_glyphs (PangoFcFont *font,
return;
}
+ /* This is a kludge, and dupped in pango_ot_buffer_output().
+ * Should move the scale factor to PangoFcFont layer. */
+ key = _pango_fc_font_get_font_key (font);
+ if (key) {
+ const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key);
+ PangoMatrix identity = PANGO_MATRIX_INIT;
+ if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 2 * sizeof (double))))
+ {
+ scale = TRUE;
+ pango_matrix_get_font_scale_factors (matrix, &xscale, NULL);
+ if (xscale) xscale = 1 / xscale;
+ }
+ }
+
for (i = 1; i < glyphs->num_glyphs; ++i)
{
error = FT_Get_Kerning (face,
@@ -834,6 +848,8 @@ pango_fc_font_kern_glyphs (PangoFcFont *font,
if (hinting)
adjustment = PANGO_UNITS_ROUND (adjustment);
+ if (G_UNLIKELY (scale))
+ adjustment *= xscale;
glyphs->glyphs[i-1].geometry.width += adjustment;
}
diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h
index b5fab578..7945962e 100644
--- a/pango/pangofc-private.h
+++ b/pango/pangofc-private.h
@@ -91,8 +91,52 @@ void pango_fc_font_get_raw_extents (PangoFcFont *font,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
-PangoFontMetrics *pango_fc_font_create_metrics_for_context (PangoFcFont *font,
- PangoContext *context);
+PangoFontMetrics *pango_fc_font_create_base_metrics_for_context (PangoFcFont *font,
+ PangoContext *context);
+
+
+
+/* To be made public at some point */
+
+#include <math.h>
+
+static G_GNUC_UNUSED void
+pango_matrix_get_font_scale_factors (const PangoMatrix *matrix,
+ double *xscale, double *yscale)
+{
+/*
+ * Based on cairo-matrix.c:_cairo_matrix_compute_scale_factors()
+ *
+ * Copyright 2005, Keith Packard
+ */
+ double major = 0, minor = 0;
+
+ if (matrix) {
+ double det = matrix->xx * matrix->yy - matrix->yx * matrix->xy;
+
+ if (det)
+ {
+ double x = matrix->xx;
+ double y = matrix->yx;
+
+ major = sqrt (x*x + y*y);
+
+ /*
+ * ignore mirroring
+ */
+ if (det < 0)
+ det = - det;
+
+ if (major)
+ minor = det / major;
+ }
+ }
+
+ if (xscale)
+ *xscale = major;
+ if (yscale)
+ *yscale = minor;
+}
G_END_DECLS
diff --git a/pango/pangoft2.def b/pango/pangoft2.def
index 57294318..f2082ccb 100644
--- a/pango/pangoft2.def
+++ b/pango/pangoft2.def
@@ -2,7 +2,7 @@ EXPORTS
pango_fc_decoder_get_charset
pango_fc_decoder_get_glyph
pango_fc_decoder_get_type
- pango_fc_font_create_metrics_for_context
+ pango_fc_font_create_base_metrics_for_context
pango_fc_font_description_from_pattern
pango_fc_font_get_glyph
pango_fc_font_get_raw_extents
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h
index 9f358230..73df2e99 100644
--- a/pango/pangowin32-private.h
+++ b/pango/pangowin32-private.h
@@ -129,11 +129,8 @@ struct _PangoWin32Font
PangoFontMap *fontmap;
- /* Written by pango_win32_get_hfont: */
+ /* Written by _pango_win32_font_get_hfont: */
HFONT hfont;
- gint tm_ascent;
- gint tm_descent;
- gint tm_overhang;
PangoWin32Face *win32face;
@@ -275,6 +272,8 @@ gboolean _pango_win32_get_name_record (HDC hdc,
gint i,
struct name_record *record);
+HFONT _pango_win32_font_get_hfont (PangoFont *font);
+
extern HDC _pango_win32_hdc;
extern OSVERSIONINFO _pango_win32_os_version_info;
extern gboolean _pango_win32_debug;
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index 1f8c1d25..30ec8b6f 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -74,7 +74,6 @@ static gboolean pango_win32_font_real_select_font (PangoFont *font,
static void pango_win32_font_real_done_font (PangoFont *font);
static double pango_win32_font_real_get_metrics_factor (PangoFont *font);
-static HFONT pango_win32_get_hfont (PangoFont *font);
static void pango_win32_get_item_properties (PangoItem *item,
PangoUnderline *uline,
PangoAttrColor *fg_color,
@@ -82,12 +81,11 @@ static void pango_win32_get_item_properties (PangoItem
PangoAttrColor *bg_color,
gboolean *bg_set);
-static HFONT
-pango_win32_get_hfont (PangoFont *font)
+HFONT
+_pango_win32_font_get_hfont (PangoFont *font)
{
PangoWin32Font *win32font = (PangoWin32Font *)font;
PangoWin32FontCache *cache;
- TEXTMETRIC tm;
if (!win32font)
return NULL;
@@ -105,13 +103,6 @@ pango_win32_get_hfont (PangoFont *font)
g_free (face_utf8);
return NULL;
}
-
- SelectObject (_pango_win32_hdc, win32font->hfont);
- GetTextMetrics (_pango_win32_hdc, &tm);
-
- win32font->tm_overhang = tm.tmOverhang;
- win32font->tm_descent = tm.tmDescent;
- win32font->tm_ascent = tm.tmAscent;
}
return win32font->hfont;
@@ -261,7 +252,7 @@ pango_win32_render (HDC hdc,
if (glyphs->num_glyphs == 0)
return;
- hfont = pango_win32_get_hfont (font);
+ hfont = _pango_win32_font_get_hfont (font);
if (!hfont)
return;
@@ -440,6 +431,7 @@ pango_win32_font_get_glyph_extents (PangoFont *font,
PangoWin32Font *win32font = (PangoWin32Font *)font;
guint16 glyph_index = glyph;
GLYPHMETRICS gm;
+ TEXTMETRIC tm;
guint32 res;
HFONT hfont;
MAT2 m = {{0,1}, {0,0}, {0,0}, {0,1}};
@@ -465,7 +457,7 @@ pango_win32_font_get_glyph_extents (PangoFont *font,
memset (&gm, 0, sizeof (gm));
- hfont = pango_win32_get_hfont (font);
+ hfont = _pango_win32_font_get_hfont (font);
SelectObject (_pango_win32_hdc, hfont);
/* FIXME: (Alex) This constant reuse of _pango_win32_hdc is
not thread-safe */
@@ -491,10 +483,11 @@ pango_win32_font_get_glyph_extents (PangoFont *font,
info->ink_rect.y = - PANGO_SCALE * gm.gmptGlyphOrigin.y;
info->ink_rect.height = PANGO_SCALE * gm.gmBlackBoxY;
+ GetTextMetrics (_pango_win32_hdc, &tm);
info->logical_rect.x = 0;
info->logical_rect.width = PANGO_SCALE * gm.gmCellIncX;
- info->logical_rect.y = - PANGO_SCALE * win32font->tm_ascent;
- info->logical_rect.height = PANGO_SCALE * (win32font->tm_ascent + win32font->tm_descent);
+ info->logical_rect.y = - PANGO_SCALE * tm.tmAscent;
+ info->logical_rect.height = PANGO_SCALE * (tm.tmAscent + tm.tmDescent);
g_hash_table_insert (win32font->glyph_info, GUINT_TO_POINTER(glyph), info);
}
@@ -562,7 +555,7 @@ pango_win32_font_get_metrics (PangoFont *font,
info->sample_str = sample_str;
info->metrics = metrics = pango_font_metrics_new ();
- hfont = pango_win32_get_hfont (font);
+ hfont = _pango_win32_font_get_hfont (font);
if (hfont != NULL)
{
PangoCoverage *coverage;
@@ -626,7 +619,7 @@ static gboolean
pango_win32_font_real_select_font (PangoFont *font,
HDC hdc)
{
- HFONT hfont = pango_win32_get_hfont (font);
+ HFONT hfont = _pango_win32_font_get_hfont (font);
if (!hfont)
return FALSE;
@@ -1611,7 +1604,7 @@ font_has_name_in (PangoFont *font,
if (cjkv == PANGO_WIN32_COVERAGE_UNSPEC)
return TRUE;
- hfont = pango_win32_get_hfont (font);
+ hfont = _pango_win32_font_get_hfont (font);
oldhfont = SelectObject (_pango_win32_hdc, hfont);
if (!_pango_win32_get_name_header (_pango_win32_hdc, &header))
diff --git a/pango/pangowin32.def b/pango/pangowin32.def
index 13b6e8b1..6d9a2785 100644
--- a/pango/pangowin32.def
+++ b/pango/pangowin32.def
@@ -3,6 +3,7 @@ EXPORTS
_pango_win32_make_matching_logfontw
_pango_win32_font_get_type
_pango_win32_font_map_get_type
+ _pango_win32_font_get_hfont
pango_win32_font_cache_free
pango_win32_font_cache_load
pango_win32_font_cache_loadw
@@ -12,7 +13,7 @@ EXPORTS
pango_win32_font_description_from_logfontw
pango_win32_font_get_glyph_index
pango_win32_font_logfont
- pango_win32_font_logfont
+ pango_win32_font_logfontw
pango_win32_font_map_for_display
pango_win32_font_map_get_font_cache
pango_win32_get_context
diff --git a/pango/shape.c b/pango/shape.c
index 0dd56a8e..1513b028 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -108,20 +108,21 @@ pango_shape (const gchar *text,
else
glyphs->num_glyphs = 0;
- if (!glyphs->num_glyphs)
+ if (G_UNLIKELY (!glyphs->num_glyphs))
{
PangoEngineShape *fallback_engine = _pango_get_fallback_shaper ();
_pango_engine_shape_shape (fallback_engine, analysis->font,
text, length, analysis, glyphs);
+ if (G_UNLIKELY (!glyphs->num_glyphs))
+ return;
}
/* make sure last_cluster is invalid */
last_cluster = glyphs->log_clusters[0] - 1;
for (i = 0; i < glyphs->num_glyphs; i++)
{
- /* Set glyphs[i].attr.is_cluster_start based on log_clusters[]
- */
+ /* Set glyphs[i].attr.is_cluster_start based on log_clusters[] */
if (glyphs->log_clusters[i] != last_cluster)
{
glyphs->glyphs[i].attr.is_cluster_start = TRUE;
@@ -141,4 +142,31 @@ pango_shape (const gchar *text,
glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[i].geometry.width;
}
}
+
+ /* Make sure glyphstring direction conforms to analysis->level */
+ if (G_UNLIKELY ((analysis->level & 1) &&
+ glyphs->log_clusters[0] < glyphs->log_clusters[glyphs->num_glyphs - 1]))
+ {
+ /* Warn once per shaper */
+ static GQuark warned_quark = 0;
+
+ if (!warned_quark)
+ warned_quark = g_quark_from_static_string ("pango-shape-warned");
+
+ if (analysis->shape_engine && !g_object_get_qdata (G_OBJECT (analysis->shape_engine), warned_quark))
+ {
+ GType engine_type = G_OBJECT_TYPE (analysis->shape_engine);
+ const char *engine_name = g_type_name (engine_type);
+ if (!engine_name)
+ engine_name = "(unknown)";
+
+ g_warning ("Expected RTL run but shape-engine='%s' returned LTR. Fixing.", engine_name);
+
+ g_object_set_qdata_full (G_OBJECT (analysis->shape_engine), warned_quark,
+ GINT_TO_POINTER (1), NULL);
+ }
+
+ /* *Fix* it so we don't crash later */
+ pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs);
+ }
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 75248a5d..fa3ed125 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -52,15 +52,18 @@ if HAVE_FREETYPE
check_PROGRAMS += test-ot-tags
endif
+TEST_PANGO_LIBS = $(GLIB_LIBS) ../pango/libpango-$(PANGO_API_VERSION).la
+TEST_PANGOFT2_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangoft2-$(PANGO_API_VERSION).la
+TEST_PANGOCAIRO_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangocairo-$(PANGO_API_VERSION).la
+
gen_all_unicode_LDADD = $(GLIB_LIBS)
-testboundaries_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la
-testboundaries_ucd_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la
-testcolor_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la
-testiter_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la ../pango/libpangocairo-$(PANGO_API_VERSION).la
-testscript_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la
-test_ot_tags_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la ../pango/libpangoft2-$(PANGO_API_VERSION).la
-
-dump_boundaries_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la
+testboundaries_LDADD = $(TEST_PANGO_LIBS)
+testboundaries_ucd_LDADD = $(TEST_PANGO_LIBS)
+testcolor_LDADD = $(TEST_PANGO_LIBS)
+testiter_LDADD = $(TEST_PANGOCAIRO_LIBS)
+testscript_LDADD = $(TEST_PANGO_LIBS)
+test_ot_tags_LDADD = $(TEST_PANGOFT2_LIBS)
+dump_boundaries_LDADD = $(TEST_PANGO_LIBS)
if HAVE_CXX
check_PROGRAMS += cxx-test