Mail Archives: cygwin/2018/09/04/05:01:02
--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 -