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
October 2014
----- 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
397 discussions
Start a n
N
ew thread
Nikolay Sivov : dwrite: Store simulations flags at font instance level.
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 901a65ae42d56f4b791534f6b22b46ff6356ac14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=901a65ae42d56f4b791534f6b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 27 17:37:49 2014 +0300 dwrite: Store simulations flags at font instance level. --- dlls/dwrite/font.c | 24 +++++++++++-------- dlls/dwrite/tests/font.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 10 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 5112d24..dd46ee7 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -37,7 +37,6 @@ struct dwrite_font_data { DWRITE_FONT_STYLE style; DWRITE_FONT_STRETCH stretch; DWRITE_FONT_WEIGHT weight; - DWRITE_FONT_SIMULATIONS simulations; DWRITE_FONT_METRICS metrics; IDWriteLocalizedStrings *info_strings[DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME+1]; @@ -91,6 +90,7 @@ struct dwrite_font { BOOL is_system; IDWriteFontFamily *family; + DWRITE_FONT_SIMULATIONS simulations; struct dwrite_font_data *data; }; @@ -138,7 +138,7 @@ struct dwrite_fontfile { static HRESULT create_fontfamily(IDWriteLocalizedStrings *familyname, IDWriteFontFamily **family); static HRESULT create_fontfamily_from_data(struct dwrite_fontfamily_data *data, IDWriteFontCollection *collection, IDWriteFontFamily **family); static HRESULT create_font_base(IDWriteFont **font); -static HRESULT create_font_from_data(struct dwrite_font_data*,IDWriteFontFamily*,IDWriteFont**); +static HRESULT create_font_from_data(struct dwrite_font_data*,IDWriteFontFamily*,DWRITE_FONT_SIMULATIONS,IDWriteFont**); static inline struct dwrite_fontface *impl_from_IDWriteFontFace2(IDWriteFontFace2 *iface) { @@ -744,7 +744,7 @@ static HRESULT get_fontface_from_font(struct dwrite_font *font, IDWriteFontFace2 hr = font->is_system ? create_system_fontface(font, &face) : IDWriteFactory_CreateFontFace(data->factory, data->face_type, 1, &data->file, - data->face_index, DWRITE_FONT_SIMULATIONS_NONE, &face); + data->face_index, font->simulations, &face); if (FAILED(hr)) return hr; @@ -765,7 +765,7 @@ static HRESULT create_font_base(IDWriteFont **font) data = heap_alloc_zero(sizeof(*data)); if (!data) return E_OUTOFMEMORY; - ret = create_font_from_data( data, NULL, font ); + ret = create_font_from_data( data, NULL, DWRITE_FONT_SIMULATIONS_NONE, font ); if (FAILED(ret)) heap_free( data ); return ret; } @@ -870,7 +870,7 @@ static HRESULT create_font_from_logfont(const LOGFONTW *logfont, IDWriteFont **f This->is_system = TRUE; This->family = family; - This->data->simulations = DWRITE_FONT_SIMULATIONS_NONE; + This->simulations = DWRITE_FONT_SIMULATIONS_NONE; This->data->facename = heap_strdupW(logfont->lfFaceName); return S_OK; @@ -1016,7 +1016,7 @@ static DWRITE_FONT_SIMULATIONS WINAPI dwritefont_GetSimulations(IDWriteFont2 *if { struct dwrite_font *This = impl_from_IDWriteFont2(iface); TRACE("(%p)\n", This); - return This->data->simulations; + return This->simulations; } static void WINAPI dwritefont_GetMetrics(IDWriteFont2 *iface, DWRITE_FONT_METRICS *metrics) @@ -1201,7 +1201,7 @@ static HRESULT WINAPI dwritefontfamily_GetFont(IDWriteFontFamily *iface, UINT32 { if (index >= This->data->font_count) return E_INVALIDARG; - return create_font_from_data(This->data->fonts[index], iface, font); + return create_font_from_data(This->data->fonts[index], iface, DWRITE_FONT_SIMULATIONS_NONE, font); } else return E_NOTIMPL; @@ -1247,7 +1247,7 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i } } - return found != -1 ? create_font_from_data(This->data->fonts[found], iface, font) : DWRITE_E_NOFONT; + return found != -1 ? create_font_from_data(This->data->fonts[found], iface, DWRITE_FONT_SIMULATIONS_NONE, font) : DWRITE_E_NOFONT; } } @@ -1414,6 +1414,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec struct dwrite_fontcollection *This = impl_from_IDWriteFontCollection(iface); struct dwrite_fontfamily_data *found_family = NULL; struct dwrite_font_data *found_font = NULL; + DWRITE_FONT_SIMULATIONS simulations; IDWriteFontFamily *family; UINT32 i, j; HRESULT hr; @@ -1443,7 +1444,8 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec if (FAILED(hr)) return hr; - hr = create_font_from_data(found_font, family, font); + simulations = IDWriteFontFace_GetSimulations(face); + hr = create_font_from_data(found_font, family, simulations, font); IDWriteFontFamily_Release(family); return hr; } @@ -1819,7 +1821,8 @@ static HRESULT create_fontfamily(IDWriteLocalizedStrings *familyname, IDWriteFon return ret; } -static HRESULT create_font_from_data(struct dwrite_font_data *data, IDWriteFontFamily *family, IDWriteFont **font) +static HRESULT create_font_from_data(struct dwrite_font_data *data, IDWriteFontFamily *family, DWRITE_FONT_SIMULATIONS simulations, + IDWriteFont **font) { struct dwrite_font *This; *font = NULL; @@ -1833,6 +1836,7 @@ static HRESULT create_font_from_data(struct dwrite_font_data *data, IDWriteFontF if (family) IDWriteFontFamily_AddRef(family); This->is_system = FALSE; + This->simulations = simulations; This->data = data; InterlockedIncrement(&This->data->ref); diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index d9e927f..9cad650 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -1651,6 +1651,65 @@ static void test_CreateFontFaceFromHdc(void) IDWriteFactory_Release(factory); } +static void test_GetSimulations(void) +{ + DWRITE_FONT_SIMULATIONS simulations; + IDWriteGdiInterop *interop; + IDWriteFontFace *fontface; + IDWriteFactory *factory; + IDWriteFont *font; + LOGFONTW logfont; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_GetGdiInterop(factory, &interop); + ok(hr == S_OK, "got 0x%08x\n", hr); + + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = 12; + logfont.lfWidth = 12; + logfont.lfWeight = FW_NORMAL; + logfont.lfItalic = 1; + lstrcpyW(logfont.lfFaceName, tahomaW); + + hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); + ok(hr == S_OK, "got 0x%08x\n", hr); + + simulations = IDWriteFont_GetSimulations(font); +todo_wine + ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations); + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + simulations = IDWriteFontFace_GetSimulations(fontface); +todo_wine + ok(simulations == DWRITE_FONT_SIMULATIONS_OBLIQUE, "got %d\n", simulations); + IDWriteFontFace_Release(fontface); + IDWriteFont_Release(font); + + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = 12; + logfont.lfWidth = 12; + logfont.lfWeight = FW_NORMAL; + logfont.lfItalic = 0; + lstrcpyW(logfont.lfFaceName, tahomaW); + + hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font); + ok(hr == S_OK, "got 0x%08x\n", hr); + + simulations = IDWriteFont_GetSimulations(font); + ok(simulations == 0, "got %d\n", simulations); + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + simulations = IDWriteFontFace_GetSimulations(fontface); + ok(simulations == 0, "got %d\n", simulations); + IDWriteFontFace_Release(fontface); + IDWriteFont_Release(font); + + IDWriteGdiInterop_Release(interop); + IDWriteFactory_Release(factory); +} + START_TEST(font) { IDWriteFactory *factory; @@ -1678,6 +1737,7 @@ START_TEST(font) test_GetInformationalStrings(); test_GetGdiInterop(); test_CreateFontFaceFromHdc(); + test_GetSimulations(); IDWriteFactory_Release(factory); }
1
0
0
0
Nikolay Sivov : dwrite: Allow for a weight difference in GetFirstMatchingFont().
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 5a5a6bdd92aa83b73fd54db8dddaf8329a9df813 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a5a6bdd92aa83b73fd54db8d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 27 14:53:59 2014 +0300 dwrite: Allow for a weight difference in GetFirstMatchingFont(). --- dlls/dwrite/font.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index b271e93..5112d24 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -1233,17 +1233,21 @@ static HRESULT WINAPI dwritefontfamily_GetFirstMatchingFont(IDWriteFontFamily *i } else { - int i; - for (i = 0; i < This->data->font_count; i++) - { - if (style == This->data->fonts[i]->style && - weight == This->data->fonts[i]->weight && - stretch == This->data->fonts[i]->stretch) - { - return create_font_from_data(This->data->fonts[i], iface, font); + UINT32 min_weight_diff = ~0u; + int found = -1, i; + + for (i = 0; i < This->data->font_count; i++) { + if (style == This->data->fonts[i]->style && stretch == This->data->fonts[i]->stretch) { + DWRITE_FONT_WEIGHT font_weight = This->data->fonts[i]->weight; + UINT32 weight_diff = abs(font_weight - weight); + if (weight_diff < min_weight_diff) { + min_weight_diff = weight_diff; + found = i; + } } } - return DWRITE_E_NOFONT; + + return found != -1 ? create_font_from_data(This->data->fonts[found], iface, font) : DWRITE_E_NOFONT; } }
1
0
0
0
Nikolay Sivov : dwrite: Use API-defined type for family count.
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 6706ada9f845866e9ffe990c08083578b5558bf8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6706ada9f845866e9ffe990c0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 27 14:48:46 2014 +0300 dwrite: Use API-defined type for family count. --- dlls/dwrite/font.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 50c3acb..b271e93 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -71,8 +71,8 @@ struct dwrite_fontcollection { int alloc; struct dwrite_fontfamily_data **family_data; - DWORD data_count; - int data_alloc; + UINT32 family_count; + UINT32 family_alloc; }; struct dwrite_fontfamily { @@ -1304,7 +1304,7 @@ static ULONG WINAPI dwritefontcollection_Release(IDWriteFontCollection *iface) for (i = 0; i < This->count; i++) heap_free(This->families[i]); heap_free(This->families); - for (i = 0; i < This->data_count; i++) + for (i = 0; i < This->family_count; i++) _free_fontfamily_data(This->family_data[i]); heap_free(This->family_data); heap_free(This); @@ -1317,8 +1317,8 @@ static UINT32 WINAPI dwritefontcollection_GetFontFamilyCount(IDWriteFontCollecti { struct dwrite_fontcollection *This = impl_from_IDWriteFontCollection(iface); TRACE("(%p)\n", This); - if (This->data_count) - return This->data_count; + if (This->family_count) + return This->family_count; return This->count; } @@ -1331,9 +1331,9 @@ static HRESULT WINAPI dwritefontcollection_GetFontFamily(IDWriteFontCollection * TRACE("(%p)->(%u %p)\n", This, index, family); - if (This->data_count) + if (This->family_count) { - if (index >= This->data_count) + if (index >= This->family_count) { *family = NULL; return E_FAIL; @@ -1362,8 +1362,8 @@ static HRESULT collection_find_family(struct dwrite_fontcollection *collection, { UINT32 i; - if (collection->data_count) { - for (i = 0; i < collection->data_count; i++) { + if (collection->family_count) { + for (i = 0; i < collection->family_count; i++) { IDWriteLocalizedStrings *family_name = collection->family_data[i]->familyname; HRESULT hr; int j; @@ -1421,7 +1421,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec if (!face) return E_INVALIDARG; - for (i = 0; i < This->data_count; i++) { + for (i = 0; i < This->family_count; i++) { struct dwrite_fontfamily_data *family_data = This->family_data[i]; for (j = 0; j < family_data->font_count; j++) { if ((IDWriteFontFace*)family_data->fonts[j]->face == face) { @@ -1494,21 +1494,21 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s static HRESULT fontcollection_add_family(struct dwrite_fontcollection *collection, struct dwrite_fontfamily_data *family) { - if (collection->data_alloc < collection->data_count + 1) { + if (collection->family_alloc < collection->family_count + 1) { struct dwrite_fontfamily_data **new_list; UINT32 new_alloc; - new_alloc = collection->data_alloc * 2; + new_alloc = collection->family_alloc * 2; new_list = heap_realloc(collection->family_data, sizeof(*new_list) * new_alloc); if (!new_list) return E_OUTOFMEMORY; - collection->data_alloc = new_alloc; + collection->family_alloc = new_alloc; collection->family_data = new_list; } - collection->family_data[collection->data_count] = family; - collection->data_count++; + collection->family_data[collection->family_count] = family; + collection->family_count++; return S_OK; } @@ -1517,8 +1517,8 @@ static HRESULT init_font_collection(struct dwrite_fontcollection *collection) { collection->IDWriteFontCollection_iface.lpVtbl = &fontcollectionvtbl; collection->ref = 1; - collection->data_count = 0; - collection->data_alloc = 2; + collection->family_count = 0; + collection->family_alloc = 2; collection->count = 0; collection->alloc = 0; collection->families = NULL; @@ -1739,8 +1739,8 @@ HRESULT get_system_fontcollection(IDWriteFontCollection **collection) heap_free(This); return E_OUTOFMEMORY; } - This->data_count = 0; - This->data_alloc = 2; + This->family_count = 0; + This->family_alloc = 2; This->family_data = heap_alloc(sizeof(*This->family_data)*2); if (!This->family_data) {
1
0
0
0
Nikolay Sivov : dwrite: Support Mac platform id and some of its encodings when reading 'name' table.
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 6128e73f7734db4d03048e05c574ebcd90618e6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6128e73f7734db4d03048e05c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 27 13:40:37 2014 +0300 dwrite: Support Mac platform id and some of its encodings when reading 'name' table. --- dlls/dwrite/opentype.c | 156 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 128 insertions(+), 28 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index c6f7a52..21b1cb2 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -201,6 +201,15 @@ typedef struct { TT_NameRecord nameRecord[1]; } TT_NAME_V0; +enum OPENTYPE_PLATFORM_ID +{ + OPENTYPE_PLATFORM_UNICODE = 0, + OPENTYPE_PLATFORM_MAC, + OPENTYPE_PLATFORM_ISO, + OPENTYPE_PLATFORM_WIN, + OPENTYPE_PLATFORM_CUSTOM +}; + enum TT_NAME_WINDOWS_ENCODING_ID { TT_NAME_WINDOWS_ENCODING_SYMBOL = 0, @@ -216,6 +225,43 @@ enum TT_NAME_WINDOWS_ENCODING_ID TT_NAME_WINDOWS_ENCODING_UCS4 }; +enum TT_NAME_MAC_ENCODING_ID +{ + TT_NAME_MAC_ENCODING_ROMAN = 0, + TT_NAME_MAC_ENCODING_JAPANESE, + TT_NAME_MAC_ENCODING_TRAD_CHINESE, + TT_NAME_MAC_ENCODING_KOREAN, + TT_NAME_MAC_ENCODING_ARABIC, + TT_NAME_MAC_ENCODING_HEBREW, + TT_NAME_MAC_ENCODING_GREEK, + TT_NAME_MAC_ENCODING_RUSSIAN, + TT_NAME_MAC_ENCODING_RSYMBOL, + TT_NAME_MAC_ENCODING_DEVANAGARI, + TT_NAME_MAC_ENCODING_GURMUKHI, + TT_NAME_MAC_ENCODING_GUJARATI, + TT_NAME_MAC_ENCODING_ORIYA, + TT_NAME_MAC_ENCODING_BENGALI, + TT_NAME_MAC_ENCODING_TAMIL, + TT_NAME_MAC_ENCODING_TELUGU, + TT_NAME_MAC_ENCODING_KANNADA, + TT_NAME_MAC_ENCODING_MALAYALAM, + TT_NAME_MAC_ENCODING_SINHALESE, + TT_NAME_MAC_ENCODING_BURMESE, + TT_NAME_MAC_ENCODING_KHMER, + TT_NAME_MAC_ENCODING_THAI, + TT_NAME_MAC_ENCODING_LAOTIAN, + TT_NAME_MAC_ENCODING_GEORGIAN, + TT_NAME_MAC_ENCODING_ARMENIAN, + TT_NAME_MAC_ENCODING_SIMPL_CHINESE, + TT_NAME_MAC_ENCODING_TIBETAN, + TT_NAME_MAC_ENCODING_MONGOLIAN, + TT_NAME_MAC_ENCODING_GEEZ, + TT_NAME_MAC_ENCODING_SLAVIC, + TT_NAME_MAC_ENCODING_VIETNAMESE, + TT_NAME_MAC_ENCODING_SINDHI, + TT_NAME_MAC_ENCODING_UNINTERPRETED +}; + enum OPENTYPE_STRING_ID { OPENTYPE_STRING_COPYRIGHT_NOTICE = 0, @@ -615,6 +661,82 @@ VOID get_font_properties(LPCVOID os2, LPCVOID head, LPCVOID post, DWRITE_FONT_ME } } +static UINT get_name_record_codepage(enum OPENTYPE_PLATFORM_ID platform, USHORT encoding) +{ + UINT codepage = 0; + + switch (platform) { + case OPENTYPE_PLATFORM_MAC: + switch (encoding) + { + case TT_NAME_MAC_ENCODING_ROMAN: + codepage = 10000; + break; + case TT_NAME_MAC_ENCODING_JAPANESE: + codepage = 10001; + break; + case TT_NAME_MAC_ENCODING_TRAD_CHINESE: + codepage = 10002; + break; + case TT_NAME_MAC_ENCODING_KOREAN: + codepage = 10003; + break; + case TT_NAME_MAC_ENCODING_ARABIC: + codepage = 10004; + break; + case TT_NAME_MAC_ENCODING_HEBREW: + codepage = 10005; + break; + case TT_NAME_MAC_ENCODING_GREEK: + codepage = 10006; + break; + case TT_NAME_MAC_ENCODING_RUSSIAN: + codepage = 10007; + break; + case TT_NAME_MAC_ENCODING_SIMPL_CHINESE: + codepage = 10008; + break; + case TT_NAME_MAC_ENCODING_THAI: + codepage = 10021; + break; + default: + FIXME("encoding %u not handled, platform %d.\n", encoding, platform); + break; + } + break; + case OPENTYPE_PLATFORM_WIN: + switch (encoding) + { + case TT_NAME_WINDOWS_ENCODING_SYMBOL: + case TT_NAME_WINDOWS_ENCODING_UCS2: + break; + case TT_NAME_WINDOWS_ENCODING_SJIS: + codepage = 932; + break; + case TT_NAME_WINDOWS_ENCODING_PRC: + codepage = 936; + break; + case TT_NAME_WINDOWS_ENCODING_BIG5: + codepage = 950; + break; + case TT_NAME_WINDOWS_ENCODING_WANSUNG: + codepage = 20949; + break; + case TT_NAME_WINDOWS_ENCODING_JOHAB: + codepage = 1361; + break; + default: + FIXME("encoding %u not handled, platform %d.\n", encoding, platform); + break; + } + break; + default: + FIXME("unknown platform %d\n", platform); + } + + return codepage; +} + HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMATIONAL_STRING_ID id, IDWriteLocalizedStrings **strings) { const TT_NAME_V0 *header; @@ -649,7 +771,10 @@ HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMA /* Right now only accept unicode and windows encoded fonts */ platform = GET_BE_WORD(record->platformID); - if (platform != 0 && platform != 3) { + if (platform != OPENTYPE_PLATFORM_UNICODE && + platform != OPENTYPE_PLATFORM_MAC && + platform != OPENTYPE_PLATFORM_WIN) + { FIXME("platform %i not supported\n", platform); continue; } @@ -662,34 +787,9 @@ HRESULT opentype_get_font_strings_from_id(const void *table_data, DWRITE_INFORMA if (lang_id < 0x8000) { WCHAR locale[LOCALE_NAME_MAX_LENGTH]; WCHAR *name_string; - UINT codepage = 0; + UINT codepage; - if (platform == 3) - { - switch (encoding) - { - case TT_NAME_WINDOWS_ENCODING_SYMBOL: - case TT_NAME_WINDOWS_ENCODING_UCS2: - break; - case TT_NAME_WINDOWS_ENCODING_SJIS: - codepage = 932; - break; - case TT_NAME_WINDOWS_ENCODING_PRC: - codepage = 936; - break; - case TT_NAME_WINDOWS_ENCODING_BIG5: - codepage = 950; - break; - case TT_NAME_WINDOWS_ENCODING_WANSUNG: - codepage = 20949; - break; - case TT_NAME_WINDOWS_ENCODING_JOHAB: - codepage = 1361; - break; - default: - FIXME("encoding %d not handled.\n", encoding); - } - } + codepage = get_name_record_codepage(platform, encoding); if (codepage) { DWORD len = MultiByteToWideChar(codepage, 0, (LPSTR)(storage_area + offset), length, NULL, 0);
1
0
0
0
Bruno Jesus : regedit: Allow importing strings with escaped NULL.
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: c35bca6561a0150425a1838d4677d202cad65da5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c35bca6561a0150425a1838d4…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Wed Oct 29 00:30:13 2014 -0200 regedit: Allow importing strings with escaped NULL. --- programs/regedit/regproc.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index d07fdc7..9d96287 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -255,7 +255,7 @@ static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type) /****************************************************************************** * Replaces escape sequences with the characters. */ -static void REGPROC_unescape_string(WCHAR* str) +static int REGPROC_unescape_string(WCHAR* str) { int str_idx = 0; /* current character under analysis */ int val_idx = 0; /* the last character of the unescaped string */ @@ -267,6 +267,9 @@ static void REGPROC_unescape_string(WCHAR* str) case 'n': str[val_idx] = '\n'; break; + case '0': + str[val_idx] = '\0'; + break; case '\\': case '"': str[val_idx] = str[str_idx]; @@ -282,6 +285,7 @@ static void REGPROC_unescape_string(WCHAR* str) } } str[val_idx] = '\0'; + return val_idx; } static BOOL parseKeyName(LPWSTR lpKeyName, HKEY *hKey, LPWSTR *lpKeyPath) @@ -364,19 +368,10 @@ static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode) if (dwParseType == REG_SZ) /* no conversion for string */ { - REGPROC_unescape_string(val_data); - /* Compute dwLen after REGPROC_unescape_string because it may - * have changed the string length and we don't want to store - * the extra garbage in the registry. - */ - dwLen = lstrlenW(val_data); - if(val_data[dwLen-1] != '"') + dwLen = REGPROC_unescape_string(val_data); + if(!dwLen || val_data[dwLen-1] != '"') return ERROR_INVALID_DATA; - if (dwLen>0 && val_data[dwLen-1]=='"') - { - dwLen--; - val_data[dwLen]='\0'; - } + val_data[dwLen-1] = '\0'; /* remove last quotes */ lpbData = (BYTE*) val_data; dwLen++; /* include terminating null */ dwLen = dwLen * sizeof(WCHAR); /* size is in bytes */
1
0
0
0
Sebastian Lackner : kernel32/tests: Avoid test failures on systems where hardware DEP is not supported.
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: edc259fdeb6651db57b6ba4c33076ad6bbad4b03 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=edc259fdeb6651db57b6ba4c3…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Tue Oct 28 23:37:26 2014 +0100 kernel32/tests: Avoid test failures on systems where hardware DEP is not supported. --- dlls/kernel32/tests/virtual.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 1e66ee1..0015f98 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -1807,6 +1807,7 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) { ULONG flags = MEM_EXECUTE_OPTION_ENABLE; + DWORD err; trace( "exception: %08x flags:%x addr:%p info[0]:%ld info[1]:%p\n", rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress, @@ -1821,15 +1822,15 @@ static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR if (rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION) { - ok( rec->ExceptionInformation[0] == EXCEPTION_EXECUTE_FAULT || - broken(!(flags & MEM_EXECUTE_OPTION_DISABLE) && rec->ExceptionInformation[0] == EXCEPTION_READ_FAULT), /* Windows 2000 */ - "ExceptionInformation[0] is %d instead of %d\n", (DWORD)rec->ExceptionInformation[0], EXCEPTION_EXECUTE_FAULT ); + err = IsProcessorFeaturePresent( PF_NX_ENABLED ) ? EXCEPTION_EXECUTE_FAULT : EXCEPTION_READ_FAULT; + ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %d instead of %d\n", + (DWORD)rec->ExceptionInformation[0], err ); num_guard_page_calls++; } else if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) { - DWORD err, old_prot; + DWORD old_prot; BOOL success; err = (flags & MEM_EXECUTE_OPTION_DISABLE) ? EXCEPTION_EXECUTE_FAULT : EXCEPTION_READ_FAULT; @@ -1941,11 +1942,11 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) static const char cls_name[] = "atl_thunk_class"; DWORD ret, size, old_prot; ULONG old_flags = MEM_EXECUTE_OPTION_ENABLE; + BOOL success, restore_flags = FALSE; void *results[64]; ULONG_PTR count; ULONG pagesize; WNDCLASSEXA wc; - BOOL success; char *base; HWND hWnd; @@ -1967,6 +1968,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) return; } ok( !ret, "NtSetInformationProcess failed with status %08x\n", ret ); + restore_flags = TRUE; } size = 0x1000; @@ -2047,8 +2049,17 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) ret = send_message_excpt( hWnd, WM_USER, 0, 0 ); ok( ret == 42, "call returned wrong result, expected 42, got %d\n", ret ); ok( num_guard_page_calls == 0, "expected no STATUS_GUARD_PAGE_VIOLATION exception, got %d exceptions\n", num_guard_page_calls ); - if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) + if ((dep_flags & MEM_EXECUTE_OPTION_DISABLE) && !IsProcessorFeaturePresent( PF_NX_ENABLED )) + { + trace( "DEP hardware support is not available\n" ); + ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + dep_flags = MEM_EXECUTE_OPTION_ENABLE; + } + else if (dep_flags & MEM_EXECUTE_OPTION_DISABLE) + { + trace( "DEP hardware support is available\n" ); ok( num_execute_fault_calls == 1, "expected one STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); + } else ok( num_execute_fault_calls == 0, "expected no STATUS_ACCESS_VIOLATION exception, got %d exceptions\n", num_execute_fault_calls ); @@ -2414,7 +2425,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags ) VirtualFree( base, 0, MEM_FREE ); out: - if (old_flags != dep_flags) + if (restore_flags) { ret = NtSetInformationProcess( GetCurrentProcess(), ProcessExecuteFlags, &old_flags, sizeof(old_flags) ); ok( !ret, "NtSetInformationProcess failed with status %08x\n", ret );
1
0
0
0
Michael Stefaniuc : oleaut32/tests: Remove always true ok conditions ( PVS-Studio).
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 53c54d922229210afcfbad697ed46caf013228ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53c54d922229210afcfbad697…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Oct 28 23:41:14 2014 +0100 oleaut32/tests: Remove always true ok conditions (PVS-Studio). --- dlls/oleaut32/tests/vartest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 224dad3..d00e577 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -7403,10 +7403,10 @@ static void test_VarPow(void) hres = pVarPow(&cy, &right, &result); if (hres == S_OK) { - ok(hres == S_OK && V_VT(&result) == VT_R8, + ok(V_VT(&result) == VT_R8, "VARPOW: expected coerced hres 0x%X type VT_R8, got hres 0x%X type %s!\n", S_OK, hres, vtstr(V_VT(&result))); - ok(hres == S_OK && EQ_DOUBLE(V_R8(&result), 4.0), + ok(EQ_DOUBLE(V_R8(&result), 4.0), "VARPOW: CY value %f, expected %f\n", V_R8(&result), 4.0); } else @@ -7440,10 +7440,10 @@ static void test_VarPow(void) hres = pVarPow(&dec, &right, &result); if (hres == S_OK) { - ok(hres == S_OK && V_VT(&result) == VT_R8, + ok(V_VT(&result) == VT_R8, "VARPOW: expected coerced hres 0x%X type VT_R8, got hres 0x%X type %s!\n", S_OK, hres, vtstr(V_VT(&result))); - ok(hres == S_OK && EQ_DOUBLE(V_R8(&result), 4.0), + ok(EQ_DOUBLE(V_R8(&result), 4.0), "VARPOW: DECIMAL value %f, expected %f\n", V_R8(&result), 4.0); } else
1
0
0
0
Michael Stefaniuc : usp10: Removed unused variable (PVS-Studio).
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 75858599864211bce3a6bb96d216fbee0466e775 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=75858599864211bce3a6bb96d…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Oct 28 23:37:00 2014 +0100 usp10: Removed unused variable (PVS-Studio). --- dlls/usp10/opentype.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 166d823..dd9c8c4 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -924,10 +924,9 @@ static INT GSUB_apply_LigatureSubst(const OT_LookupTable *look, WORD *glyphs, IN static INT GSUB_apply_ChainContextSubst(const OT_LookupList* lookup, const OT_LookupTable *look, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) { int j; - BOOL done = FALSE; TRACE("Chaining Contextual Substitution Subtable\n"); - for (j = 0; j < GET_BE_WORD(look->SubTableCount) && !done; j++) + for (j = 0; j < GET_BE_WORD(look->SubTableCount); j++) { const GSUB_ChainContextSubstFormat1 *ccsf1; int offset;
1
0
0
0
Michael Stefaniuc : dmusic: Remove duplicated interface ID checks ( PVS-Studio).
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 3d77974f76d68decdaa00eb746e0e06f2556cca0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d77974f76d68decdaa00eb74…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Oct 28 23:33:48 2014 +0100 dmusic: Remove duplicated interface ID checks (PVS-Studio). --- dlls/dmusic/port.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index ad61ba5..f886d52 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -49,9 +49,7 @@ static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface(IDirec { TRACE("(%p, %s, %p)\n", iface, debugstr_dmguid(riid), ret_iface); - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IDirectMusicDownloadedInstrument) || - IsEqualIID(riid, &IID_IDirectMusicDownloadedInstrument8)) + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicDownloadedInstrument)) { IDirectMusicDownloadedInstrument_AddRef(iface); *ret_iface = iface; @@ -132,19 +130,15 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_QueryInterface(LPDIRECTMUSI TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_dmguid(riid), ret_iface); - if (IsEqualIID (riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IDirectMusicPort) || - IsEqualGUID(riid, &IID_IDirectMusicPort8)) { + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort)) { *ret_iface = &This->IDirectMusicPort_iface; IDirectMusicPort_AddRef((LPDIRECTMUSICPORT)*ret_iface); return S_OK; - } else if (IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload8)) { + } else if (IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) { *ret_iface = &This->IDirectMusicPortDownload_iface; IDirectMusicPortDownload_AddRef((LPDIRECTMUSICPORTDOWNLOAD)*ret_iface); return S_OK; - } else if (IsEqualGUID(riid, &IID_IDirectMusicThru) || - IsEqualGUID(riid, &IID_IDirectMusicThru8)) { + } else if (IsEqualGUID(riid, &IID_IDirectMusicThru)) { *ret_iface = &This->IDirectMusicThru_iface; IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ret_iface); return S_OK;
1
0
0
0
Michael Stefaniuc : taskmgr: Fix messed up indentation of an if statement (PVS-Studio).
by Alexandre Julliard
29 Oct '14
29 Oct '14
Module: wine Branch: master Commit: 517a4957378295ffba4d6e286a326577a7dab43c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=517a4957378295ffba4d6e286…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Oct 28 23:32:43 2014 +0100 taskmgr: Fix messed up indentation of an if statement (PVS-Studio). --- programs/taskmgr/graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/taskmgr/graph.c b/programs/taskmgr/graph.c index 859624e..4098675 100644 --- a/programs/taskmgr/graph.c +++ b/programs/taskmgr/graph.c @@ -265,8 +265,8 @@ static void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) * So first find out how many bars we can fit */ nBars = ((rcClient.bottom - rcClient.top) - 25) / 3; - if (CommitChargeLimit) - nBarsUsed = (nBars * (int)((CommitChargeTotal * 100) / CommitChargeLimit)) / 100; + if (CommitChargeLimit) + nBarsUsed = (nBars * (int)((CommitChargeTotal * 100) / CommitChargeLimit)) / 100; nBarsFree = nBars - nBarsUsed; if (nBarsUsed < 0) nBarsUsed = 0;
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
40
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
Results per page:
10
25
50
100
200