From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Fidler Newsgroups: gmane.emacs.bugs Subject: bug#22609: 24.5; Different Font display for windows32 implementation Date: Thu, 11 Feb 2016 14:27:12 +0000 Message-ID: References: <838u2sbgvq.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b163515406c67052b7f59c4 X-Trace: ger.gmane.org 1455200902 31223 80.91.229.3 (11 Feb 2016 14:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Feb 2016 14:28:22 +0000 (UTC) Cc: 22609@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 11 15:28:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aTsE7-00056v-9U for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Feb 2016 15:28:11 +0100 Original-Received: from localhost ([::1]:50531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTsE6-0004k0-LH for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Feb 2016 09:28:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTsE1-0004je-Nr for bug-gnu-emacs@gnu.org; Thu, 11 Feb 2016 09:28:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTsDy-00009v-Bo for bug-gnu-emacs@gnu.org; Thu, 11 Feb 2016 09:28:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTsDy-00009n-82 for bug-gnu-emacs@gnu.org; Thu, 11 Feb 2016 09:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aTsDy-00086X-1q for bug-gnu-emacs@gnu.org; Thu, 11 Feb 2016 09:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Fidler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Feb 2016 14:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22609-submit@debbugs.gnu.org id=B22609.145520085031111 (code B ref 22609); Thu, 11 Feb 2016 14:28:01 +0000 Original-Received: (at 22609) by debbugs.gnu.org; 11 Feb 2016 14:27:30 +0000 Original-Received: from localhost ([127.0.0.1]:35783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTsDS-00085g-0o for submit@debbugs.gnu.org; Thu, 11 Feb 2016 09:27:30 -0500 Original-Received: from mail-ob0-f181.google.com ([209.85.214.181]:36211) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTsDP-00085S-Ci for 22609@debbugs.gnu.org; Thu, 11 Feb 2016 09:27:27 -0500 Original-Received: by mail-ob0-f181.google.com with SMTP id ba1so74924080obb.3 for <22609@debbugs.gnu.org>; Thu, 11 Feb 2016 06:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=hpFW59QvgDUnal5yh9K28nIK5sFKi3lnhH7YrgrYsBA=; b=SY1JPNzIyaRAoLYEYnFK2MRmhF+Znljs0orX94M7InrA2EXPDeahnlh0YghqfetxM3 75C4Hc40OKfSWXBxQnkuMKhhTOebzwp5T5sTS2HAHUqB8hRTv6a6U3749ILPYLEzNe1F jqKgSAslxnvKzA/KgzJ1dc09/5r7NXbQCdPouVb/gH+xZrrUQIXZbsTOGxMz9CQSoXnU xhR+b25qq5ThwCarKDyqIP83FqSsoo13mkA2Uv9561mIC8NqVfZOIL1b3v3g53zuw+u6 EdoJI+40jU4xRBdjKMJxmLDP1D43IrYL7JG6VwOwSTpEhEjS1Cny+22xAOrTmH4irxmV p69Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=hpFW59QvgDUnal5yh9K28nIK5sFKi3lnhH7YrgrYsBA=; b=ayzIlVAUSJ6vFKZVhr0KzCTFDGcYo8og+VdQQEFjyAC8G//6POtZ5L0UZ0Ahufz7pN OzXYLDtZXYd9IWGl9v6rkIN5vDSqQfEy5aD7U3O9FB2heO5rSIivMldzR40ufcWhGYof 8kdNO3SPyDrf7xBS/T/r/5YG8tHTmzZTAJPFPqDqGN0bpuvsgJnJq/HYmH8u3VkXTBS5 e37frXCZWSyYzl1sJQeEXswQG0b11BAmnK5bctJjv5tzCKkqjn0W/3RXEV9mKo1fPtK+ 1YJC56ZWWAQ97Iz4MUiCWMstmKQn/lri6x+4cdrE9Ij7LtVf1sgG6RAfuMTtjSvFdBYp KEAQ== X-Gm-Message-State: AG10YOTdUDw1lATubQRMfViOOR10HNgmTfhaGKkP6YC8XxlE/8arVxaiujFsWYgAtuMa6ySwu1yaPfHqOCNAOg== X-Received: by 10.60.142.170 with SMTP id rx10mr44687062oeb.37.1455200841786; Thu, 11 Feb 2016 06:27:21 -0800 (PST) In-Reply-To: <838u2sbgvq.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112887 Archived-At: --047d7b163515406c67052b7f59c4 Content-Type: text/plain; charset=UTF-8 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 wrote: > > From: Matthew Fidler > > 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. > --047d7b163515406c67052b7f59c4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I thought that I declared what font to use by declaring th= e 'font property, so it would not be ambiguous to emacs what font to di= splay the glyph with.

As a test, I decided to try webdin= gs as a font.=C2=A0 As you said, emacs doesn't allow display of the &qu= ot;a" character in both webdings (a checkbox) and whatever font I'= m using. =C2=A0

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

Matt

On Wed, Feb 10, 2016 at 11:44 = AM Eli Zaretskii <eliz= @gnu.org> wrote:
> 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
>=C2=A0 =C2=A0(find-font (font-spec :name "github-octicons")))=
>
> (setq test (propertize "test" 'display (make-string 1 #x= f0c9) 'font 'mode-icons-octicons-font))
>
> (setq header-line-format test
>=C2=A0 mode-name test)
> (force-mode-line-update)
>
> The header-line and footer-line should have a markdown-symbol in it.= =C2=A0 On Cygwin and linux, these show the markdown symbol.=C2=A0 On window= s 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.=C2=A0 Emacs on Windows requires that a font
declares support for a block before it will consider it for displaying
characters in that block.=C2=A0 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.=C2=A0 But since the font doesn't declare any coverage, doing th= at
won't help.

> You're right it's a private code base.=C2=A0 =C2=A0I'm ass= uming if I run that code, it remaps everywhere.=C2=A0 =C2=A0If would like t= o 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.=C2=A0 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.=C2=A0 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.=C2=A0 Emacs needs=
help.=C2=A0 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.=C2=A0 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.=C2=A0 I'= m
guessing that you do it because you actually want to display some icon
on the mode line.=C2=A0 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.=C2=A0 Emacs doesn't need such "poor man'= ;s images".
That should fix your problems, I think.

Thanks.
--047d7b163515406c67052b7f59c4--