From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Cygwin fails to utilize Unicode replacement character
Date: Tue, 04 Sep 2018 06:06:00 -0000 [thread overview]
Message-ID: <5251efa5-e7a0-883b-f9e9-f76606e9ee52@SystematicSw.ab.ca> (raw)
In-Reply-To: <5b8db27e.1c69fb81.e3b47.6cd8@mx.google.com>
On 2018-09-03 16: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.
Install dejavu-fonts package or just DejaVu Sans Mono font from:
https://dejavu-fonts.github.io/Download.html
http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.tar.bz2
or see what glyph is at index 0 (.notdef)?
> http://superuser.com/questions/390933/add-font-cmd-window-choices/956818
For Windows support, from Explorer I just search all *.[ot]tf under
...CygRoot.../usr/share/fonts/ and copy into /Windows/Fonts/
>> 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.
>> 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.
>> 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.
> this is not possible; most likely you were seeing the ".notdef glyph":
> http://docs.microsoft.com/typography/opentype/spec/recom
> for Consolas which is simlar in appearance to U+FFFD REPLACEMENT CHARACTER. The
> differnce is that if you copy the ".notdef glyph" and paste it into "Notepad" or
> similar, it will paste the proper character that couldnt be seen in the console,
> while pasting U+FFFD into "Notepad" will just paste itself.
> Expanding on the "Notepad" example, "Notepad" default font is "Lucida Console",
> which doesnt have U+FFFD either. However pasting into "Notepad" will still show
> U+FFFD properly because "Tahoma" has U+FFFD and "Notepad" can utilize composite
> font, while it appears "cmd.exe" and similar cannot.
You can use Windows font linking to use glyphs from linked fonts like:
. GNU Unifont showing bitmap glyphs for BMP code points - release 8.0.1 is
available in Cygwin package unifont-fonts - latest below is 11.0.2
https://savannah.gnu.org/projects/unifont
http://unifoundry.com/unifont/index.html
. Evertype Last Resort font provided by Apple showing standard representative
Unicode block glyphs with the code point in the wide glyph border
https://www.unicode.org/policies/lastresortfont_eula.html
. SIL Fallback showing the BMP code point inside a box
https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=UnicodeBMPFallbackFont
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2018-09-04 6:06 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-01 16:13 Steven Penny
2018-09-01 18:11 ` Thomas Wolff
2018-09-01 18:46 ` Steven Penny
2018-09-01 21:07 ` Thomas Wolff
2018-09-01 19:40 ` Corinna Vinschen
2018-09-01 21:50 ` Doug Henderson
2018-09-01 22:49 ` Steven Penny
2018-09-02 8:07 ` Thomas Wolff
2018-09-02 12:51 ` Steven Penny
2018-09-03 12:46 ` Corinna Vinschen
2018-09-03 14:59 ` Corinna Vinschen
2018-09-03 16:34 ` Thomas Wolff
2018-09-03 17:17 ` Corinna Vinschen
2018-09-03 17:56 ` Thomas Wolff
2018-09-03 18:20 ` Thomas Wolff
2018-09-03 19:14 ` Corinna Vinschen
2018-09-03 20:27 ` Corinna Vinschen
2018-09-03 20:42 ` Thomas Wolff
2018-09-03 21:03 ` Corinna Vinschen
2018-09-03 22:15 ` Steven Penny
2018-09-04 6:06 ` Brian Inglis [this message]
2018-09-04 9:00 ` Corinna Vinschen
2018-09-04 11:40 ` Steven Penny
2018-09-05 7:55 ` Corinna Vinschen
2018-09-05 9:22 ` Thomas Wolff
2018-09-05 11:58 ` Steven Penny
2018-09-05 13:18 ` Marco Atzeri
2018-09-05 15:20 ` Andrey Repin
2018-09-05 15:58 ` Corinna Vinschen
2018-09-05 20:15 ` Corinna Vinschen
2018-09-06 1:35 ` Steven Penny
2018-09-06 7:01 ` Corinna Vinschen
2018-09-07 8:20 ` Corinna Vinschen
2018-09-07 10:34 ` Thomas Wolff
2018-09-07 11:29 ` Corinna Vinschen
2018-09-07 11:42 ` Thomas Wolff
2018-09-07 11:51 ` Thomas Wolff
2018-09-07 11:54 ` Corinna Vinschen
2018-09-07 16:22 ` Brian Inglis
2018-09-07 16:48 ` Brian Inglis
2018-09-07 17:01 ` Marco Atzeri
2018-09-07 18:21 ` Corinna Vinschen
2018-09-07 18:20 ` Corinna Vinschen
2018-09-05 13:35 ` Andrey Repin
2018-09-05 14:04 ` Houder
2018-09-05 15:05 ` Andrey Repin
2018-09-04 12:50 ` David Macek
2018-09-04 14:18 ` Thomas Wolff
2018-09-04 14:46 ` David Macek
2018-09-04 18:20 ` Steven Penny
2018-09-04 18:41 ` Thomas Wolff
2018-09-04 19:50 ` Andrey Repin
2018-09-04 19:53 ` Steven Penny
2018-09-04 21:43 ` Thomas Wolff
2018-09-04 23:29 ` Steven Penny
2018-09-04 20:40 ` Brian Inglis
2018-09-05 8:32 ` Corinna Vinschen
2018-09-04 13:05 ` Andrey Repin
2018-10-04 0:25 ` Steven Penny
2018-09-03 16:05 ` Brian Inglis
2018-09-04 19:59 ` Doug Henderson
2018-09-04 21:05 ` Steven Penny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5251efa5-e7a0-883b-f9e9-f76606e9ee52@SystematicSw.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).