diff --git a/.gitignore b/.gitignore index da1f58b..61d976f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /harfbuzz-0.9.3.tar.bz2 /harfbuzz-0.9.7.tar.bz2 +/harfbuzz-0.9.9.tar.bz2 diff --git a/GetProcAddress_Script_OpenType.diff b/GetProcAddress_Script_OpenType.diff new file mode 100644 index 0000000..3c87a70 --- /dev/null +++ b/GetProcAddress_Script_OpenType.diff @@ -0,0 +1,81 @@ +diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc +index 2f01c28..93bce52 100644 +--- a/src/hb-uniscribe.cc ++++ b/src/hb-uniscribe.cc +@@ -240,6 +240,11 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan, + hb_face_t *face = font->face; + hb_uniscribe_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face); + hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font); ++ SIOT siot; ++ SSOT ssot; ++ SPOT spot; ++ HINSTANCE hinstLib = LoadLibrary("usp10.dll"); ++ + + #define FAIL(...) \ + HB_STMT_START { \ +@@ -249,6 +254,21 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan, + + HRESULT hr; + ++ if (hinstLib == NULL) ++ FAIL ("LoadLibrary(\"usp10.dll\") failed:", NULL); ++ ++ siot = (SIOT)GetProcAddress(hinstLib, "ScriptItemizeOpenType"); ++ if (siot == NULL) ++ FAIL ("GetProcAddress(\"ScriptItemizeOpenType\") failed:", NULL); ++ ++ ssot = (SSOT)GetProcAddress(hinstLib, "ScriptShapeOpenType"); ++ if (ssot == NULL) ++ FAIL ("GetProcAddress(\"ScriptShapeOpenType\") failed:", NULL); ++ ++ spot = (SPOT)GetProcAddress(hinstLib, "ScriptPlaceOpenType"); ++ if (ssot == NULL) ++ FAIL ("GetProcAddress(\"ScriptPlaceOpenType\") failed:", NULL); ++ + retry: + + unsigned int scratch_size; +@@ -312,7 +332,7 @@ retry: + bidi_state.uBidiLevel = HB_DIRECTION_IS_FORWARD (buffer->props.direction) ? 0 : 1; + bidi_state.fOverrideDirection = 1; + +- hr = ScriptItemizeOpenType (wchars, ++ hr = siot (wchars, + chars_len, + MAX_ITEMS, + &bidi_control, +@@ -344,7 +364,7 @@ retry: + unsigned int item_chars_len = items[i + 1].iCharPos - chars_offset; + + retry_shape: +- hr = ScriptShapeOpenType (font_data->hdc, ++ hr = ssot (font_data->hdc, + &font_data->script_cache, + &items[i].a, + script_tags[i], +@@ -386,7 +406,7 @@ retry: + for (unsigned int j = chars_offset; j < chars_offset + item_chars_len; j++) + log_clusters[j] += glyphs_offset; + +- hr = ScriptPlaceOpenType (font_data->hdc, ++ hr = spot (font_data->hdc, + &font_data->script_cache, + &items[i].a, + script_tags[i], +diff --git a/src/hb-uniscribe.h b/src/hb-uniscribe.h +index 51887c8..b7e55e2 100644 +--- a/src/hb-uniscribe.h ++++ b/src/hb-uniscribe.h +@@ -33,6 +33,11 @@ + #define _WIN32_WINNT 0x0600 + #endif + #include ++#include ++ ++typedef HRESULT WINAPI (*SIOT)(const WCHAR*,int,int,const SCRIPT_CONTROL*,const SCRIPT_STATE*,SCRIPT_ITEM*,OPENTYPE_TAG*,int*); ++typedef HRESULT WINAPI (*SSOT)(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,int,int,WORD*,SCRIPT_CHARPROP*,WORD*,SCRIPT_GLYPHPROP*,int*); ++typedef HRESULT WINAPI (*SPOT)(HDC,SCRIPT_CACHE*,SCRIPT_ANALYSIS*,OPENTYPE_TAG,OPENTYPE_TAG,int*,TEXTRANGE_PROPERTIES**,int,const WCHAR*,const WORD*,const SCRIPT_CHARPROP*,int,const WORD*,const SCRIPT_GLYPHPROP*,int,int*,GOFFSET*,ABC*); + + HB_BEGIN_DECLS + diff --git a/harfbuzz-0.9.9-fix-build-failure.patch b/harfbuzz-0.9.9-fix-build-failure.patch new file mode 100644 index 0000000..8d73228 --- /dev/null +++ b/harfbuzz-0.9.9-fix-build-failure.patch @@ -0,0 +1,11 @@ +--- harfbuzz-0.9.9/src/hb-uniscribe.h.orig 2012-12-24 14:28:27.539246473 +0100 ++++ harfbuzz-0.9.9/src/hb-uniscribe.h 2012-12-24 14:28:49.002338096 +0100 +@@ -29,7 +29,7 @@ + + #include "hb.h" + +-#ifndef _WIN32_WINNT ++#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600 + #define _WIN32_WINNT 0x0600 + #endif + #include diff --git a/mingw-harfbuzz.spec b/mingw-harfbuzz.spec index cb75afb..9e8f0b2 100644 --- a/mingw-harfbuzz.spec +++ b/mingw-harfbuzz.spec @@ -1,7 +1,7 @@ %{?mingw_package_header} Name: mingw-harfbuzz -Version: 0.9.7 +Version: 0.9.9 Release: 1%{?dist} Summary: MinGW Windows Harfbuzz library @@ -26,6 +26,12 @@ BuildRequires: mingw64-freetype BuildRequires: mingw64-cairo BuildRequires: mingw64-icu +# https://bugs.freedesktop.org/show_bug.cgi?id=55494 +Patch0: GetProcAddress_Script_OpenType.diff + +# Fix build failure in harfbuzz 0.9.9. Is related to the bug above +Patch1: harfbuzz-0.9.9-fix-build-failure.patch + %description HarfBuzz is an implementation of the OpenType Layout engine. @@ -67,6 +73,8 @@ Static version of the MinGW Windows Harfbuzz library. %prep %setup -q -n harfbuzz-%{version} +%patch0 -p1 +%patch1 -p1 %build @@ -111,6 +119,10 @@ find $RPM_BUILD_ROOT -name "*.la" -delete %changelog +* Mon Dec 24 2012 Erik van Pienbroek - 0.9.9-1 +- Update to 0.9.9 +- Fix compatibility with WinXP (FreeDesktop Bug #55494) + * Wed Nov 21 2012 Erik van Pienbroek - 0.9.7-1 - Update to 0.9.7 diff --git a/sources b/sources index 22062d4..e3fc2a2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -db5382728a912352633d3be2e2a1d988 harfbuzz-0.9.7.tar.bz2 +e901ffe556d706b7d43b272f83be7f09 harfbuzz-0.9.9.tar.bz2