FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net --- dlls/gdi32/freetype.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b7e2413753..468c1951b6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void)
static BOOL is_subpixel_rendering_enabled( void ) { -#ifdef FT_LCD_FILTER_H static int enabled = -1; if (enabled == -1) { - enabled = (pFT_Library_SetLcdFilter && - pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature); + /* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */ + if ( FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0))) + enabled = TRUE; +#ifdef FT_LCD_FILTER_H + else if ( pFT_Library_SetLcdFilter && + pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature ) + enabled = TRUE; +#endif + else enabled = FALSE; + TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT "); } return enabled; -#else - return FALSE; -#endif }
@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, case WINE_GGO_HBGR_BITMAP: case WINE_GGO_VRGB_BITMAP: case WINE_GGO_VBGR_BITMAP: -#ifdef FT_LCD_FILTER_H { switch (ft_face->glyph->format) { @@ -7360,8 +7363,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki);
- if ( pFT_Library_SetLcdFilter ) +#ifdef FT_LCD_FILTER_H + if ( FT_SimpleVersion < ((2 << 16) | (8 << 8) | (1 << 0)) && + pFT_Library_SetLcdFilter ) pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT ); +#endif pFT_Render_Glyph (ft_face->glyph, render_mode);
src = ft_face->glyph->bitmap.buffer; @@ -7442,9 +7448,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
break; } -#else - return GDI_ERROR; -#endif
case GGO_NATIVE: {
* 'if' branch removed in the loop. * glyph bitmap data is alpha value. Shift 24 part is unnecessary.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net --- dlls/gdi32/freetype.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 468c1951b6..1f2ed3af55 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -7323,7 +7323,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, BYTE *src; INT x, src_pitch, src_width, src_height, rgb_interval, hmul, vmul; INT x_shift, y_shift; - BOOL rgb; + INT rgb[3] = { 0, 1, 2 }; /* WINE_GGO_{H,V}RGB_BITMAP */ FT_Render_Mode render_mode = (format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_HBGR_BITMAP)? FT_RENDER_MODE_LCD: FT_RENDER_MODE_LCD_V; @@ -7358,7 +7358,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
memset(buf, 0, buflen); dst = buf; - rgb = (format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_VRGB_BITMAP);
if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki); @@ -7415,24 +7414,20 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, width = min( width, src_width / hmul ); height = min( height, src_height / vmul );
+ if ( format == WINE_GGO_HBGR_BITMAP || format == WINE_GGO_VBGR_BITMAP) + { + rgb[0] = 2; + rgb[1] = 1; + rgb[2] = 0; + } + while ( height-- ) { for ( x = 0; x < width; x++ ) { - if ( rgb ) - { - dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 0] << 16) | - ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | - ((unsigned int)src[hmul * x + rgb_interval * 2] << 0) | - ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; - } - else - { - dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 2] << 16) | - ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | - ((unsigned int)src[hmul * x + rgb_interval * 0] << 0) | - ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; - } + dst[x] = ((unsigned int)src[hmul * x + rgb_interval * rgb[0]] << 16) | + ((unsigned int)src[hmul * x + rgb_interval * rgb[1]] << 8) | + ((unsigned int)src[hmul * x + rgb_interval * rgb[2]]); } src += src_pitch * vmul; dst += pitch / sizeof(*dst);
On 10/04/2018 03:17 PM, Byeongsik Jeon wrote:
FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net
dlls/gdi32/freetype.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b7e2413753..468c1951b6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void)
static BOOL is_subpixel_rendering_enabled( void ) { -#ifdef FT_LCD_FILTER_H static int enabled = -1; if (enabled == -1) {
enabled = (pFT_Library_SetLcdFilter &&
pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature);
/* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */
if ( FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0)))
enabled = TRUE;
+#ifdef FT_LCD_FILTER_H
else if ( pFT_Library_SetLcdFilter &&
pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature )
enabled = TRUE;
+#endif
else enabled = FALSE;
TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT "); } return enabled;
-#else
- return FALSE;
-#endif }
Could you explain why does this make a difference? I'd expect FT_Library_SetLcdFilter to be still functional in 2.8.1+, also how is this new rendering mode is enabled?
@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, case WINE_GGO_HBGR_BITMAP: case WINE_GGO_VRGB_BITMAP: case WINE_GGO_VBGR_BITMAP: -#ifdef FT_LCD_FILTER_H { switch (ft_face->glyph->format) { @@ -7360,8 +7363,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki);
if ( pFT_Library_SetLcdFilter )
+#ifdef FT_LCD_FILTER_H
if ( FT_SimpleVersion < ((2 << 16) | (8 << 8) | (1 << 0)) &&
pFT_Library_SetLcdFilter ) pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT );
+#endif pFT_Render_Glyph (ft_face->glyph, render_mode);
src = ft_face->glyph->bitmap.buffer;
@@ -7442,9 +7448,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
break; }
-#else
return GDI_ERROR;
-#endif
case GGO_NATIVE: {
On Fri, 5 Oct 2018 09:39:53 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:> On 10/04/2018 03:17 PM, Byeongsik Jeon wrote:
FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net
dlls/gdi32/freetype.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b7e2413753..468c1951b6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void) static BOOL is_subpixel_rendering_enabled( void ) { -#ifdef FT_LCD_FILTER_H static int enabled = -1; if (enabled == -1) { - enabled = (pFT_Library_SetLcdFilter && - pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature); + /* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */ + if ( FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0))) + enabled = TRUE; +#ifdef FT_LCD_FILTER_H + else if ( pFT_Library_SetLcdFilter && + pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature ) + enabled = TRUE; +#endif + else enabled = FALSE;
TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT "); } return enabled; -#else - return FALSE; -#endif }
Could you explain why does this make a difference? I'd expect FT_Library_SetLcdFilter to be still functional in 2.8.1+, also how is this new rendering mode is enabled?
Officially, FreeType says it has implemented its own subpixel rendering technology, aka Harmony. Now you can get subpixel rendered bitmaps even if you no longer activate FT_CONFIG_OPTION_SUBPIXEL_RENDERING. It's the default.
In this state, FT_Library_SetLcdFilter only includes "return FT_Err_Unimplemed_Feature;". Therefore, FT_Err_Uniplemented_Feature check is not the reliable way.
Because of programs that have not yet been updated like Wine now, the distribution packager may have deliberately activated FT_CONFIG_OPTION_SUBPIXEL_RENDERING. However, I think it is better not to use the function that FreeType intends to avoid.
Subpixel rendering is done by simply giving the suitable option to FT_Render_Glyph() or FT_Load_Glyph().
--- FreeType 2.8.1 News 2017-09-16 FreeType 2.8.1 has been released. This is mainly a maintenance release with one important change: By default, FreeType now offers high quality LCD-optimized output without resorting to ClearType techniques of resolution tripling and filtering. In this method, called Harmony, each color channel is generated separately after shifting the glyph outline, capitalizing on the fact that the color grids on LCD panels are shifted by a third of a pixel. This output is indistinguishable from ClearType with a light 3-tap filter.
Thanks.
@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, case WINE_GGO_HBGR_BITMAP: case WINE_GGO_VRGB_BITMAP: case WINE_GGO_VBGR_BITMAP: -#ifdef FT_LCD_FILTER_H { switch (ft_face->glyph->format) { @@ -7360,8 +7363,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki); - if ( pFT_Library_SetLcdFilter ) +#ifdef FT_LCD_FILTER_H + if ( FT_SimpleVersion < ((2 << 16) | (8 << 8) | (1 << 0)) && + pFT_Library_SetLcdFilter ) pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT ); +#endif pFT_Render_Glyph (ft_face->glyph, render_mode); src = ft_face->glyph->bitmap.buffer; @@ -7442,9 +7448,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, break; } -#else - return GDI_ERROR; -#endif case GGO_NATIVE: {
On 10/05/2018 01:49 PM, Byeongsik Jeon wrote:
On Fri, 5 Oct 2018 09:39:53 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:> On 10/04/2018 03:17 PM, Byeongsik Jeon wrote:
FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net
dlls/gdi32/freetype.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b7e2413753..468c1951b6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void) static BOOL is_subpixel_rendering_enabled( void ) { -#ifdef FT_LCD_FILTER_H static int enabled = -1; if (enabled == -1) { - enabled = (pFT_Library_SetLcdFilter && - pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature); + /* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */ + if ( FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0))) + enabled = TRUE; +#ifdef FT_LCD_FILTER_H + else if ( pFT_Library_SetLcdFilter && + pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature ) + enabled = TRUE; +#endif + else enabled = FALSE;
TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT "); } return enabled; -#else - return FALSE; -#endif }
Could you explain why does this make a difference? I'd expect FT_Library_SetLcdFilter to be still functional in 2.8.1+, also how is this new rendering mode is enabled?
Officially, FreeType says it has implemented its own subpixel rendering technology, aka Harmony. Now you can get subpixel rendered bitmaps even if you no longer activate FT_CONFIG_OPTION_SUBPIXEL_RENDERING. It's the default.
In this state, FT_Library_SetLcdFilter only includes "return FT_Err_Unimplemed_Feature;". Therefore, FT_Err_Uniplemented_Feature check is not the reliable way.
Because of programs that have not yet been updated like Wine now, the distribution packager may have deliberately activated FT_CONFIG_OPTION_SUBPIXEL_RENDERING. However, I think it is better not to use the function that FreeType intends to avoid.
Subpixel rendering is done by simply giving the suitable option to FT_Render_Glyph() or FT_Load_Glyph().
But FT_Library_SetLcdFilter still works if FT_CONFIG_OPTION_SUBPIXEL_RENDERING is enabled, right? It seems to me that we should keep checking for that first.
FreeType 2.8.1 News 2017-09-16 FreeType 2.8.1 has been released. This is mainly a maintenance release with one important change: By default, FreeType now offers high quality LCD-optimized output without resorting to ClearType techniques of resolution tripling and filtering. In this method, called Harmony, each color channel is generated separately after shifting the glyph outline, capitalizing on the fact that the color grids on LCD panels are shifted by a third of a pixel. This output is indistinguishable from ClearType with a light 3-tap filter.
Thanks.
@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, case WINE_GGO_HBGR_BITMAP: case WINE_GGO_VRGB_BITMAP: case WINE_GGO_VBGR_BITMAP: -#ifdef FT_LCD_FILTER_H { switch (ft_face->glyph->format) { @@ -7360,8 +7363,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki); - if ( pFT_Library_SetLcdFilter ) +#ifdef FT_LCD_FILTER_H + if ( FT_SimpleVersion < ((2 << 16) | (8 << 8) | (1 << 0)) && + pFT_Library_SetLcdFilter ) pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT ); +#endif pFT_Render_Glyph (ft_face->glyph, render_mode); src = ft_face->glyph->bitmap.buffer; @@ -7442,9 +7448,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, break; } -#else - return GDI_ERROR; -#endif case GGO_NATIVE: {
On Fri, 5 Oct 2018 16:52:27 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:
On 10/05/2018 01:49 PM, Byeongsik Jeon wrote:
On Fri, 5 Oct 2018 09:39:53 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:> On 10/04/2018 03:17 PM, Byeongsik Jeon wrote:
FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Signed-off-by: Byeongsik Jeon bsjeon@hanmail.net
dlls/gdi32/freetype.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index b7e2413753..468c1951b6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void) static BOOL is_subpixel_rendering_enabled( void ) { -#ifdef FT_LCD_FILTER_H static int enabled = -1; if (enabled == -1) { - enabled = (pFT_Library_SetLcdFilter && - pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature); + /* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */ + if ( FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0))) + enabled = TRUE; +#ifdef FT_LCD_FILTER_H + else if ( pFT_Library_SetLcdFilter && + pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature ) + enabled = TRUE; +#endif + else enabled = FALSE;
TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT "); } return enabled; -#else - return FALSE; -#endif }
Could you explain why does this make a difference? I'd expect FT_Library_SetLcdFilter to be still functional in 2.8.1+, also how is this new rendering mode is enabled?
Officially, FreeType says it has implemented its own subpixel rendering technology, aka Harmony. Now you can get subpixel rendered bitmaps even if you no longer activate FT_CONFIG_OPTION_SUBPIXEL_RENDERING. It's the default.
In this state, FT_Library_SetLcdFilter only includes "return FT_Err_Unimplemed_Feature;". Therefore, FT_Err_Uniplemented_Feature check is not the reliable way.
Because of programs that have not yet been updated like Wine now, the distribution packager may have deliberately activated FT_CONFIG_OPTION_SUBPIXEL_RENDERING. However, I think it is better not to use the function that FreeType intends to avoid.
Subpixel rendering is done by simply giving the suitable option to FT_Render_Glyph() or FT_Load_Glyph().
But FT_Library_SetLcdFilter still works if FT_CONFIG_OPTION_SUBPIXEL_RENDERING is enabled, right? It seems to me that we should keep checking for that first.
OK. I think I put my personal opinion in the patch. It can be eliminated by removing the version check inside GetGlyphOutline().
Should I send a modified patch?
FreeType 2.8.1 News 2017-09-16 FreeType 2.8.1 has been released. This is mainly a maintenance release with one important change: By default, FreeType now offers high quality LCD-optimized output without resorting to ClearType techniques of resolution tripling and filtering. In this method, called Harmony, each color channel is generated separately after shifting the glyph outline, capitalizing on the fact that the color grids on LCD panels are shifted by a third of a pixel. This output is indistinguishable from ClearType with a light 3-tap filter.
Thanks.
@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, case WINE_GGO_HBGR_BITMAP: case WINE_GGO_VRGB_BITMAP: case WINE_GGO_VBGR_BITMAP: -#ifdef FT_LCD_FILTER_H { switch (ft_face->glyph->format) { @@ -7360,8 +7363,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, if ( needsTransform ) pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki); - if ( pFT_Library_SetLcdFilter ) +#ifdef FT_LCD_FILTER_H + if ( FT_SimpleVersion < ((2 << 16) | (8 << 8) | (1 << 0)) && + pFT_Library_SetLcdFilter ) pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT ); +#endif pFT_Render_Glyph (ft_face->glyph, render_mode); src = ft_face->glyph->bitmap.buffer; @@ -7442,9 +7448,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, break; } -#else - return GDI_ERROR; -#endif case GGO_NATIVE: {
On Fri, Oct 05, 2018 at 11:47:08PM +0900, Byeongsik Jeon wrote:
On Fri, 5 Oct 2018 16:52:27 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:
On 10/05/2018 01:49 PM, Byeongsik Jeon wrote:
On Fri, 5 Oct 2018 09:39:53 +0300, Nikolay Sivov nsivov@codeweavers.com wrote:> On 10/04/2018 03:17 PM, Byeongsik Jeon wrote:
FreeType >= 2.8.1 support LCD-optimized rendering without LCD filters. It works regardless of FT_Err_Unimplemented_Feature check.
Could you explain why does this make a difference? I'd expect FT_Library_SetLcdFilter to be still functional in 2.8.1+, also how is this new rendering mode is enabled?
Officially, FreeType says it has implemented its own subpixel rendering technology, aka Harmony. Now you can get subpixel rendered bitmaps even if you no longer activate FT_CONFIG_OPTION_SUBPIXEL_RENDERING. It's the default.
In this state, FT_Library_SetLcdFilter only includes "return FT_Err_Unimplemed_Feature;". Therefore, FT_Err_Uniplemented_Feature check is not the reliable way.
Because of programs that have not yet been updated like Wine now, the distribution packager may have deliberately activated FT_CONFIG_OPTION_SUBPIXEL_RENDERING. However, I think it is better not to use the function that FreeType intends to avoid.
Subpixel rendering is done by simply giving the suitable option to FT_Render_Glyph() or FT_Load_Glyph().
But FT_Library_SetLcdFilter still works if FT_CONFIG_OPTION_SUBPIXEL_RENDERING is enabled, right? It seems to me that we should keep checking for that first.
OK. I think I put my personal opinion in the patch. It can be eliminated by removing the version check inside GetGlyphOutline().
Should I send a modified patch?
Yes please.
Huw.