[PATCH 8/9] user32: Implement WM_SETFONT margins in the CJK case.

Nikolay Sivov nsivov at codeweavers.com
Thu Mar 7 08:15:52 CST 2019


On 3/7/19 4:45 PM, Akihiro Sagawa wrote:

> +static BOOL get_cjk_font_margins(HDC hdc, BOOL unicode, SHORT *left, SHORT *right)
> +{
> +	ABC abc[256];
> +	UINT i;
> +
> +	*left = *right = 0;
> +	if (!unicode) {
> +		if (!GetCharABCWidthsA(hdc, 0, 255, abc))
> +			return FALSE;
> +	} else {
> +		if (!GetCharABCWidthsW(hdc, 0, 255, abc))
> +			return FALSE;
> +	}
> +	for (i = 0; i < ARRAY_SIZE(abc); i++) {
> +		if (-abc[i].abcA > *right) *right = -abc[i].abcA;
> +		if (-abc[i].abcC > *left ) *left  = -abc[i].abcC;
> +	}
> +	return TRUE;
> +}

Is it possible to demonstrate this with some font, specifically modified 
to have one glyph significantly of?

It seems to me it's much more likely it would be using some averaged 
metric instead, specified by the font.




More information about the wine-devel mailing list