unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Matthew Fidler <matthew.fidler@gmail.com>
Cc: 22609@debbugs.gnu.org
Subject: bug#22609: 24.5; Different Font display for windows32 implementation
Date: Wed, 10 Feb 2016 19:43:37 +0200	[thread overview]
Message-ID: <838u2sbgvq.fsf@gnu.org> (raw)
In-Reply-To: <CAOmN8O4pOYpuzs9L5X1_XTqwQpmDBthEvLFALepjGap_8XnAmg@mail.gmail.com> (message from Matthew Fidler on Tue, 09 Feb 2016 20:29:52 +0000)

> From: Matthew Fidler <matthew.fidler@gmail.com>
> Date: Tue, 09 Feb 2016 20:29:52 +0000
> 
> Download github-octicons (https://octicons.github.com/)
> 
> Evaluate the following
> 
> (defvar mode-icons-octicons-font
>   (find-font (font-spec :name "github-octicons")))
> 
> (setq test (propertize "test" 'display (make-string 1 #xf0c9) 'font 'mode-icons-octicons-font))
> 
> (setq header-line-format test
>  mode-name test)
> (force-mode-line-update)
>
> The header-line and footer-line should have a markdown-symbol in it.  On Cygwin and linux, these show the markdown symbol.  On windows 32 emacs, it shows a missing glyph.

This font uses codepoints in the Private Use Area (PUA) block of
Unicode, but it doesn't declare coverage of that block (or any block,
really) in its headers.  Emacs on Windows requires that a font
declares support for a block before it will consider it for displaying
characters in that block.  It also doesn't like fonts that don't
support any Unicode block at all, which is what this font does.

If the font declared coverage of PUA, it could have made sense to try
introducing the notion of PUA pseudo-script into Emacs (something we
don't have today), and then use such a font for characters in PUA
blocks.  But since the font doesn't declare any coverage, doing that
won't help.

> You're right it's a private code base.   I'm assuming if I run that code, it remaps everywhere.   If would like to use github fonts and font awesome fonts and they share the same character then I would have to choose one glyph. Is that correct?  

Yes, that's correct.  Fonts that use PUA blocks are problematic
because when they use the same codepoint for different glyphs, Emacs
will select one of them at random, unless you tell it which one to
select by customizing your fontset.  And that only works well if you
don't need both glyphs in some situation.

So I think that, in general, when you want to use such a font, you
must do what Andy suggested, because Emacs is clueless: these
codepoints don't tell to which character set or script they belong,
they don't tell anything about their properties, etc.  Emacs needs
help.  You can make that setting part of your mode, and it will work
on all systems.

> However, on Linux/Cygwin such mapping is not necessary.  All that is necessary is to declare the font.

I think that's sheer luck, and will likely stop working once you have
more than one font that covers the same codepoints.

Btw, I don't really understand why you need this in Emacs.  I'm
guessing that you do it because you actually want to display some icon
on the mode line.  But Emacs can display images on the mode line
without any PUA fonts: just create image files out of those glyphs,
and use them directly.  Emacs doesn't need such "poor man's images".
That should fix your problems, I think.

Thanks.





  parent reply	other threads:[~2016-02-10 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 20:29 bug#22609: 24.5; Different Font display for windows32 implementation Matthew Fidler
2016-02-10  0:00 ` Andy Moreton
2016-02-10 17:47   ` Eli Zaretskii
2016-02-10  3:32 ` bug#22609: Code points Matthew Fidler
2016-02-10 17:43 ` Eli Zaretskii [this message]
2016-02-11 14:27   ` bug#22609: 24.5; Different Font display for windows32 implementation Matthew Fidler
2016-02-11 20:54     ` Eli Zaretskii
2019-11-17  6:49   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838u2sbgvq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22609@debbugs.gnu.org \
    --cc=matthew.fidler@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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