delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/09/04/05:01:02

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=gsYZsUvqGZ0A1GXekC2FZcbsl/ZTGElH77P5RAlebmM9G8nNOLbJ9
NsZbpBvB3tHupHPG/VIfP0qhyRyLaH6EwbUz7fXC4WjiPvX/S+yRzWbezC5Y77tv
cBEO92a/3lYPVLTJI4VhfBUM5+/CWSyFwd/kvxbvZj1bH2Q1Wn+yH8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=u9NtUOtgF9nNpVQPSU22DeyeffA=; b=t2BhyzXrv9/+Nq2uzdOTxaNXHSIi
Pa8PLM5WL1y6YRDat7icnBez94yGDBliY2eXeM9e2tCJhxHTm8yhJuiLfgB0RH5X
S+Y/QQOdO6U21FMTgoDf/xkr0KZi8RrebNanCldxkA2XG4GbxNgNZN1LTtYHyVOR
BQJmVDhRlXb7EUg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Tue, 4 Sep 2018 11:00:00 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin fails to utilize Unicode replacement character
Message-ID: <20180904090000.GD6350@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20180903210258 DOT GC6350 AT calimero DOT vinschen DOT de> <5b8db27e DOT 1c69fb81 DOT e3b47 DOT 6cd8 AT mx DOT google DOT com>
MIME-Version: 1.0
In-Reply-To: <5b8db27e.1c69fb81.e3b47.6cd8@mx.google.com>
User-Agent: Mutt/1.9.2 (2017-12-15)

--sxUMTo9WXJrtNoGr
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 <stdio.h>
>    #include <windows.h>
>    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"

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019