Update to 0.9.9 and fixed compatibility with WinXP
This commit is contained in:
		
							parent
							
								
									7546ac9376
								
							
						
					
					
						commit
						00afde08e2
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,2 +1,3 @@ | |||||||
| /harfbuzz-0.9.3.tar.bz2 | /harfbuzz-0.9.3.tar.bz2 | ||||||
| /harfbuzz-0.9.7.tar.bz2 | /harfbuzz-0.9.7.tar.bz2 | ||||||
|  | /harfbuzz-0.9.9.tar.bz2 | ||||||
|  | |||||||
							
								
								
									
										81
									
								
								GetProcAddress_Script_OpenType.diff
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								GetProcAddress_Script_OpenType.diff
									
									
									
									
									
										Normal file
									
								
							| @ -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 <windows.h> | ||||||
|  | +#include <usp10.h>
 | ||||||
|  | +
 | ||||||
|  | +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 | ||||||
|  |   | ||||||
							
								
								
									
										11
									
								
								harfbuzz-0.9.9-fix-build-failure.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								harfbuzz-0.9.9-fix-build-failure.patch
									
									
									
									
									
										Normal file
									
								
							| @ -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 <windows.h> | ||||||
| @ -1,7 +1,7 @@ | |||||||
| %{?mingw_package_header} | %{?mingw_package_header} | ||||||
| 
 | 
 | ||||||
| Name:           mingw-harfbuzz | Name:           mingw-harfbuzz | ||||||
| Version:        0.9.7 | Version:        0.9.9 | ||||||
| Release:        1%{?dist} | Release:        1%{?dist} | ||||||
| Summary:        MinGW Windows Harfbuzz library | Summary:        MinGW Windows Harfbuzz library | ||||||
| 
 | 
 | ||||||
| @ -26,6 +26,12 @@ BuildRequires:  mingw64-freetype | |||||||
| BuildRequires:  mingw64-cairo | BuildRequires:  mingw64-cairo | ||||||
| BuildRequires:  mingw64-icu | 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 | %description | ||||||
| HarfBuzz is an implementation of the OpenType Layout engine. | HarfBuzz is an implementation of the OpenType Layout engine. | ||||||
| @ -67,6 +73,8 @@ Static version of the MinGW Windows Harfbuzz library. | |||||||
| 
 | 
 | ||||||
| %prep | %prep | ||||||
| %setup -q -n harfbuzz-%{version} | %setup -q -n harfbuzz-%{version} | ||||||
|  | %patch0 -p1 | ||||||
|  | %patch1 -p1 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %build | %build | ||||||
| @ -111,6 +119,10 @@ find $RPM_BUILD_ROOT -name "*.la" -delete | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Mon Dec 24 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 0.9.9-1 | ||||||
|  | - Update to 0.9.9 | ||||||
|  | - Fix compatibility with WinXP (FreeDesktop Bug #55494) | ||||||
|  | 
 | ||||||
| * Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 0.9.7-1 | * Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 0.9.7-1 | ||||||
| - Update to 0.9.7 | - Update to 0.9.7 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user