winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2013
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
736 discussions
Start a n
N
ew thread
Alexandre Julliard : gdi32: Implement RemoveFontResource.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 4fc8bf18f3050f7e28d04b21caadfaf7854d483a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4fc8bf18f3050f7e28d04b21c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 15 12:34:40 2013 +0100 gdi32: Implement RemoveFontResource. --- dlls/gdi32/freetype.c | 89 +++++++++++++++++++++++++++++++++++++++++++++- dlls/gdi32/tests/font.c | 3 +- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 97f820c..59ac9a4 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -537,6 +537,7 @@ static BOOL use_default_fallback = FALSE; static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, FT_UInt *glyph); static BOOL get_outline_text_metrics(GdiFont *font); static BOOL get_text_metrics(GdiFont *font, LPTEXTMETRICW ptm); +static void remove_face_from_cache( Face *face ); static const WCHAR system_link[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s',' ','N','T','\\', @@ -1257,6 +1258,7 @@ static void release_face( Face *face ) if (--face->refcount) return; if (face->family) { + if (face->flags & ADDFONT_ADD_TO_CACHE) remove_face_from_cache( face ); list_remove( &face->entry ); release_family( face->family ); } @@ -1565,6 +1567,27 @@ static void add_face_to_cache(Face *face) RegCloseKey(hkey_family); } +static void remove_face_from_cache( Face *face ) +{ + HKEY hkey_family; + + RegOpenKeyExW( hkey_font_cache, face->family->FamilyName, 0, KEY_ALL_ACCESS, &hkey_family ); + + if (face->scalable) + { + RegDeleteKeyW( hkey_family, face->StyleName ); + } + else + { + static const WCHAR fmtW[] = {'%','s','\\','%','d',0}; + WCHAR *face_key_name = HeapAlloc(GetProcessHeap(), 0, (strlenW(face->StyleName) + 10) * sizeof(WCHAR)); + sprintfW(face_key_name, fmtW, face->StyleName, face->size.y_ppem); + RegDeleteKeyW( hkey_family, face_key_name ); + HeapFree(GetProcessHeap(), 0, face_key_name); + } + RegCloseKey(hkey_family); +} + static WCHAR *prepend_at(WCHAR *family) { WCHAR *str; @@ -1959,6 +1982,36 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_ return ret; } +static int remove_font_resource( const char *file, DWORD flags ) +{ + Family *family, *family_next; + Face *face, *face_next; + char *filename; + struct stat st, st2; + int count = 0; + + if (stat( file, &st ) == -1) return 0; + LIST_FOR_EACH_ENTRY_SAFE( family, family_next, &font_list, Family, entry ) + { + family->refcount++; + LIST_FOR_EACH_ENTRY_SAFE( face, face_next, &family->faces, Face, entry ) + { + if (!face->file) continue; + if (LOWORD(face->flags) != LOWORD(flags)) continue; + filename = strWtoA( CP_UNIXCP, face->file ); + if (!stat( filename, &st2 ) && st.st_dev == st2.st_dev && st.st_ino == st2.st_ino) + { + TRACE( "removing matching face %s\n", debugstr_w(face->file) ); + release_face( face ); + count++; + } + HeapFree( GetProcessHeap(), 0, filename ); + } + release_family( family ); + } + return count; +} + static void DumpFontList(void) { Family *family; @@ -2914,9 +2967,41 @@ HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD */ BOOL WineEngRemoveFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv) { + INT ret = 0; + GDI_CheckNotLock(); - FIXME("(%s, %x, %p): stub\n", debugstr_w(file), flags, pdv); - return TRUE; + + if (ft_handle) /* do it only if we have freetype up and running */ + { + char *unixname; + + EnterCriticalSection( &freetype_cs ); + + if ((unixname = wine_get_unix_file_name(file))) + { + DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; + + if(!(flags & FR_PRIVATE)) addfont_flags |= ADDFONT_ADD_TO_CACHE; + ret = remove_font_resource( unixname, addfont_flags ); + HeapFree(GetProcessHeap(), 0, unixname); + } + if (!ret && !strchrW(file, '\\')) + { + if ((unixname = get_winfonts_dir_path( file ))) + { + ret = remove_font_resource( unixname, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE ); + HeapFree(GetProcessHeap(), 0, unixname); + } + if (!ret && (unixname = get_data_dir_path( file ))) + { + ret = remove_font_resource( unixname, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE ); + HeapFree(GetProcessHeap(), 0, unixname); + } + } + + LeaveCriticalSection( &freetype_cs ); + } + return ret; } static char *get_ttf_file_name( LPCWSTR font_file, LPCWSTR font_path ) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 337a6b9..1dfdd11 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -4451,7 +4451,6 @@ static void test_CreateScalableFontResource(void) ok(ret, "DeleteFile() error %d\n", GetLastError()); ret = pRemoveFontResourceExA(fot_name, 0, 0); -todo_wine ok(!ret, "RemoveFontResourceEx() should fail\n"); /* test public font resource */ @@ -4472,11 +4471,11 @@ todo_wine test_GetGlyphOutline_empty_contour(); ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0); -todo_wine ok(!ret, "RemoveFontResourceEx() with not matching flags should fail\n"); SetLastError(0xdeadbeef); ret = pRemoveFontResourceExA(fot_name, 0, 0); +todo_wine ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); ret = is_truetype_font_installed("wine_test");
1
0
0
0
Alexandre Julliard : gdi32: Keep the main font cache key open.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 4d72b082ed1056fce52dc20d24302bff1d65d18b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d72b082ed1056fce52dc20d2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 15 13:56:52 2013 +0100 gdi32: Keep the main font cache key open. --- dlls/gdi32/freetype.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 5a79b35..97f820c 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -518,6 +518,7 @@ struct font_mapping static struct list mappings_list = LIST_INIT( mappings_list ); static UINT default_aa_flags; +static HKEY hkey_font_cache; static CRITICAL_SECTION freetype_cs; static CRITICAL_SECTION_DEBUG critsect_debug = @@ -1516,11 +1517,9 @@ static LONG create_font_cache_key(HKEY *hkey, DWORD *disposition) static void add_face_to_cache(Face *face) { - HKEY hkey_font_cache, hkey_family, hkey_face; + HKEY hkey_family, hkey_face; WCHAR *face_key_name; - create_font_cache_key(&hkey_font_cache, NULL); - RegCreateKeyExW(hkey_font_cache, face->family->FamilyName, 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey_family, NULL); if(face->family->EnglishName) @@ -1564,7 +1563,6 @@ static void add_face_to_cache(Face *face) } RegCloseKey(hkey_face); RegCloseKey(hkey_family); - RegCloseKey(hkey_font_cache); } static WCHAR *prepend_at(WCHAR *family) @@ -3794,7 +3792,6 @@ static void reorder_font_list(void) */ BOOL WineEngInit(void) { - HKEY hkey_font_cache; DWORD disposition; HANDLE font_mutex; @@ -3817,8 +3814,6 @@ BOOL WineEngInit(void) else load_font_list_from_cache(hkey_font_cache); - RegCloseKey(hkey_font_cache); - reorder_font_list(); DumpFontList();
1
0
0
0
Alexandre Julliard : gdi32: Add helper functions to compute font paths for AddFontResource.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: ab0ad4f5d81511b66728bd32e7d429550cb28e5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ab0ad4f5d81511b66728bd32e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 14 17:28:25 2013 +0100 gdi32: Add helper functions to compute font paths for AddFontResource. --- dlls/gdi32/freetype.c | 57 +++++++++++++++++++++++++------------------------ 1 files changed, 29 insertions(+), 28 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 22080b1..5a79b35 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -2614,27 +2614,33 @@ static void load_mac_fonts(void) #endif -static BOOL load_font_from_data_dir(LPCWSTR file) +static char *get_data_dir_path( LPCWSTR file ) { - BOOL ret = FALSE; + char *unix_name = NULL; const char *data_dir = wine_get_data_dir(); if (!data_dir) data_dir = wine_get_build_dir(); if (data_dir) { - INT len; - char *unix_name; - - len = WideCharToMultiByte(CP_UNIXCP, 0, file, -1, NULL, 0, NULL, NULL); + INT len = WideCharToMultiByte(CP_UNIXCP, 0, file, -1, NULL, 0, NULL, NULL); unix_name = HeapAlloc(GetProcessHeap(), 0, strlen(data_dir) + len + sizeof("/fonts/")); - strcpy(unix_name, data_dir); strcat(unix_name, "/fonts/"); WideCharToMultiByte(CP_UNIXCP, 0, file, -1, unix_name + strlen(unix_name), len, NULL, NULL); + } + return unix_name; +} +static BOOL load_font_from_data_dir(LPCWSTR file) +{ + BOOL ret = FALSE; + char *unix_name = get_data_dir_path( file ); + + if (unix_name) + { EnterCriticalSection( &freetype_cs ); ret = AddFontToList(unix_name, NULL, 0, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_TO_CACHE); LeaveCriticalSection( &freetype_cs ); @@ -2643,24 +2649,16 @@ static BOOL load_font_from_data_dir(LPCWSTR file) return ret; } -static BOOL load_font_from_winfonts_dir(LPCWSTR file) +static char *get_winfonts_dir_path(LPCWSTR file) { static const WCHAR slashW[] = {'\\','\0'}; - BOOL ret = FALSE; WCHAR windowsdir[MAX_PATH]; - char *unixname; GetWindowsDirectoryW(windowsdir, sizeof(windowsdir) / sizeof(WCHAR)); strcatW(windowsdir, fontsW); strcatW(windowsdir, slashW); strcatW(windowsdir, file); - if ((unixname = wine_get_unix_file_name(windowsdir))) { - EnterCriticalSection( &freetype_cs ); - ret = AddFontToList(unixname, NULL, 0, ADDFONT_ALLOW_BITMAP); - LeaveCriticalSection( &freetype_cs ); - HeapFree(GetProcessHeap(), 0, unixname); - } - return ret; + return wine_get_unix_file_name( windowsdir ); } static void load_system_fonts(void) @@ -2846,31 +2844,34 @@ INT WineEngAddFontResourceEx(LPCWSTR file, DWORD flags, PVOID pdv) { char *unixname; - if(flags) - FIXME("Ignoring flags %x\n", flags); + EnterCriticalSection( &freetype_cs ); if((unixname = wine_get_unix_file_name(file))) { DWORD addfont_flags = ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE; if(!(flags & FR_PRIVATE)) addfont_flags |= ADDFONT_ADD_TO_CACHE; - EnterCriticalSection( &freetype_cs ); ret = AddFontToList(unixname, NULL, 0, addfont_flags); - LeaveCriticalSection( &freetype_cs ); HeapFree(GetProcessHeap(), 0, unixname); } if (!ret && !strchrW(file, '\\')) { /* Try in %WINDIR%/fonts, needed for Fotobuch Designer */ - ret = load_font_from_winfonts_dir(file); - if (!ret) { - /* Try in datadir/fonts (or builddir/fonts), - * needed for Magic the Gathering Online - */ - ret = load_font_from_data_dir(file); + if ((unixname = get_winfonts_dir_path( file ))) + { + ret = AddFontToList(unixname, NULL, 0, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE); + HeapFree(GetProcessHeap(), 0, unixname); + } + /* Try in datadir/fonts (or builddir/fonts), needed for Magic the Gathering Online */ + if (!ret && (unixname = get_data_dir_path( file ))) + { + ret = AddFontToList(unixname, NULL, 0, ADDFONT_ALLOW_BITMAP | ADDFONT_ADD_RESOURCE); + HeapFree(GetProcessHeap(), 0, unixname); } } + + LeaveCriticalSection( &freetype_cs ); } - return ret; + return ret; } /*************************************************************
1
0
0
0
Alexandre Julliard : gdi32: Store the vertical flag together with the other font flags.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 0f40a031e7e25e35ff6ce3b067a5e6eb18655102 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f40a031e7e25e35ff6ce3b06…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 15 14:13:09 2013 +0100 gdi32: Store the vertical flag together with the other font flags. --- dlls/gdi32/freetype.c | 29 +++++++++++++---------------- 1 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index c90f3c2..22080b1 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -270,7 +270,6 @@ typedef struct tagFace { DWORD ntmFlags; FT_Fixed font_version; BOOL scalable; - BOOL vertical; Bitmap_Size size; /* set if face is a bitmap */ DWORD flags; /* ADDFONT flags */ struct tagFamily *family; @@ -282,6 +281,7 @@ typedef struct tagFace { #define ADDFONT_ALLOW_BITMAP 0x02 #define ADDFONT_ADD_TO_CACHE 0x04 #define ADDFONT_ADD_RESOURCE 0x08 /* added through AddFontResource */ +#define ADDFONT_VERTICAL_FONT 0x10 #define ADDFONT_AA_FLAGS(flags) ((flags) << 16) typedef struct tagFamily { @@ -493,7 +493,6 @@ static const WCHAR english_name_value[] = {'E','n','g','l','i','s','h',' ','N',' static const WCHAR face_index_value[] = {'I','n','d','e','x',0}; static const WCHAR face_ntmflags_value[] = {'N','t','m','f','l','a','g','s',0}; static const WCHAR face_version_value[] = {'V','e','r','s','i','o','n',0}; -static const WCHAR face_vertical_value[] = {'V','e','r','t','i','c','a','l',0}; static const WCHAR face_height_value[] = {'H','e','i','g','h','t',0}; static const WCHAR face_width_value[] = {'W','i','d','t','h',0}; static const WCHAR face_size_value[] = {'S','i','z','e',0}; @@ -1394,7 +1393,6 @@ static void load_face(HKEY hkey_face, WCHAR *face_name, Family *family, void *bu reg_load_dword(hkey_face, face_index_value, (DWORD*)&face->face_index); reg_load_dword(hkey_face, face_ntmflags_value, &face->ntmFlags); reg_load_dword(hkey_face, face_version_value, (DWORD*)&face->font_version); - reg_load_dword(hkey_face, face_vertical_value, (DWORD*)&face->vertical); reg_load_dword(hkey_face, face_flags_value, (DWORD*)&face->flags); needed = sizeof(face->fs); @@ -1551,7 +1549,6 @@ static void add_face_to_cache(Face *face) reg_save_dword(hkey_face, face_index_value, face->face_index); reg_save_dword(hkey_face, face_ntmflags_value, face->ntmFlags); reg_save_dword(hkey_face, face_version_value, face->font_version); - if (face->vertical) reg_save_dword(hkey_face, face_vertical_value, face->vertical); if (face->flags) reg_save_dword(hkey_face, face_flags_value, face->flags); RegSetValueExW(hkey_face, face_font_sig_value, 0, REG_BINARY, (BYTE*)&face->fs, sizeof(face->fs)); @@ -1741,7 +1738,7 @@ static inline void get_fontsig( FT_Face ft_face, FONTSIGNATURE *fs ) } static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file, void *font_data_ptr, DWORD font_data_size, - DWORD flags, BOOL vertical ) + DWORD flags ) { Face *face = HeapAlloc( GetProcessHeap(), 0, sizeof(*face) ); My_FT_Bitmap_Size *size = (My_FT_Bitmap_Size *)ft_face->available_sizes; @@ -1758,7 +1755,7 @@ static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file, face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, GetSystemDefaultLangID() ); if (!face->FullName) face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES ); - if (vertical) + if (flags & ADDFONT_VERTICAL_FONT) face->FullName = prepend_at( face->FullName ); if (file) @@ -1799,7 +1796,6 @@ static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file, } if (!HIWORD( flags )) flags |= ADDFONT_AA_FLAGS( default_aa_flags ); - face->vertical = vertical; face->flags = flags; face->family = NULL; face->cached_enum_data = NULL; @@ -1813,13 +1809,13 @@ static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file, } static void AddFaceToList(FT_Face ft_face, const char *file, void *font_data_ptr, DWORD font_data_size, - FT_Long face_index, DWORD flags, BOOL vertical ) + FT_Long face_index, DWORD flags ) { Face *face; Family *family; - face = create_face( ft_face, face_index, file, font_data_ptr, font_data_size, flags, vertical ); - family = get_family( ft_face, vertical ); + face = create_face( ft_face, face_index, file, font_data_ptr, font_data_size, flags ); + family = get_family( ft_face, flags & ADDFONT_VERTICAL_FONT ); if (insert_face_in_family_list( face, family )) { if (flags & ADDFONT_ADD_TO_CACHE) @@ -1949,12 +1945,13 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_ return 0; } - AddFaceToList(ft_face, file, font_data_ptr, font_data_size, face_index, flags, FALSE); + AddFaceToList(ft_face, file, font_data_ptr, font_data_size, face_index, flags); ++ret; if (FT_HAS_VERTICAL(ft_face)) { - AddFaceToList(ft_face, file, font_data_ptr, font_data_size, face_index, flags, TRUE); + AddFaceToList(ft_face, file, font_data_ptr, font_data_size, face_index, + flags | ADDFONT_VERTICAL_FONT); ++ret; } @@ -3007,7 +3004,7 @@ static BOOL get_fontdir( const char *unix_name, struct fontdir *fd ) DWORD type; if (!ft_face) return FALSE; - face = create_face( ft_face, 0, unix_name, NULL, 0, 0, FALSE ); + face = create_face( ft_face, 0, unix_name, NULL, 0, 0 ); get_family_names( ft_face, &name, &english_name, FALSE ); pFT_Done_Face( ft_face ); @@ -4783,7 +4780,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) font_link = find_font_link(family->FamilyName); face_list = get_face_list_from_family(family); LIST_FOR_EACH_ENTRY( face, face_list, Face, entry ) { - if(face->vertical == want_vertical && + if(!(face->flags & ADDFONT_VERTICAL_FONT) == !want_vertical && (csi.fs.fsCsb[0] & face->fs.fsCsb[0] || (font_link != NULL && csi.fs.fsCsb[0] & font_link->fs.fsCsb[0]))) { if(face->scalable) @@ -4803,7 +4800,7 @@ static HFONT freetype_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) LIST_FOR_EACH_ENTRY( family, &font_list, Family, entry ) { face_list = get_face_list_from_family(family); LIST_FOR_EACH_ENTRY( face, face_list, Face, entry ) { - if(face->scalable && face->vertical == want_vertical) { + if(face->scalable && !(face->flags & ADDFONT_VERTICAL_FONT) == !want_vertical) { csi.fs.fsCsb[0] = 0; WARN("just using first face for now\n"); goto found; @@ -4948,7 +4945,7 @@ found_face: ret->strikeout = lf.lfStrikeOut ? 0xff : 0; create_child_font_list(ret); - if (face->vertical) /* We need to try to load the GSUB table */ + if (face->flags & ADDFONT_VERTICAL_FONT) /* We need to try to load the GSUB table */ { int length = get_font_data(ret, GSUB_TAG , 0, NULL, 0); if (length != GDI_ERROR)
1
0
0
0
Alexandre Julliard : gdi32: Store the full flags in the face object, and add a flag for fonts added through AddFontResource.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: f90696e813ce636fec5285424bbd152c740ea72e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f90696e813ce636fec5285424…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jan 14 15:28:42 2013 +0100 gdi32: Store the full flags in the face object, and add a flag for fonts added through AddFontResource. --- dlls/gdi32/freetype.c | 59 +++++++++++++++++++++++------------------------- 1 files changed, 28 insertions(+), 31 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f90696e813ce636fec528…
1
0
0
0
Damjan Jovanovic : qcap: Use the BaseOutputPin's IMemAllocator.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 632d82f4ac0f51a1c2773667d5dccc800bd27dc0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=632d82f4ac0f51a1c2773667d…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Tue Jan 15 08:46:28 2013 +0200 qcap: Use the BaseOutputPin's IMemAllocator. --- dlls/qcap/v4l.c | 34 +++++----------------------------- 1 files changed, 5 insertions(+), 29 deletions(-) diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index 2562c48..41cc752 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -684,7 +684,6 @@ HRESULT qcap_driver_run(Capture *capBox, FILTER_STATE *state) *state = State_Running; if (!capBox->iscommitted++) { - IMemAllocator * pAlloc = NULL; ALLOCATOR_PROPERTIES ap, actual; BaseOutputPin *out; @@ -698,16 +697,11 @@ HRESULT qcap_driver_run(Capture *capBox, FILTER_STATE *state) ap.cbPrefix = 0; out = (BaseOutputPin *)capBox->pOut; - hr = IMemInputPin_GetAllocator(out->pMemInputPin, &pAlloc); - if (SUCCEEDED(hr)) - hr = IMemAllocator_SetProperties(pAlloc, &ap, &actual); + hr = IMemAllocator_SetProperties(out->pAllocator, &ap, &actual); if (SUCCEEDED(hr)) - hr = IMemAllocator_Commit(pAlloc); - - if (pAlloc) - IMemAllocator_Release(pAlloc); + hr = IMemAllocator_Commit(out->pAllocator); TRACE("Committing allocator: %x\n", hr); } @@ -765,32 +759,14 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state) capBox->thread = 0; if (capBox->iscommitted) { - IMemInputPin *pMem = NULL; - IMemAllocator * pAlloc = NULL; - IPin *pConnect = NULL; + BaseOutputPin *out; HRESULT hr; capBox->iscommitted = 0; - hr = IPin_ConnectedTo(capBox->pOut, &pConnect); - - if (SUCCEEDED(hr)) - hr = IPin_QueryInterface(pConnect, &IID_IMemInputPin, (void **) &pMem); - - if (SUCCEEDED(hr)) - hr = IMemInputPin_GetAllocator(pMem, &pAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_Decommit(pAlloc); - - if (pAlloc) - IMemAllocator_Release(pAlloc); - - if (pMem) - IMemInputPin_Release(pMem); + out = (BaseOutputPin*)capBox->pOut; - if (pConnect) - IPin_Release(pConnect); + hr = IMemAllocator_Decommit(out->pAllocator); if (hr != S_OK && hr != VFW_E_NOT_COMMITTED) WARN("Decommitting allocator: %x\n", hr);
1
0
0
0
Damjan Jovanovic : strmbase: Store and use the chosen IMemAllocator instead of getting it from the input pin .
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 7f767bb1957fc5ebdf0f145226d01f4fe3f7d80e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f767bb1957fc5ebdf0f14522…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Tue Jan 15 08:43:33 2013 +0200 strmbase: Store and use the chosen IMemAllocator instead of getting it from the input pin. --- dlls/strmbase/pin.c | 52 ++++++++++------------------------------------- include/wine/strmbase.h | 1 + 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 936ae0c..750752e 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -402,6 +402,9 @@ ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface) if (!refCount) { FreeMediaType(&This->pin.mtCurrent); + if (This->pAllocator) + IMemAllocator_Release(This->pAllocator); + This->pAllocator = NULL; CoTaskMemFree(This); return 0; } @@ -584,18 +587,10 @@ HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin *This, IMediaSa hr = VFW_E_NOT_CONNECTED; else { - IMemAllocator * pAlloc = NULL; - - hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_GetBuffer(pAlloc, ppSample, tStart, tStop, dwFlags); + hr = IMemAllocator_GetBuffer(This->pAllocator, ppSample, tStart, tStop, dwFlags); if (SUCCEEDED(hr)) hr = IMediaSample_SetTime(*ppSample, tStart, tStop); - - if (pAlloc) - IMemAllocator_Release(pAlloc); } return hr; @@ -653,17 +648,7 @@ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) if (!This->pin.pConnectedTo || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; else - { - IMemAllocator * pAlloc = NULL; - - hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_Commit(pAlloc); - - if (pAlloc) - IMemAllocator_Release(pAlloc); - } + hr = IMemAllocator_Commit(This->pAllocator); } LeaveCriticalSection(This->pin.pCritSec); @@ -683,17 +668,7 @@ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) if (!This->pin.pConnectedTo || !This->pMemInputPin) hr = VFW_E_NOT_CONNECTED; else - { - IMemAllocator * pAlloc = NULL; - - hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_Decommit(pAlloc); - - if (pAlloc) - IMemAllocator_Release(pAlloc); - } + hr = IMemAllocator_Decommit(This->pAllocator); } LeaveCriticalSection(This->pin.pCritSec); @@ -714,15 +689,7 @@ HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This) hr = VFW_E_NOT_CONNECTED; else { - IMemAllocator * pAlloc = NULL; - - hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_Decommit(pAlloc); - - if (pAlloc) - IMemAllocator_Release(pAlloc); + hr = IMemAllocator_Decommit(This->pAllocator); if (SUCCEEDED(hr)) hr = IPin_Disconnect(This->pin.pConnectedTo); @@ -795,7 +762,9 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin* iface, IPin * pRecei if (SUCCEEDED(hr)) { hr = This->pFuncsTable->pfnDecideAllocator(This, This->pMemInputPin, &pMemAlloc); - if (pMemAlloc) + if (SUCCEEDED(hr)) + This->pAllocator = pMemAlloc; + else if (pMemAlloc) IMemAllocator_Release(pMemAlloc); } @@ -839,6 +808,7 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p /* Output pin attributes */ pPinImpl->pMemInputPin = NULL; + pPinImpl->pAllocator = NULL; pPinImpl->pFuncsTable = pBaseOutputFuncsTable; return S_OK; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index da6475d..cbb7d23 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -61,6 +61,7 @@ typedef struct BaseOutputPin /* inheritance C style! */ BasePin pin; IMemInputPin * pMemInputPin; + IMemAllocator * pAllocator; const struct BaseOutputPinFuncTable* pFuncsTable; } BaseOutputPin;
1
0
0
0
Ken Thomases : winemac: Implement layered windows: SetLayeredWindowAttributes() and UpdateLayeredWindow().
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: c0d43fb51f2466660bf027b766c501c7ce1c9874 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c0d43fb51f2466660bf027b76…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Mon Jan 14 20:24:02 2013 -0600 winemac: Implement layered windows: SetLayeredWindowAttributes() and UpdateLayeredWindow(). --- dlls/winemac.drv/cocoa_window.h | 5 + dlls/winemac.drv/cocoa_window.m | 90 ++++++++++++++- dlls/winemac.drv/macdrv.h | 6 +- dlls/winemac.drv/macdrv_cocoa.h | 5 + dlls/winemac.drv/surface.c | 17 +++- dlls/winemac.drv/window.c | 232 ++++++++++++++++++++++++++++++++++++- dlls/winemac.drv/winemac.drv.spec | 2 + 7 files changed, 350 insertions(+), 7 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c0d43fb51f2466660bf02…
1
0
0
0
Ken Thomases : winemac: Implement SetWindowRgn.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 2d4bcc47be73ae8ca78a21d7c36b04685fa78238 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d4bcc47be73ae8ca78a21d7c…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Mon Jan 14 20:23:58 2013 -0600 winemac: Implement SetWindowRgn. --- dlls/winemac.drv/cocoa_window.h | 3 + dlls/winemac.drv/cocoa_window.m | 81 +++++++++++++++++ dlls/winemac.drv/macdrv.h | 7 ++ dlls/winemac.drv/macdrv_cocoa.h | 1 + dlls/winemac.drv/window.c | 172 +++++++++++++++++++++++++++++++++---- dlls/winemac.drv/winemac.drv.spec | 2 + 6 files changed, 250 insertions(+), 16 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2d4bcc47be73ae8ca78a2…
1
0
0
0
Ken Thomases : winemac: Implement window surface rendering.
by Alexandre Julliard
15 Jan '13
15 Jan '13
Module: wine Branch: master Commit: 7d6ebfa742eac87c9f5ac5e228c0c5f68e785f9f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d6ebfa742eac87c9f5ac5e22…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Mon Jan 14 20:23:55 2013 -0600 winemac: Implement window surface rendering. --- dlls/winemac.drv/Makefile.in | 1 + dlls/winemac.drv/cocoa_window.h | 3 + dlls/winemac.drv/cocoa_window.m | 82 ++++++++++ dlls/winemac.drv/macdrv.h | 4 + dlls/winemac.drv/macdrv_cocoa.h | 6 + dlls/winemac.drv/surface.c | 340 +++++++++++++++++++++++++++++++++++++++ dlls/winemac.drv/window.c | 107 ++++++++++++- 7 files changed, 542 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7d6ebfa742eac87c9f5ac…
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
45
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200