X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C63853846075
Authentication-Results: sourceware.org;
 dmarc=none (p=none dis=none) header.from=towo.net
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=towo@towo.net
Subject: Re: mintty overstrokes some fonts unexpectedly
To: cygwin@cygwin.com
References: <20210425224102.FF0E.50F79699@gmail.com>
 <4660c89e-6cdd-1fda-f754-a9289f281ba3@towo.net>
 <20210426081451.EC3F.50F79699@gmail.com>
From: Thomas Wolff <towo@towo.net>
Message-ID: <19bb84cb-c503-238a-513f-42e8cb3c19de@towo.net>
Date: Mon, 26 Apr 2021 20:31:38 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
 Thunderbird/78.10.0
MIME-Version: 1.0
In-Reply-To: <20210426081451.EC3F.50F79699@gmail.com>
X-Provags-ID: V03:K1:StO5AXhGeFYG294trOaSWtXO1OeZab9KQfMeS4vCOQKHvLd3jB9
 9AoRh9bepCzmMC/DYixZUSMIBN82caDpUIr5cEBI7oMGL5eHyhDowKJV8XByuZAPfuKtgK6
 0ODW8XfPph+Gi7UT0MVlRw51DUNYetANN6+AqHhdpRDkoLa282BKDPBAn8ST6SnxR+OtZGA
 lFG55HGVtEjXhokV4nhVw==
X-UI-Out-Filterresults: notjunk:1;V03:K0:9HpNFEbfw1g=:I7EHV1BQJsu4LzbGHemP1V
 75g+t+i2LE2oPx+7cQUvVj7xtmRI8851fIromyjdfNRfQaPCT36Y+L5eLHNgTjAyEUG5xC821
 bVhsf94nrf9Ps5obQW0N3WNK3doci6Jty4zUQ6yNmV8JYi99zv/bv/YcDYPzaurS3TG5a5+hi
 Myw3M3hXZRc9rOPCuuLAP/RR0EAtsQn1/64I5K7n1YAj3QNSc2ApOxA5JOm5+mB+giDBkPk+F
 qBoNg1dnZ1FgtqHasPVsKJnwUFhXLi2G8uIE83YWxRBTzWJHMP82ReaCnntvXVJ2loFdwnrkm
 KUEZJWKxdscJOYGRf2XNChMnuAQ2tBkDmhh+gGmwlefL32mJf1mVI1wlb7p5/6sVPkJyRrGXt
 k/xgwCIlIIaa1jIYbzjkXdFNlss0WOiwE4c5FbcMbBi4Jluu12bcpugWKX7+ip0XMI1peYUIp
 Ok0BHG56nPqIky/WVMctkvMDZ4YQh3oHLArSJ1loAcj3ygsfPN7IOj9YrmtC8gG66cCXeJKcO
 OEyA3xhjyVCxuT7z4iGO0k=
X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
 SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>


Am 26.04.2021 um 01:14 schrieb Lemures Lemniscati via Cygwin:
> On Sun, 25 Apr 2021 22:33:57 +0200, Thomas Wolff
>> Am 25.04.2021 um 15:41 schrieb Lemures Lemniscati via Cygwin:
>>> Hi!
>>>
>>> mintty overstrokes some fonts unexpectedly.
>>> https://gitlab.com/test.cases/mintty-test/-/tree/54ae800e695ecd1741851cab57320a9d0e95a6fd
>>>
>>> I got a result mintty-sample-msgothic.png.
>>> https://gitlab.com/test.cases/mintty-test/-/blob/54ae800e695ecd1741851cab57320a9d0e95a6fd/mintty-sample-msgothic.png
>>>
>>> In the 4th line of the output, fonts (of u+25cb) were overstruck
>>> unexpectedly.
>>> And there are other characters also, which are similarly overstruck.
>> This is a Windows bug. Mintty clearly instruct Windows to apply equidistant spacing to achieve fixed-width character cell behaviour. But for certain character ranges, Windows ignores that. Another example for such misbehaviour is the Tibetan block (U+0F00-U+0FFF). Mintty could work around that by rendering characters separately, at a significant penalty for output speed however. Or it could do that only for affected ranges, but criteria to identify them are obscure.
> Thank you, Thomas.
>
> I tried some earlier versions of mintty:
>
> * mintty-3.1.0-1 has the same issue
> * mintty-2.9.6-0 works expectedly in this case.
My previous comment was wrong, sorry. The cause of the issue is that the 
Windows CJK fonts are designed for CJK ambiguous-wide layout. If you run 
mintty with option Charwidth=ambig-wide, or better in an ambiguous-wide 
locale like LC_CTYPE=C.utf8@cjkwide, width handling and font rendering 
will match.
Mintty applies auto-narrowing to some characters that would render far 
out of their character cell, squeezing them into the cell, in order to 
optimise the trade-off between readability and authentic rendering.
Some character ranges were taken out of that mechanism in 2.9.7, 
including the Geometric Shapes which you've encountered, in this case 
because they are "geometric" and the assumption was that they should not 
be tampered for rendering.

Thomas

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
