From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31118 invoked by alias); 4 Sep 2018 09:00:38 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 29644 invoked by uid 89); 4 Sep 2018 09:00:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-101.2 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=willingness, Whatever, courier X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Sep 2018 09:00:04 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MKPas-1fvTIV19C2-001fBz for ; Tue, 04 Sep 2018 11:00:01 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 4E7CEA820B3; Tue, 4 Sep 2018 11:00:00 +0200 (CEST) Date: Tue, 04 Sep 2018 09:00:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cygwin fails to utilize Unicode replacement character Message-ID: <20180904090000.GD6350@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20180903210258.GC6350@calimero.vinschen.de> <5b8db27e.1c69fb81.e3b47.6cd8@mx.google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sxUMTo9WXJrtNoGr" Content-Disposition: inline In-Reply-To: <5b8db27e.1c69fb81.e3b47.6cd8@mx.google.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-09/txt/msg00062.txt.bz2 --sxUMTo9WXJrtNoGr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2638 On Sep 3 15:15, Steven Penny wrote: > On Mon, 3 Sep 2018 23:02:58, Corinna Vinschen wrote: > > I can't. I only have a limited set of fonts available in the console. >=20 > http://superuser.com/questions/390933/add-font-cmd-window-choices/956818 >=20 > > What I just did was calling the GetFontUnicodeRanges function > > for each font, and it turns out that none of the fonts support > > 0xfffd "REPLACEMENT CHARACTER", but all three support 0xfffc > > "OBJECT REPLACEMENT CHARACTER". I expanded the testcase to check > > for this with GetGlyphIndicesW and, lo and behold, the result > > makes sense. >=20 > Here is my code if it helps: >=20 > #include > #include > int main() > { > CONSOLE_FONT_INFOEX ta; > ta.cbSize =3D sizeof ta; > GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), 0, &ta); > HDC wh =3D GetDC(0); > SelectObject(wh, > CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ta.FaceName)); > WCHAR xr =3D 0xFFFD; > WORD zu[1]; > GetGlyphIndicesW(wh, &xr, 1, zu, 1); > printf("%ls: %s\n", ta.FaceName, *zu =3D=3D 0xFFFF ? "FAILURE" : "SU= CCESS"); > } In how far does that add information to the code I posted in https://cygwin.com/ml/cygwin/2018-09/msg00056.html ? > Result: >=20 > DejaVu Sans Mono: SUCCESS Whereever you get DejaVu Sans Mono from. My W10 console only allows to specify a handful of fonts, Consolas, Courier New, Lucida, MS Gothic, NSimSun, Raster Fonts, SimSun-ExtB. > Consolas: FAILURE >=20 > > On the other hand, during testing I saw a 0xfffd character printed for > > these fonts. None of them actually supports 0xfffd, so apparently the > > Windows console already uses replacement fonts if possible. > >=20 > > I guess I just stop here and always print 0xfffd. I seriously doubt > > it makes sense to add so much code just to print a single char in a > > border case. >=20 > this is not possible; most likely you were seeing the ".notdef glyph": >=20 > http://docs.microsoft.com/typography/opentype/spec/recom Yeah, that's it then. Whatever. The fact that none of the default fonts available for the console provide 0xfffd REPLACEMENT CHARACTER doesn't really contribute to my willingness to add lots of code for a border case. We either keep 0xfffd now and the user gets the nodef glyph, or I revert the patch and let the console print 0x2592 MEDIUM SHADE again. Decision has to be made today. I will release 2.11.1 tomorrow. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --sxUMTo9WXJrtNoGr Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAluOSZAACgkQ9TYGna5E T6DN3g/+Kse/y18hmATHIMTfK8yawFLGcD7xyuVuZ/eGAmfokwpvcttsgr6XTDE9 brGNBFGR/X5eTuW1xn7ozPYltXihQFJltsr2RcVG0osO+j4LiClpAD0sg1wjZ+lv rvnR48qUaDK10E+cw+tFjqMECTBeflUoLLnrUzBU6bSeGI1LR5fbTtnhHE5V2AAs PKDL3zcwwajQZvQKdYOySrkvh/jcSqGJ/ApCivvJgf6m306gIadvE50IH/uZG5Fp Pl4wiq89JxlLE7MEDg7bfd7aieluams0RZNxGRyYOki9lvnkVAIM6QZJoom2qPp+ OmA/67Qz5obHt6xHQKamxPBZZTv9nQ1zyKUr7dNkXqrkcVkEW+Ngrt4MvppUWtzx kpXGiltbpQ/4+P7R/pmrHbMaQCadhCaXlHm2wEJgzAmD38kVkRYq56HeksZkrlO+ J7p3Um2KdkbBfMp0x7u6jUUDTpXmBhuBpohSiu2n+wpIIgLUCkvBLrOOwHbR6qyv +ME/Zj5nF2cPFzu85UQKT+ZdvTot1Yge257WFaeLYRJddHXQTL89CDMrmQdtw0Gn tUpFwyZU+uHSpX4qo9vPNW5r3+MffmgZFt/UZIsKNJFXMnvs4I0q0fHJ3brs/HlL 1cneuoqmG2/LRzkZIqwe7+aSRwdzmoWQBcJWShIXOz5X0LLbjo0= =Huu3 -----END PGP SIGNATURE----- --sxUMTo9WXJrtNoGr--