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
August 2007
----- 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
3 participants
1085 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Save elements of font's style.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 62cae5ab39e31e4ffeb14e3c9495ae25fb247961 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62cae5ab39e31e4ffeb14e3c9…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:59:35 2007 -0700 gdiplus: Save elements of font's style. --- dlls/gdiplus/font.c | 3 +++ dlls/gdiplus/tests/font.c | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 77ee274..7d2e14a 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -43,6 +43,9 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, memcpy(&(*font)->lfw.lfFaceName, logfont->lfFaceName, LF_FACESIZE * sizeof(WCHAR)); (*font)->lfw.lfHeight = logfont->lfHeight; + (*font)->lfw.lfItalic = logfont->lfItalic; + (*font)->lfw.lfUnderline = logfont->lfUnderline; + (*font)->lfw.lfStrikeOut = logfont->lfStrikeOut; hfont = CreateFontIndirectW(&(*font)->lfw); oldfont = SelectObject(hdc, hfont); diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 0bd3f91..71e6f9a 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -79,11 +79,9 @@ static void test_logfont(void) expect(0, lfw2.lfEscapement); expect(0, lfw2.lfOrientation); ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n"); - todo_wine{ - expect(TRUE, lfw2.lfItalic); - expect(TRUE, lfw2.lfUnderline); - expect(TRUE, lfw2.lfStrikeOut); - } + expect(TRUE, lfw2.lfItalic); + expect(TRUE, lfw2.lfUnderline); + expect(TRUE, lfw2.lfStrikeOut); expect(0, lfw2.lfCharSet); expect(0, lfw2.lfOutPrecision); expect(0, lfw2.lfClipPrecision);
1
0
0
0
Evan Stade : gdiplus: Added more font tests.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 510ecb653092fada7d1dc09fbdcce000bd2ff9ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=510ecb653092fada7d1dc09fb…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:59:22 2007 -0700 gdiplus: Added more font tests. --- dlls/gdiplus/tests/font.c | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index e5d9bca..0bd3f91 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -58,6 +58,40 @@ static void test_logfont(void) expect(0, lfw2.lfQuality); expect(0, lfw2.lfPitchAndFamily); + GdipDeleteFont(font); + + memset(&lfw, 0, sizeof(LOGFONTW)); + lfw.lfHeight = 25; + lfw.lfWidth = 25; + lfw.lfEscapement = lfw.lfOrientation = 50; + lfw.lfItalic = lfw.lfUnderline = lfw.lfStrikeOut = TRUE; + + memset(&lfw2, 0xff, sizeof(LOGFONTW)); + memcpy(&lfw.lfFaceName, arial, 6 * sizeof(WCHAR)); + + stat = GdipCreateFontFromLogfontW(hdc, &lfw, &font); + expect(Ok, stat); + stat = GdipGetLogFontW(font, graphics, &lfw2); + expect(Ok, stat); + + ok(lfw2.lfHeight < 0, "Expected negative height\n"); + expect(0, lfw2.lfWidth); + expect(0, lfw2.lfEscapement); + expect(0, lfw2.lfOrientation); + ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n"); + todo_wine{ + expect(TRUE, lfw2.lfItalic); + expect(TRUE, lfw2.lfUnderline); + expect(TRUE, lfw2.lfStrikeOut); + } + expect(0, lfw2.lfCharSet); + expect(0, lfw2.lfOutPrecision); + expect(0, lfw2.lfClipPrecision); + expect(0, lfw2.lfQuality); + expect(0, lfw2.lfPitchAndFamily); + + GdipDeleteFont(font); + GdipDeleteGraphics(graphics); ReleaseDC(0, hdc); }
1
0
0
0
Evan Stade : gdiplus: Added GdipDeleteFont.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: a364fc325819db40665c7214558da033af73b470 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a364fc325819db40665c72145…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:59:15 2007 -0700 gdiplus: Added GdipDeleteFont. --- dlls/gdiplus/font.c | 10 ++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index d321ba9..77ee274 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -75,6 +75,16 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC hdc, return Ok; } +GpStatus WINGDIPAPI GdipDeleteFont(GpFont* font) +{ + if(!font) + return InvalidParameter; + + GdipFree(font); + + return Ok; +} + /* FIXME: use graphics */ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lfw) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c2b9042..b4c0c36 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -140,7 +140,7 @@ @ stub GdipDeleteCachedBitmap @ stdcall GdipDeleteCustomLineCap(ptr) @ stub GdipDeleteEffect -@ stub GdipDeleteFont +@ stdcall GdipDeleteFont(ptr) @ stub GdipDeleteFontFamily @ stdcall GdipDeleteGraphics(ptr) @ stdcall GdipDeleteMatrix(ptr) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index d2c6db8..ed11b4a 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -241,6 +241,7 @@ GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode, GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC,GDIPCONST LOGFONTA*,GpFont**); GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**); +GpStatus WINGDIPAPI GdipDeleteFont(GpFont*); GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*); #ifdef __cplusplus
1
0
0
0
Evan Stade : gdiplus: Fixed conformance of font constructor.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 537112fb52a18454eaa5993ec6b4862dd757043a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=537112fb52a18454eaa5993ec…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:59:08 2007 -0700 gdiplus: Fixed conformance of font constructor. --- dlls/gdiplus/font.c | 17 ++++++++++++++++- dlls/gdiplus/tests/font.c | 6 ++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index a64ceac..d321ba9 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -31,13 +31,28 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font) { + HFONT hfont, oldfont; + TEXTMETRICW textmet; + if(!logfont || !font) return InvalidParameter; *font = GdipAlloc(sizeof(GpFont)); if(!*font) return OutOfMemory; - memcpy(&(*font)->lfw, logfont, sizeof(LOGFONTW)); + memcpy(&(*font)->lfw.lfFaceName, logfont->lfFaceName, LF_FACESIZE * + sizeof(WCHAR)); + (*font)->lfw.lfHeight = logfont->lfHeight; + + hfont = CreateFontIndirectW(&(*font)->lfw); + oldfont = SelectObject(hdc, hfont); + GetTextMetricsW(hdc, &textmet); + + (*font)->lfw.lfHeight = -textmet.tmHeight; + (*font)->lfw.lfWeight = textmet.tmWeight; + + SelectObject(hdc, oldfont); + DeleteObject(hfont); return Ok; } diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 1326a6a..e5d9bca 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -44,13 +44,11 @@ static void test_logfont(void) stat = GdipGetLogFontW(font, graphics, &lfw2); expect(Ok, stat); - todo_wine - ok(lfw2.lfHeight < 0, "Expected negative height\n"); + ok(lfw2.lfHeight < 0, "Expected negative height\n"); expect(0, lfw2.lfWidth); expect(0, lfw2.lfEscapement); expect(0, lfw2.lfOrientation); - todo_wine - ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n"); + ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n"); expect(0, lfw2.lfItalic); expect(0, lfw2.lfUnderline); expect(0, lfw2.lfStrikeOut);
1
0
0
0
Evan Stade : gdiplus: Added font tests.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 4202ababb0b17b368ce9cee3fb180dcb19a3aec5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4202ababb0b17b368ce9cee3f…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:58:59 2007 -0700 gdiplus: Added font tests. --- dlls/gdiplus/tests/Makefile.in | 1 + dlls/gdiplus/tests/font.c | 82 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in index 3771da2..8f0904c 100644 --- a/dlls/gdiplus/tests/Makefile.in +++ b/dlls/gdiplus/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = gdiplus user32 gdi32 kernel32 CTESTS = \ brush.c \ + font.c \ graphics.c \ graphicspath.c \ image.c \ diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c new file mode 100644 index 0000000..1326a6a --- /dev/null +++ b/dlls/gdiplus/tests/font.c @@ -0,0 +1,82 @@ +/* + * Unit test suite for fonts + * + * Copyright (C) 2007 Google (Evan Stade) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windows.h" +#include "gdiplus.h" +#include "wine/test.h" + +#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) + +static WCHAR arial[] = {'A','r','i','a','l','\0'}; + +static void test_logfont(void) +{ + LOGFONTW lfw, lfw2; + GpFont *font; + GpStatus stat; + GpGraphics *graphics; + HDC hdc = GetDC(0); + + GdipCreateFromHDC(hdc, &graphics); + memset(&lfw, 0, sizeof(LOGFONTW)); + memset(&lfw2, 0xff, sizeof(LOGFONTW)); + memcpy(&lfw.lfFaceName, arial, 6 * sizeof(WCHAR)); + + stat = GdipCreateFontFromLogfontW(hdc, &lfw, &font); + expect(Ok, stat); + stat = GdipGetLogFontW(font, graphics, &lfw2); + expect(Ok, stat); + + todo_wine + ok(lfw2.lfHeight < 0, "Expected negative height\n"); + expect(0, lfw2.lfWidth); + expect(0, lfw2.lfEscapement); + expect(0, lfw2.lfOrientation); + todo_wine + ok((lfw2.lfWeight >= 100) && (lfw2.lfWeight <= 900), "Expected weight to be set\n"); + expect(0, lfw2.lfItalic); + expect(0, lfw2.lfUnderline); + expect(0, lfw2.lfStrikeOut); + expect(0, lfw2.lfCharSet); + expect(0, lfw2.lfOutPrecision); + expect(0, lfw2.lfClipPrecision); + expect(0, lfw2.lfQuality); + expect(0, lfw2.lfPitchAndFamily); + + GdipDeleteGraphics(graphics); + ReleaseDC(0, hdc); +} + +START_TEST(font) +{ + struct GdiplusStartupInput gdiplusStartupInput; + ULONG_PTR gdiplusToken; + + gdiplusStartupInput.GdiplusVersion = 1; + gdiplusStartupInput.DebugEventCallback = NULL; + gdiplusStartupInput.SuppressBackgroundThread = 0; + gdiplusStartupInput.SuppressExternalCodecs = 0; + + GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + + test_logfont(); + + GdiplusShutdown(gdiplusToken); +}
1
0
0
0
Evan Stade : gdiplus: Added GdipGetLogFontW.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 958ece2192c917d24303716b381e9670aac0d20e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=958ece2192c917d24303716b3…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:58:52 2007 -0700 gdiplus: Added GdipGetLogFontW. --- dlls/gdiplus/font.c | 12 ++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index d02b04d..a64ceac 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -59,3 +59,15 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC hdc, return Ok; } + +/* FIXME: use graphics */ +GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, + LOGFONTW *lfw) +{ + if(!font || !graphics || !lfw) + return InvalidParameter; + + memcpy(lfw, &font->lfw, sizeof(LOGFONTW)); + + return Ok; +} diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c2189e9..c2b9042 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -312,7 +312,7 @@ @ stub GdipGetLineTransform @ stub GdipGetLineWrapMode @ stub GdipGetLogFontA -@ stub GdipGetLogFontW +@ stdcall GdipGetLogFontW(ptr ptr ptr) @ stdcall GdipGetMatrixElements(ptr ptr) @ stub GdipGetMetafileDownLevelRasterizationLimit @ stub GdipGetMetafileHeaderFromEmf diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 5883f09..d2c6db8 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -241,6 +241,7 @@ GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode, GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC,GDIPCONST LOGFONTA*,GpFont**); GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**); +GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*); #ifdef __cplusplus }
1
0
0
0
Evan Stade : gdiplus: Added GdipDrawString.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: f7d27e00202a765ff2f8e6529b616f36d14c32af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7d27e00202a765ff2f8e6529…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Aug 14 18:58:39 2007 -0700 gdiplus: Added GdipDrawString. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphics.c | 136 +++++++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 3 + include/gdiplusgpstubs.h | 2 + 4 files changed, 142 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 39253a5..c2189e9 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -198,7 +198,7 @@ @ stdcall GdipDrawRectangleI(ptr ptr long long long long) @ stdcall GdipDrawRectangles(ptr ptr ptr long) @ stub GdipDrawRectanglesI -@ stub GdipDrawString +@ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr) @ stub GdipEmfToWmfBits @ stub GdipEndContainer @ stub GdipEnumerateMetafileDestPoint diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 68ceb4b..3626217 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -23,6 +23,7 @@ #include "winbase.h" #include "winuser.h" #include "wingdi.h" +#include "wine/unicode.h" #define COBJMACROS #include "objbase.h" @@ -1270,6 +1271,141 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, return Ok; } +GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string, + INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, + GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush) +{ + HRGN rgn; + HFONT gdifont; + LOGFONTW lfw; + TEXTMETRICW textmet; + GpPointF pt[2], rectcpy[4]; + POINT corners[4]; + WCHAR* stringdup; + REAL angle, ang_cos, ang_sin, rel_width, rel_height; + INT sum = 0, height = 0, fit, fitcpy, save_state, i, j, lret, nwidth; + SIZE size; + + if(!graphics || !string || !font || !brush || !rect) + return InvalidParameter; + + if(format || (brush->bt != BrushTypeSolidColor)){ + FIXME("not implemented for given parameters\n"); + return NotImplemented; + } + + stringdup = GdipAlloc(length * sizeof(WCHAR)); + if(!stringdup) return OutOfMemory; + + save_state = SaveDC(graphics->hdc); + SetBkMode(graphics->hdc, TRANSPARENT); + SetTextColor(graphics->hdc, brush->lb.lbColor); + + rectcpy[3].X = rectcpy[0].X = rect->X; + rectcpy[1].Y = rectcpy[0].Y = rect->Y; + rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width; + rectcpy[3].Y = rectcpy[2].Y = rect->Y + rect->Height; + transform_and_round_points(graphics, corners, rectcpy, 4); + rel_width = sqrt((corners[1].x - corners[0].x) * (corners[1].x - corners[0].x) + + (corners[1].y - corners[0].y) * (corners[1].y - corners[0].y)) + / rect->Width; + nwidth = roundr(rel_width * rect->Width); + rel_height = sqrt((corners[2].x - corners[1].x) * (corners[2].x - corners[1].x) + + (corners[2].y - corners[1].y) * (corners[2].y - corners[1].y)) + / rect->Height; + + rgn = CreatePolygonRgn(corners, 4, ALTERNATE); + SelectClipRgn(graphics->hdc, rgn); + + /* Use gdi to find the font, then perform transformations on it (height, + * width, angle). */ + SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); + GetTextMetricsW(graphics->hdc, &textmet); + memcpy(&lfw, &font->lfw, sizeof(LOGFONTW)); + + lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height); + lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width); + + pt[0].X = 0.0; + pt[0].Y = 0.0; + pt[1].X = 1.0; + pt[1].Y = 0.0; + GdipTransformMatrixPoints(graphics->worldtrans, pt, 2); + angle = gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); + ang_cos = cos(angle); + ang_sin = sin(angle); + lfw.lfEscapement = lfw.lfOrientation = -roundr((angle / M_PI) * 1800.0); + + gdifont = CreateFontIndirectW(&lfw); + DeleteObject(SelectObject(graphics->hdc, CreateFontIndirectW(&lfw))); + + for(i = 0, j = 0; i < length; i++){ + if(!isprintW(string[i]) && (string[i] != '\n')) + continue; + + stringdup[j] = string[i]; + j++; + } + + stringdup[j] = 0; + length = j; + + while(sum < length){ + GetTextExtentExPointW(graphics->hdc, stringdup, length, nwidth, + &fit, NULL, &size); + fitcpy = fit; + + if(fit == 0){ + TabbedTextOutW(graphics->hdc, + corners[0].x + roundr(ang_sin * (REAL) height), + corners[0].y + roundr(ang_cos * (REAL) height), + stringdup + sum, 1, 0, 0, 0); + break; + } + + for(lret = 0; lret < fit; lret++) + if(*(stringdup + sum + lret) == '\n') + break; + + /* Line break code (may look strange, but it imitates windows). */ + if(lret < fit) + fit = lret; /* this is not an off-by-one error */ + else if(*(stringdup + sum + fit) == ' ') + while(*(stringdup + sum + fit) == ' ') + fit++; + else + while(*(stringdup + sum + fit - 1) != ' '){ + fit--; + + if(*(stringdup + sum + fit) == '\t') + break; + + if(fit == 0){ + fit = fitcpy; + break; + } + } + + TabbedTextOutW(graphics->hdc, + corners[0].x - roundr(ang_sin * (REAL) height), + corners[0].y + roundr(ang_cos * (REAL) height), + stringdup + sum, min(length - sum, fit), 0, 0, 0); + + sum += fit + (lret < fitcpy ? 1 : 0); + height += size.cy; + + if(height > roundr(rect->Height * rel_height)) + break; + } + + DeleteObject(rgn); + DeleteObject(gdifont); + + RestoreDC(graphics->hdc, save_state); + + return Ok; +} + GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path) { INT save_state; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index ba2a3ca..5883f09 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -76,6 +76,9 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics*,GpPen*,GpPath*); GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics*,GpPen*,GpRectF*,INT); +GpStatus WINGDIPAPI GdipDrawString(GpGraphics*,GDIPCONST WCHAR*,INT, + GDIPCONST GpFont*,GDIPCONST RectF*, GDIPCONST GpStringFormat*, + GDIPCONST GpBrush*); GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*); GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT, diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index d0fc8c4..7b08538 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -37,6 +37,7 @@ class GpPathGradient : public GpBrush {}; class GpLineGradient : public GpBrush {}; class GpTexture : public GpBrush {}; class GpFont {}; +class GpStringFormat {}; #else /* end of c++ declarations */ @@ -56,6 +57,7 @@ typedef struct GpPathGradient GpPathGradient; typedef struct GpLineGradient GpLineGradient; typedef struct GpTexture GpTexture; typedef struct GpFont GpFont; +typedef struct GpStringFormat GpStringFormat; #endif /* end of c declarations */
1
0
0
0
Paul Vriens : msvcrt/tests: Remove wrong FreeLibrary and fix typo's.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 059436d5362a81b1ebb855326fcc8d438541d080 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=059436d5362a81b1ebb855326…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Tue Aug 14 20:46:32 2007 +0200 msvcrt/tests: Remove wrong FreeLibrary and fix typo's. --- dlls/msvcrt/tests/cpp.c | 5 +---- dlls/msvcrt/tests/string.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index fa66349..5ffc27f 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -187,7 +187,7 @@ static void InitFunctionPtrs(void) hMsvcrt = GetModuleHandleA("msvcrt.dll"); if (!hMsvcrt) hMsvcrt = GetModuleHandleA("msvcrtd.dll"); - ok(hMsvcrt != 0, "LoadLibraryA failed\n"); + ok(hMsvcrt != 0, "GetModuleHandleA failed\n"); if (hMsvcrt) { SETNOFAIL(poperator_new, "??_U@YAPAXI@Z"); @@ -1004,8 +1004,5 @@ START_TEST(cpp) test_rtti(); test_demangle_datatype(); test_demangle(); - - if (hMsvcrt) - FreeLibrary(hMsvcrt); } #endif /* __i386__ */ diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index 8ff8bbd..7b434f7 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -135,7 +135,7 @@ START_TEST(string) hMsvcrt = GetModuleHandleA("msvcrt.dll"); if (!hMsvcrt) hMsvcrt = GetModuleHandleA("msvcrtd.dll"); - ok(hMsvcrt != 0, "LoadLibraryA failed\n"); + ok(hMsvcrt != 0, "GetModuleHandleA failed\n"); SET(pmemcpy,"memcpy"); SET(pmemcmp,"memcmp");
1
0
0
0
Paul Vriens : crypt32/tests: Use GetModuleHandle and skip.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 16d9123377ece03b1b854d9c2b829541193033db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16d9123377ece03b1b854d9c2…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Tue Aug 14 20:38:51 2007 +0200 crypt32/tests: Use GetModuleHandle and skip. --- dlls/crypt32/tests/main.c | 11 ++--------- dlls/crypt32/tests/sip.c | 17 ++++++----------- dlls/crypt32/tests/str.c | 34 ++++++++++++++++++++++++++-------- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/dlls/crypt32/tests/main.c b/dlls/crypt32/tests/main.c index e55d2d3..43c07bf 100644 --- a/dlls/crypt32/tests/main.c +++ b/dlls/crypt32/tests/main.c @@ -225,8 +225,6 @@ static void test_cryptTls(void) DWORD index; BOOL ret; - if (!hCrypt) return; - pI_CryptAllocTls = (I_CryptAllocTlsFunc)GetProcAddress(hCrypt, "I_CryptAllocTls"); pI_CryptDetachTls = (I_CryptDetachTlsFunc)GetProcAddress(hCrypt, @@ -290,8 +288,6 @@ static void test_readTrustedPublisherDWORD(void) { I_CryptReadTrustedPublisherDWORDValueFromRegistryFunc pReadDWORD; - if (!hCrypt) return; - pReadDWORD = (I_CryptReadTrustedPublisherDWORDValueFromRegistryFunc)GetProcAddress( hCrypt, "I_CryptReadTrustedPublisherDWORDValueFromRegistry"); @@ -335,8 +331,6 @@ static void test_getDefaultCryptProv(void) I_CryptGetDefaultCryptProvFunc pI_CryptGetDefaultCryptProv; HCRYPTPROV prov; - if (!hCrypt) return; - pI_CryptGetDefaultCryptProv = (I_CryptGetDefaultCryptProvFunc) GetProcAddress(hCrypt, "I_CryptGetDefaultCryptProv"); if (!pI_CryptGetDefaultCryptProv) return; @@ -362,8 +356,6 @@ static void test_CryptInstallOssGlobal(void) int ret,i; I_CryptInstallOssGlobal pI_CryptInstallOssGlobal; - if (!hCrypt) return; - pI_CryptInstallOssGlobal= (I_CryptInstallOssGlobal)GetProcAddress(hCrypt,"I_CryptInstallOssGlobal"); /* passing in some random values to I_CryptInstallOssGlobal, it always returns 9 the first time, then 10, 11 etc.*/ for(i=0;i<30;i++) @@ -375,7 +367,8 @@ static void test_CryptInstallOssGlobal(void) START_TEST(main) { - hCrypt = LoadLibraryA("crypt32.dll"); + hCrypt = GetModuleHandleA("crypt32.dll"); + test_findAttribute(); test_findExtension(); test_findRDNAttr(); diff --git a/dlls/crypt32/tests/sip.c b/dlls/crypt32/tests/sip.c index 5e33655..d47b6fc 100644 --- a/dlls/crypt32/tests/sip.c +++ b/dlls/crypt32/tests/sip.c @@ -295,17 +295,12 @@ static void test_SIPLoad(void) "Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError()); ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n"); - hCrypt = LoadLibraryA("crypt32.dll"); - if (hCrypt) - { - funcCryptSIPGetSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPGetSignedDataMsg"); - funcCryptSIPPutSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPPutSignedDataMsg"); - funcCryptSIPCreateIndirectData = (void*)GetProcAddress(hCrypt, "CryptSIPCreateIndirectData"); - funcCryptSIPVerifyIndirectData = (void*)GetProcAddress(hCrypt, "CryptSIPVerifyIndirectData"); - funcCryptSIPRemoveSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPRemoveSignedDataMsg"); - } - /* We're not going to use the functions, so we can free already here */ - FreeLibrary(hCrypt); + hCrypt = GetModuleHandleA("crypt32.dll"); + funcCryptSIPGetSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPGetSignedDataMsg"); + funcCryptSIPPutSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPPutSignedDataMsg"); + funcCryptSIPCreateIndirectData = (void*)GetProcAddress(hCrypt, "CryptSIPCreateIndirectData"); + funcCryptSIPVerifyIndirectData = (void*)GetProcAddress(hCrypt, "CryptSIPVerifyIndirectData"); + funcCryptSIPRemoveSignedDataMsg = (void*)GetProcAddress(hCrypt, "CryptSIPRemoveSignedDataMsg"); /* All OK */ SetLastError(0xdeadbeef); diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index c166e0e..e4cdb77 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -271,7 +271,11 @@ static void test_CertRDNValueToStrW(void) WCHAR buffer[2000]; CERT_RDN_VALUE_BLOB blob = { 0, NULL }; - if (!pCertRDNValueToStrW) return; + if (!pCertRDNValueToStrW) + { + skip("CertRDNValueToStrW is not available\n"); + return; + } /* This crashes ret = pCertRDNValueToStrW(0, NULL, NULL, 0); @@ -319,7 +323,11 @@ static void test_CertNameToStrA(void) { PCCERT_CONTEXT context; - if (!pCertNameToStrA) return; + if (!pCertNameToStrA) + { + skip("CertNameToStrA is not available\n"); + return; + } context = CertCreateCertificateContext(X509_ASN_ENCODING, cert, sizeof(cert)); @@ -392,7 +400,11 @@ static void test_CertNameToStrW(void) { PCCERT_CONTEXT context; - if (!pCertNameToStrW) return; + if (!pCertNameToStrW) + { + skip("CertNameToStrW is not available\n"); + return; + } context = CertCreateCertificateContext(X509_ASN_ENCODING, cert, sizeof(cert)); @@ -473,7 +485,11 @@ static void test_CertStrToNameA(void) DWORD size, i; BYTE buf[100]; - if (!pCertStrToNameA) return; + if (!pCertStrToNameA) + { + skip("CertStrToNameA is not available\n"); + return; + } /* Crash ret = pCertStrToNameA(0, NULL, 0, NULL, NULL, NULL, NULL); @@ -554,7 +570,11 @@ static void test_CertStrToNameW(void) LPCWSTR errorPtr; BYTE buf[100]; - if (!pCertStrToNameW) return; + if (!pCertStrToNameW) + { + skip("CertStrToNameW is not available\n"); + return; + } /* Crash ret = pCertStrToNameW(0, NULL, 0, NULL, NULL, NULL, NULL); @@ -600,7 +620,7 @@ static void test_CertStrToNameW(void) START_TEST(str) { - dll = LoadLibrary("Crypt32.dll"); + dll = GetModuleHandleA("Crypt32.dll"); pCertNameToStrA = (CertNameToStrAFunc)GetProcAddress(dll,"CertNameToStrA"); pCertNameToStrW = (CertNameToStrWFunc)GetProcAddress(dll,"CertNameToStrW"); @@ -619,6 +639,4 @@ START_TEST(str) test_CertNameToStrW(); test_CertStrToNameA(); test_CertStrToNameW(); - - FreeLibrary(dll); }
1
0
0
0
Juan Lang : crypt32: Set return value on exception.
by Alexandre Julliard
15 Aug '07
15 Aug '07
Module: wine Branch: master Commit: 714a3731eb92261735900e245ae1c91d7bd4c232 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=714a3731eb92261735900e245…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Tue Aug 14 11:32:33 2007 -0700 crypt32: Set return value on exception. Spotted by Paul Vriens. --- dlls/crypt32/msg.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 70527bd..a68bf52 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -209,6 +209,7 @@ static BOOL CDataEncodeMsg_Update(HCRYPTMSG hCryptMsg, const BYTE *pbData, __EXCEPT_PAGE_FAULT { SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; } __ENDTRY; }
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
109
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200