emacs-devel
[Top][All Lists]
Advanced

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

Re: High-res Customize icons


From: Werner LEMBERG
Subject: Re: High-res Customize icons
Date: Thu, 23 Apr 2020 19:49:51 +0200 (CEST)

>> Why not creating a specialized outline font family with the needed
>> glyphs?  Emacs could then always use it (and be distributed with
>> these fonts).
>> 
>> It should be straightforward to take a free font family, strip all
>> other glyphs, and modify the remaining symbols to make them fit.
> 
> Unlike some other programs, Emacs doesn't use fonts directly, it does
> so via system APIs that manage fonts.

Yes.

> So installing an additional font (or a set of them, actually --
> won't we also need bold, italic, etc. variants?) affects the entire
> system and affects Emacs itself, by adding a font that isn't really
> meant to be used for displaying readable text in any script.  It's a
> trick that we would use to work around the need to display an image.
> I'm asking whether this is such a good idea?  Won't this font get in
> the way?

I think it is a good idea.  Today, OpenType fonts are standard on all
major platforms; it wouldn't be necessary to support any other, more
exotic or ancient font type.  Almost all of the needed symbols are
already available as Unicode characters, which means that such an
auxiliary font could be even used by other applications – another
advantage would be that Emacs in terminal mode could use *exactly* the
same character codes (without styling, of course) to display those
symbols.

To conform to the standard, glyphs that are not in Unicode would be
put into the PUA (Private User Area), again ensuring that there are no
conflicts with other applications.

> What other applications are known to come with their own fonts and
> install them into the global font space of the system?  Is this
> considered a good practice?

Well, on MacOS and GNU/Linux, it wouldn't be necessary to install the
font globally; instead, the Emacs binary can programmatically add a
local directory to the list of font directories scanned by
fontconfig.  I guess something similar is also available under Windows;
at least it should be doable under Windows 7 and newer, AFAICS:

  
https://docs.microsoft.com/en-us/windows/win32/directwrite/custom-font-sets-win10

Looking around it seems even possible with GDI (then needing a
TrueType font):

  
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontresourcea

However, this is just speculation on my side.

Supporting GDI, however, would have one limitation: No colored glyphs.


    Werner

reply via email to

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