bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22609: 24.5; Different Font display for windows32 implementation


From: Matthew Fidler
Subject: bug#22609: 24.5; Different Font display for windows32 implementation
Date: Thu, 11 Feb 2016 14:27:12 +0000

I thought that I declared what font to use by declaring the 'font property, so it would not be ambiguous to emacs what font to display the glyph with.

As a test, I decided to try webdings as a font.  As you said, emacs doesn't allow display of the "a" character in both webdings (a checkbox) and whatever font I'm using.  

I guess that cygwin may have done the display by luck.

Matt

On Wed, Feb 10, 2016 at 11:44 AM Eli Zaretskii <address@hidden> wrote:
> From: Matthew Fidler <address@hidden>
> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]