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
June 2008
----- 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
944 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdi32: Perform the world transform separately from font scaling.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: df76fe6f0cdd55568ba67489cc725813804061fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=df76fe6f0cdd55568ba67489c…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:11:40 2008 +0900 gdi32: Perform the world transform separately from font scaling. --- dlls/gdi32/freetype.c | 51 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 39 insertions(+), 12 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 69e077d..5a37170 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -3482,8 +3482,7 @@ found: it = lf.lfItalic ? 1 : 0; bd = lf.lfWeight > 550 ? 1 : 0; - height = GDI_ROUND( (double)lf.lfHeight * dc->xformWorld2Vport.eM22 ); - height = lf.lfHeight < 0 ? -abs(height) : abs(height); + height = lf.lfHeight; face = best = best_bitmap = NULL; LIST_FOR_EACH_ENTRY(face, &family->faces, Face, entry) @@ -4260,6 +4259,12 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, return count; } +static inline BOOL is_identity_FMAT2(const FMAT2 *matrix) +{ + static const FMAT2 identity = { 1.0, 0.0, 0.0, 1.0 }; + return !memcmp(matrix, &identity, sizeof(FMAT2)); +} + /************************************************************* * WineEngGetGlyphOutline * @@ -4340,7 +4345,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, /* Scaling factor */ if (font->aveWidth && font->potm) { - widthRatio = (double)font->aveWidth * font->font_desc.matrix.eM11; + widthRatio = (double)font->aveWidth; widthRatio /= (double)font->potm->otmTextMetrics.tmAveCharWidth; } else @@ -4393,6 +4398,18 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, needsTransform = TRUE; } + /* World transform */ + if (!is_identity_FMAT2(&font->font_desc.matrix)) + { + FT_Matrix worldMat; + worldMat.xx = FT_FixedFromFloat(font->font_desc.matrix.eM11); + worldMat.xy = FT_FixedFromFloat(font->font_desc.matrix.eM21); + worldMat.yx = FT_FixedFromFloat(font->font_desc.matrix.eM12); + worldMat.yy = FT_FixedFromFloat(font->font_desc.matrix.eM22); + pFT_Matrix_Multiply(&worldMat, &transMat); + needsTransform = TRUE; + } + /* Extra transformation specified by caller */ if (lpmat) { FT_Matrix extraMat; @@ -4857,24 +4874,34 @@ static BOOL get_bitmap_text_metrics(GdiFont *font) static void scale_font_metrics(const GdiFont *font, LPTEXTMETRICW ptm) { - double scale_x; + double scale_x, scale_y; if (font->aveWidth) { - scale_x = (double)font->aveWidth * font->font_desc.matrix.eM11; + scale_x = (double)font->aveWidth; scale_x /= (double)font->potm->otmTextMetrics.tmAveCharWidth; } else scale_x = font->scale_y; - ptm->tmHeight = (double)ptm->tmHeight * font->scale_y; - ptm->tmAscent = (double)ptm->tmAscent * font->scale_y; - ptm->tmDescent = (double)ptm->tmDescent * font->scale_y; - ptm->tmInternalLeading = (double)ptm->tmInternalLeading * font->scale_y; - ptm->tmExternalLeading = (double)ptm->tmExternalLeading * font->scale_y; + scale_x *= fabs(font->font_desc.matrix.eM11); + scale_y = font->scale_y * fabs(font->font_desc.matrix.eM22); + +#define SCALE_X(x) (x) = GDI_ROUND((double)(x) * (scale_x)) +#define SCALE_Y(y) (y) = GDI_ROUND((double)(y) * (scale_y)) + + SCALE_Y(ptm->tmHeight); + SCALE_Y(ptm->tmAscent); + SCALE_Y(ptm->tmDescent); + SCALE_Y(ptm->tmInternalLeading); + SCALE_Y(ptm->tmExternalLeading); + SCALE_Y(ptm->tmOverhang); + + SCALE_X(ptm->tmAveCharWidth); + SCALE_X(ptm->tmMaxCharWidth); - ptm->tmAveCharWidth = (double)ptm->tmAveCharWidth * scale_x; - ptm->tmMaxCharWidth = (double)ptm->tmMaxCharWidth * scale_x; +#undef SCALE_X +#undef SCALE_Y } /*************************************************************
1
0
0
0
Dmitry Timoshkov : gdi32: Font scaling transform is performed separately.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 8a6628aea59f6f7ba0eb85d6a72297bbb72e7b85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a6628aea59f6f7ba0eb85d6a…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:11:21 2008 +0900 gdi32: Font scaling transform is performed separately. --- dlls/gdi32/freetype.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index bccb063..69e077d 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4346,15 +4346,16 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, else widthRatio = font->scale_y; - left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; - right = (INT)((ft_face->glyph->metrics.horiBearingX + ft_face->glyph->metrics.width) * widthRatio + 63) & -64; + left = (INT)(ft_face->glyph->metrics.horiBearingX) & -64; + right = (INT)((ft_face->glyph->metrics.horiBearingX + ft_face->glyph->metrics.width) + 63) & -64; - adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; + adv = (INT)((ft_face->glyph->metrics.horiAdvance) + 63) >> 6; lsb = left >> 6; bbx = (right - left) >> 6; /* Scaling transform */ - if(font->aveWidth) { + if (widthRatio != 1.0 || font->scale_y != 1.0) + { FT_Matrix scaleMat; scaleMat.xx = FT_FixedFromFloat(widthRatio); scaleMat.xy = 0;
1
0
0
0
Dmitry Timoshkov : gdi32: Don' t forget to update the glyph advance in the case of a custom transformation .
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 85c16fc45b2448972ce4aa22bade7774d8811d90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=85c16fc45b2448972ce4aa22b…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:11:05 2008 +0900 gdi32: Don't forget to update the glyph advance in the case of a custom transformation. --- dlls/gdi32/freetype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 1fc385d..bccb063 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4440,7 +4440,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, vec.x = ft_face->glyph->metrics.horiAdvance; vec.y = 0; pFT_Vector_Transform(&vec, &transMat); - lpgm->gmCellIncX = (vec.x+63) >> 6; + adv = lpgm->gmCellIncX = (vec.x+63) >> 6; lpgm->gmCellIncY = -((vec.y+63) >> 6); } lpgm->gmBlackBoxX = (right - left) >> 6;
1
0
0
0
Dmitry Timoshkov : gdi32: Initialize otmMacAscent, otmMacDescent, otmMacLineGap in outline text metrics.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 967572051003a45ee8da5dabb5ab18809bc6e989 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=967572051003a45ee8da5dabb…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:10:47 2008 +0900 gdi32: Initialize otmMacAscent, otmMacDescent, otmMacLineGap in outline text metrics. --- dlls/gdi32/freetype.c | 8 ++++---- dlls/gdi32/tests/font.c | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 57164bd..1fc385d 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -5103,7 +5103,6 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, } TM.tmCharSet = font->charset; -#undef TM font->potm->otmFiller = 0; memcpy(&font->potm->otmPanoseNumber, pOS2->panose, PANOSE_COUNT); @@ -5122,9 +5121,9 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, font->potm->otmrcFontBox.right = (pFT_MulFix(ft_face->bbox.xMax, x_scale) + 32) >> 6; font->potm->otmrcFontBox.top = (pFT_MulFix(ft_face->bbox.yMax, y_scale) + 32) >> 6; font->potm->otmrcFontBox.bottom = (pFT_MulFix(ft_face->bbox.yMin, y_scale) + 32) >> 6; - font->potm->otmMacAscent = 0; /* where do these come from ? */ - font->potm->otmMacDescent = 0; - font->potm->otmMacLineGap = 0; + font->potm->otmMacAscent = TM.tmAscent; + font->potm->otmMacDescent = -TM.tmDescent; + font->potm->otmMacLineGap = font->potm->otmLineGap; font->potm->otmusMinimumPPEM = 0; /* TT Header */ font->potm->otmptSubscriptSize.x = (pFT_MulFix(pOS2->ySubscriptXSize, x_scale) + 32) >> 6; font->potm->otmptSubscriptSize.y = (pFT_MulFix(pOS2->ySubscriptYSize, y_scale) + 32) >> 6; @@ -5143,6 +5142,7 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize, font->potm->otmsUnderscoreSize = (pFT_MulFix(pPost->underlineThickness, y_scale) + 32) >> 6; font->potm->otmsUnderscorePosition = (pFT_MulFix(pPost->underlinePosition, y_scale) + 32) >> 6; } +#undef TM /* otmp* members should clearly have type ptrdiff_t, but M$ knows best */ cp = (char*)font->potm + sizeof(*font->potm); diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 3ae512c..0cffbfb 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -30,6 +30,7 @@ #include "wine/test.h" +#define near_match(a, b) (abs((a) - (b)) <= 4) #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) LONG (WINAPI *pGdiGetCharDimensions)(HDC hdc, LPTEXTMETRICW lptm, LONG *height); @@ -781,6 +782,8 @@ static void test_GetKerningPairs(void) kd[i].otmDescent, otm.otmDescent); ok(kd[i].otmLineGap == otm.otmLineGap, "expected %u, got %u\n", kd[i].otmLineGap, otm.otmLineGap); + ok(near_match(kd[i].otmMacDescent, otm.otmMacDescent), "expected %d, got %d\n", + kd[i].otmMacDescent, otm.otmMacDescent); todo_wine { ok(kd[i].otmsCapEmHeight == otm.otmsCapEmHeight, "expected %u, got %u\n", kd[i].otmsCapEmHeight, otm.otmsCapEmHeight); @@ -788,8 +791,6 @@ todo_wine { kd[i].otmsXHeight, otm.otmsXHeight); ok(kd[i].otmMacAscent == otm.otmMacAscent, "expected %d, got %d\n", kd[i].otmMacAscent, otm.otmMacAscent); - ok(kd[i].otmMacDescent == otm.otmMacDescent, "expected %d, got %d\n", - kd[i].otmMacDescent, otm.otmMacDescent); /* FIXME: this one sometimes succeeds due to expected 0, enable it when removing todo */ if (0) ok(kd[i].otmMacLineGap == otm.otmMacLineGap, "expected %u, got %u\n", kd[i].otmMacLineGap, otm.otmMacLineGap);
1
0
0
0
Dmitry Timoshkov : gdi32: Perform font height scaling with higher precision .
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: e378795970719793f52e8bd4832d585ab9b45986 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e378795970719793f52e8bd48…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:10:27 2008 +0900 gdi32: Perform font height scaling with higher precision. --- dlls/gdi32/freetype.c | 51 ++++++++++++++++++++++++++++-------------------- 1 files changed, 30 insertions(+), 21 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index dddfb6a..57164bd 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -328,7 +328,7 @@ struct tagGdiFont { INT orientation; FONT_DESC font_desc; LONG aveWidth, ppem; - float scale_y; + double scale_y; SHORT yMax; SHORT yMin; DWORD ntmFlags; @@ -807,7 +807,7 @@ static inline BOOL is_win9x(void) in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed. It fails if the integer part of the float number is greater than SHORT_MAX. */ -static inline FT_Fixed FT_FixedFromFloat(float f) +static inline FT_Fixed FT_FixedFromFloat(double f) { short value = f; unsigned short fract = (f - value) * 0xFFFF; @@ -2681,11 +2681,11 @@ static LONG calc_ppem_for_height(FT_Face ft_face, LONG height) if(height > 0) { if(pOS2->usWinAscent + pOS2->usWinDescent == 0) - ppem = ft_face->units_per_EM * height / - (pHori->Ascender - pHori->Descender); + ppem = MulDiv(ft_face->units_per_EM, height, + pHori->Ascender - pHori->Descender); else - ppem = ft_face->units_per_EM * height / - (pOS2->usWinAscent + pOS2->usWinDescent); + ppem = MulDiv(ft_face->units_per_EM, height, + pOS2->usWinAscent + pOS2->usWinDescent); } else ppem = -height; @@ -2785,6 +2785,7 @@ static FT_Face OpenFontFace(GdiFont *font, Face *face, LONG width, LONG height) font->ppem = load_VDMX(font, height); if(font->ppem == 0) font->ppem = calc_ppem_for_height(ft_face, height); + TRACE("height %d => ppem %d\n", height, font->ppem); if((err = pFT_Set_Pixel_Sizes(ft_face, 0, font->ppem)) != 0) WARN("FT_Set_Pixel_Sizes %d, %d rets %x\n", 0, font->ppem, err); @@ -3271,6 +3272,11 @@ GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont) lf.lfWeight, lf.lfPitchAndFamily, lf.lfCharSet, lf.lfOrientation, lf.lfEscapement); + TRACE("DC transform %f %f %f %f %f %f\n", + dc->xformWorld2Vport.eM11, dc->xformWorld2Vport.eM12, + dc->xformWorld2Vport.eM21, dc->xformWorld2Vport.eM22, + dc->xformWorld2Vport.eDx, dc->xformWorld2Vport.eDy); + /* check the cache first */ if((ret = find_in_cache(hfont, &lf, &dc->xformWorld2Vport, can_use_bitmap)) != NULL) { TRACE("returning cached gdiFont(%p) for hFont %p\n", ret, hfont); @@ -4276,16 +4282,19 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, INT left, right, top = 0, bottom = 0, adv, lsb, bbx; FT_Angle angle = 0; FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; - float widthRatio = 1.0; + double widthRatio = 1.0; FT_Matrix transMat = identityMat; BOOL needsTransform = FALSE; BOOL tategaki = (font->GSUB_Table != NULL); UINT original_index; - TRACE("%p, %04x, %08x, %p, %08x, %p, %p\n", font, glyph, format, lpgm, buflen, buf, lpmat); + TRACE("font transform %f %f %f %f\n", + font->font_desc.matrix.eM11, font->font_desc.matrix.eM12, + font->font_desc.matrix.eM21, font->font_desc.matrix.eM22); + EnterCriticalSection( &freetype_cs ); if(format & GGO_GLYPH_INDEX) { @@ -4331,8 +4340,8 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, /* Scaling factor */ if (font->aveWidth && font->potm) { - widthRatio = (float)font->aveWidth * font->font_desc.matrix.eM11; - widthRatio /= (float)font->potm->otmTextMetrics.tmAveCharWidth; + widthRatio = (double)font->aveWidth * font->font_desc.matrix.eM11; + widthRatio /= (double)font->potm->otmTextMetrics.tmAveCharWidth; } else widthRatio = font->scale_y; @@ -4372,7 +4381,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, if(font->orientation && !tategaki) { FT_Matrix rotationMat; FT_Vector vecAngle; - angle = FT_FixedFromFloat((float)font->orientation / 10.0); + angle = FT_FixedFromFloat((double)font->orientation / 10.0); pFT_Vector_Unit(&vecAngle, angle); rotationMat.xx = vecAngle.x; rotationMat.xy = -vecAngle.y; @@ -4847,24 +4856,24 @@ static BOOL get_bitmap_text_metrics(GdiFont *font) static void scale_font_metrics(const GdiFont *font, LPTEXTMETRICW ptm) { - float scale_x; + double scale_x; if (font->aveWidth) { - scale_x = (float)font->aveWidth * font->font_desc.matrix.eM11; - scale_x /= (float)font->potm->otmTextMetrics.tmAveCharWidth; + scale_x = (double)font->aveWidth * font->font_desc.matrix.eM11; + scale_x /= (double)font->potm->otmTextMetrics.tmAveCharWidth; } else scale_x = font->scale_y; - ptm->tmHeight = (float)ptm->tmHeight * font->scale_y; - ptm->tmAscent = (float)ptm->tmAscent * font->scale_y; - ptm->tmDescent = (float)ptm->tmDescent * font->scale_y; - ptm->tmInternalLeading = (float)ptm->tmInternalLeading * font->scale_y; - ptm->tmExternalLeading = (float)ptm->tmExternalLeading * font->scale_y; + ptm->tmHeight = (double)ptm->tmHeight * font->scale_y; + ptm->tmAscent = (double)ptm->tmAscent * font->scale_y; + ptm->tmDescent = (double)ptm->tmDescent * font->scale_y; + ptm->tmInternalLeading = (double)ptm->tmInternalLeading * font->scale_y; + ptm->tmExternalLeading = (double)ptm->tmExternalLeading * font->scale_y; - ptm->tmAveCharWidth = (float)ptm->tmAveCharWidth * scale_x; - ptm->tmMaxCharWidth = (float)ptm->tmMaxCharWidth * scale_x; + ptm->tmAveCharWidth = (double)ptm->tmAveCharWidth * scale_x; + ptm->tmMaxCharWidth = (double)ptm->tmMaxCharWidth * scale_x; } /*************************************************************
1
0
0
0
Dmitry Timoshkov : gdi32: Make GetOutlineTextMetrics set tmDigitizedAspectX /Y to real values as GetTextMetrics does.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: ade4132b25fca4542f536869024b6f2f3d00104d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ade4132b25fca4542f5368690…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Tue Jun 24 16:10:08 2008 +0900 gdi32: Make GetOutlineTextMetrics set tmDigitizedAspectX/Y to real values as GetTextMetrics does. --- dlls/gdi32/font.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 1bfd97a..b43873a 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1410,6 +1410,9 @@ UINT WINAPI GetOutlineTextMetricsW( WineEngGetOutlineTextMetrics(dc->gdiFont, ret, output); } + output->otmTextMetrics.tmDigitizedAspectX = GetDeviceCaps(hdc, LOGPIXELSX); + output->otmTextMetrics.tmDigitizedAspectY = GetDeviceCaps(hdc, LOGPIXELSY); + #define WDPTOLP(x) ((x<0)? \ (-abs(INTERNAL_XDSTOWS(dc, (x)))): \ (abs(INTERNAL_XDSTOWS(dc, (x)))))
1
0
0
0
Dan Kegel : wininet: InternetCrackUrlW: For URLs that have no urlpath, native clears lpszUrlPath.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: bcdb10a9edb26649c290ff384443d8c7ee8014ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bcdb10a9edb26649c290ff384…
Author: Dan Kegel <dank(a)kegel.com> Date: Mon Jun 23 21:42:51 2008 -0700 wininet: InternetCrackUrlW: For URLs that have no urlpath, native clears lpszUrlPath. --- dlls/wininet/internet.c | 2 ++ dlls/wininet/tests/url.c | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 41e7b2d..388a2a9 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1490,6 +1490,8 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR } else { + if (lpUC->lpszUrlPath && (lpUC->dwUrlPathLength > 0)) + lpUC->lpszUrlPath[0] = 0; lpUC->dwUrlPathLength = 0; } diff --git a/dlls/wininet/tests/url.c b/dlls/wininet/tests/url.c index ccc5607..e9f2439 100644 --- a/dlls/wininet/tests/url.c +++ b/dlls/wininet/tests/url.c @@ -268,6 +268,7 @@ static void InternetCrackUrlW_test(void) '=','I','D','E','&','A','C','T','I','O','N','=','I','D','E','_','D','E','F','A', 'U','L','T', 0 }; static const WCHAR url2[] = { '.','.','/','R','i','t','z','.','x','m','l',0 }; + static const WCHAR url3[] = { 'h','t','t','p',':','/','/','x','.','o','r','g',0 }; URL_COMPONENTSW comp; WCHAR scheme[20], host[20], user[20], pwd[20], urlpart[50], extra[50]; DWORD error; @@ -389,6 +390,32 @@ static void InternetCrackUrlW_test(void) "InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %d\n", GetLastError()); } + + /* Test to see whether cracking a URL without a filename initializes urlpart */ + urlpart[0]=0xba; + scheme[0]=0; + extra[0]=0; + host[0]=0; + user[0]=0; + pwd[0]=0; + memset(&comp, 0, sizeof comp); + comp.dwStructSize = sizeof comp; + comp.lpszScheme = scheme; + comp.dwSchemeLength = sizeof scheme; + comp.lpszHostName = host; + comp.dwHostNameLength = sizeof host; + comp.lpszUserName = user; + comp.dwUserNameLength = sizeof user; + comp.lpszPassword = pwd; + comp.dwPasswordLength = sizeof pwd; + comp.lpszUrlPath = urlpart; + comp.dwUrlPathLength = sizeof urlpart; + comp.lpszExtraInfo = extra; + comp.dwExtraInfoLength = sizeof extra; + r = InternetCrackUrlW(url3, 0, 0, &comp ); + ok( r, "InternetCrackUrlW failed unexpectedly\n"); + ok( host[0] == 'x', "host should be x.org\n"); + ok( urlpart[0] == 0, "urlpart should be empty\n"); } static void fill_url_components(LPURL_COMPONENTS lpUrlComponents)
1
0
0
0
James Hawkins : msi: Add tests for MsiGetUserInfo.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 0097275f3f6d0b9901ffb800ae28c26505d01fb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0097275f3f6d0b9901ffb800a…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Jun 23 23:08:54 2008 -0500 msi: Add tests for MsiGetUserInfo. --- dlls/msi/tests/msi.c | 580 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 580 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0097275f3f6d0b9901ffb…
1
0
0
0
James Hawkins : msi: Reimplement MsiGetUserInfo.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 41fe12f1492713697e1adf134bc3cf2b82b2c0a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41fe12f1492713697e1adf134…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Jun 23 23:08:06 2008 -0500 msi: Reimplement MsiGetUserInfo. --- dlls/msi/msi.c | 98 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 72 insertions(+), 26 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 7c83946..f903d05 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -2295,57 +2295,93 @@ static USERINFOSTATE WINAPI MSI_GetUserInfo(LPCWSTR szProduct, awstring *lpOrgNameBuf, LPDWORD pcchOrgNameBuf, awstring *lpSerialBuf, LPDWORD pcchSerialBuf) { - HKEY hkey; + WCHAR squished_pc[SQUISH_GUID_SIZE]; LPWSTR user, org, serial; - UINT r; USERINFOSTATE state; + HKEY hkey, props; + LPCWSTR orgptr; + UINT r; - TRACE("%s %p %p %p %p %p %p\n",debugstr_w(szProduct), lpUserNameBuf, + static const WCHAR szEmpty[] = {0}; + + TRACE("%s %p %p %p %p %p %p\n", debugstr_w(szProduct), lpUserNameBuf, pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf, pcchSerialBuf); - if (!szProduct) + if (!szProduct || !squash_guid(szProduct, squished_pc)) return USERINFOSTATE_INVALIDARG; - r = MSIREG_OpenUninstallKey(szProduct, &hkey, FALSE); - if (r != ERROR_SUCCESS) + if (MSIREG_OpenLocalManagedProductKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenUserProductsKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && + MSIREG_OpenLocalClassesProductKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS) + { return USERINFOSTATE_UNKNOWN; + } + + if (MSIREG_OpenCurrentUserInstallProps(szProduct, &props, FALSE) != ERROR_SUCCESS && + MSIREG_OpenLocalSystemInstallProps(szProduct, &props, FALSE) != ERROR_SUCCESS) + { + RegCloseKey(hkey); + return USERINFOSTATE_ABSENT; + } - user = msi_reg_get_val_str( hkey, INSTALLPROPERTY_REGOWNERW ); - org = msi_reg_get_val_str( hkey, INSTALLPROPERTY_REGCOMPANYW ); - serial = msi_reg_get_val_str( hkey, INSTALLPROPERTY_PRODUCTIDW ); + user = msi_reg_get_val_str(props, INSTALLPROPERTY_REGOWNERW); + org = msi_reg_get_val_str(props, INSTALLPROPERTY_REGCOMPANYW); + serial = msi_reg_get_val_str(props, INSTALLPROPERTY_PRODUCTIDW); + state = USERINFOSTATE_ABSENT; RegCloseKey(hkey); + RegCloseKey(props); - state = USERINFOSTATE_PRESENT; + if (user && serial) + state = USERINFOSTATE_PRESENT; - if (user) + if (pcchUserNameBuf) { - r = msi_strcpy_to_awstring( user, lpUserNameBuf, pcchUserNameBuf ); + if (lpUserNameBuf && !user) + { + (*pcchUserNameBuf)--; + goto done; + } + + r = msi_strcpy_to_awstring(user, lpUserNameBuf, pcchUserNameBuf); if (r == ERROR_MORE_DATA) + { state = USERINFOSTATE_MOREDATA; + goto done; + } } - else - state = USERINFOSTATE_ABSENT; - if (org) + + if (pcchOrgNameBuf) { - r = msi_strcpy_to_awstring( org, lpOrgNameBuf, pcchOrgNameBuf ); - if (r == ERROR_MORE_DATA && state == USERINFOSTATE_PRESENT) + orgptr = org; + if (!orgptr) orgptr = szEmpty; + + r = msi_strcpy_to_awstring(orgptr, lpOrgNameBuf, pcchOrgNameBuf); + if (r == ERROR_MORE_DATA) + { state = USERINFOSTATE_MOREDATA; + goto done; + } } - /* msdn states: The user information is considered to be present even in the absence of a company name. */ - if (serial) + + if (pcchSerialBuf) { - r = msi_strcpy_to_awstring( serial, lpSerialBuf, pcchSerialBuf ); - if (r == ERROR_MORE_DATA && state == USERINFOSTATE_PRESENT) + if (!serial) + { + (*pcchSerialBuf)--; + goto done; + } + + r = msi_strcpy_to_awstring(serial, lpSerialBuf, pcchSerialBuf); + if (r == ERROR_MORE_DATA) state = USERINFOSTATE_MOREDATA; } - else - state = USERINFOSTATE_ABSENT; - msi_free( user ); - msi_free( org ); - msi_free( serial ); +done: + msi_free(user); + msi_free(org); + msi_free(serial); return state; } @@ -2360,6 +2396,11 @@ USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR szProduct, { awstring user, org, serial; + if ((lpUserNameBuf && !pcchUserNameBuf) || + (lpOrgNameBuf && !pcchOrgNameBuf) || + (lpSerialBuf && !pcchSerialBuf)) + return USERINFOSTATE_INVALIDARG; + user.unicode = TRUE; user.str.w = lpUserNameBuf; org.unicode = TRUE; @@ -2381,6 +2422,11 @@ USERINFOSTATE WINAPI MsiGetUserInfoA(LPCSTR szProduct, LPWSTR prod; UINT r; + if ((lpUserNameBuf && !pcchUserNameBuf) || + (lpOrgNameBuf && !pcchOrgNameBuf) || + (lpSerialBuf && !pcchSerialBuf)) + return USERINFOSTATE_INVALIDARG; + prod = strdupAtoW( szProduct ); if (szProduct && !prod) return ERROR_OUTOFMEMORY;
1
0
0
0
James Hawkins : msi: Handle the machine context in MsiQueryFeatureState.
by Alexandre Julliard
24 Jun '08
24 Jun '08
Module: wine Branch: master Commit: 72fedf7d88e09125ca274e2d6fd3273d2fda9b48 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72fedf7d88e09125ca274e2d6…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Mon Jun 23 23:07:11 2008 -0500 msi: Handle the machine context in MsiQueryFeatureState. --- dlls/msi/msi.c | 21 +++++++++++++++++---- dlls/msi/tests/msi.c | 45 +++++++++------------------------------------ 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index b2e1345..7c83946 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1812,6 +1812,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) HKEY hkey; INSTALLSTATE r; BOOL missing = FALSE; + BOOL machine = FALSE; TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature)); @@ -1824,7 +1825,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) if (MSIREG_OpenManagedFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS && MSIREG_OpenUserFeaturesKey(szProduct, &hkey, FALSE) != ERROR_SUCCESS) { - return INSTALLSTATE_UNKNOWN; + rc = MSIREG_OpenLocalClassesFeaturesKey(szProduct, &hkey, FALSE); + if (rc != ERROR_SUCCESS) + return INSTALLSTATE_UNKNOWN; + + machine = TRUE; } parent_feature = msi_reg_get_val_str( hkey, szFeature ); @@ -1838,8 +1843,11 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) if (r == INSTALLSTATE_ABSENT) return r; - /* now check if it's complete or advertised */ - rc = MSIREG_OpenUserDataFeaturesKey(szProduct, &hkey, FALSE); + if (machine) + rc = MSIREG_OpenLocalUserDataFeaturesKey(szProduct, &hkey, FALSE); + else + rc = MSIREG_OpenUserDataFeaturesKey(szProduct, &hkey, FALSE); + if (rc != ERROR_SUCCESS) return INSTALLSTATE_ADVERTISED; @@ -1863,7 +1871,12 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) } StringFromGUID2(&guid, comp, GUID_SIZE); - rc = MSIREG_OpenUserDataComponentKey(comp, &hkey, FALSE); + + if (machine) + rc = MSIREG_OpenLocalUserDataComponentKey(comp, &hkey, FALSE); + else + rc = MSIREG_OpenUserDataComponentKey(comp, &hkey, FALSE); + if (rc != ERROR_SUCCESS) { msi_free(components); diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index f094c2d..2ec93ab 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -930,10 +930,7 @@ static void test_MsiQueryFeatureState(void) /* feature value exists */ state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\"); lstrcatA(keypath, "S-1-5-18\\Products\\"); @@ -945,46 +942,31 @@ static void test_MsiQueryFeatureState(void) /* userdata features key exists */ state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaa", 20); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_BADCONFIG, "Expected INSTALLSTATE_BADCONFIG, got %d\n", state); - } + ok(state == INSTALLSTATE_BADCONFIG, "Expected INSTALLSTATE_BADCONFIG, got %d\n", state); res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaaa", 21); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)"aaaaaaaaaaaaaaaaaaaaa", 22); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); res = RegSetValueExA(localkey, "feature", 0, REG_SZ, (const BYTE *)comp_base85, 21); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\"); lstrcatA(keypath, "S-1-5-18\\Components\\"); @@ -994,28 +976,19 @@ static void test_MsiQueryFeatureState(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); - } + ok(state == INSTALLSTATE_ADVERTISED, "Expected INSTALLSTATE_ADVERTISED, got %d\n", state); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"", 1); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); res = RegSetValueExA(compkey, prod_squashed, 0, REG_SZ, (const BYTE *)"apple", 1); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); state = MsiQueryFeatureStateA(prodcode, "feature"); - todo_wine - { - ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - } + ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); RegDeleteValueA(compkey, prod_squashed); RegDeleteKeyA(compkey, "");
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
95
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
Results per page:
10
25
50
100
200