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

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

Re: Emacs 28: bitmap fonts, vector font character spacing


From: Hongyi Zhao
Subject: Re: Emacs 28: bitmap fonts, vector font character spacing
Date: Mon, 24 Jul 2023 22:41:02 +0800

On Mon, Jul 24, 2023 at 9:57 PM PierGianLuca <luca@magnaspesmeretrix.org> wrote:
>
> I've happily used the DejaVu Sans Mono for many years, with
>
> (set-face-attribute 'default nil :font "DejaVu Sans Mono")
> (set-face-attribute 'default nil :height 94)
>
> on my hi-dpi laptop and on non-hidpi laptops. It works seamlessly. Maybe 
> Terminus is not monospaced though. I suppose the other proportional DejaVu 
> fonts would work as well
>
> https://dejavu-fonts.github.io/

An alternative is the following one:

https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/DejaVuSansMono

See the related fonts installed on my OS:

werner@X10DAi:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:    jammy
werner@X10DAi:~$ fc-list -b |grep -i 'family:.*dejavu'
    family: "DejaVu Sans"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVuSansMono Nerd Font Mono"(s)
    family: "DejaVu Sans"(s) "DejaVu Sans Condensed"(s)
    family: "DejaVu Serif Condensed"(s)
    family: "DejaVuSansMono NF"(s)
    family: "DejaVuSansMono Nerd Font"(s)
    family: "DejaVu Sans"(s) "DejaVu Sans Condensed"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVuSansMono NF"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVuSansMono Nerd Font"(s)
    family: "DejaVuSansMono Nerd Font Mono"(s)
    family: "DejaVuSansMono NF"(s)
    family: "DejaVu Serif Condensed"(s)
    family: "DejaVuSansMono Nerd Font Mono"(s)
    family: "DejaVu Sans Condensed"(s)
    family: "DejaVu Serif Condensed"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans"(s) "DejaVu Sans Condensed"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Sans Condensed"(s)
    family: "DejaVu Serif"(s) "DejaVu Serif Condensed"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Serif"(s) "DejaVu Serif Condensed"(s)
    family: "DejaVuSansMono NF"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Sans"(s) "DejaVu Sans Condensed"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Serif Condensed"(s)
    family: "DejaVu Sans Condensed"(s)
    family: "DejaVu Math TeX Gyre"(s)
    family: "DejaVu Sans"(s)
    family: "TeX Gyre DejaVu Math"(s)
    family: "DejaVu Sans"(s)
    family: "DejaVu Serif"(s) "DejaVu Serif Condensed"(s)
    family: "DejaVu Sans Light"(s)
    family: "DejaVu Sans Condensed"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVuSansMono Nerd Font Mono"(s)
    family: "DejaVu Sans"(s) "DejaVu Sans Light"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVuSansMono Nerd Font"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Serif"(s) "DejaVu Serif Condensed"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Sans Mono"(s)
    family: "DejaVu Serif"(s)
    family: "DejaVuSansMono Nerd Font"(s)


And below is my init.el settings:

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "DejaVuSansMono Nerd Font Mono" :foundry
"PfEd" :slant normal :weight normal :height 160 :width normal)))))

> Cheers,
> Luca

Best,
Zhao

>
> On 230724 15:15, Christoph Groth wrote:
> > Hello,
> >
> > I’m having some trouble trying to set up a pleasant font after upgrading
> > to Emacs 28.  Would someone be so kind to help?
> >
> > For many years I was happily using the “Terminus” bitmap font in Emacs
> > and terminal windows on “regular density” displays.  On “HiDPI” displays
> > I switched to vector fonts, but for low density displays I preferred the
> > crisp Terminus.
> >
> > I recently upgraded Emacs from 27.1 to 28.2 as part of upgrading to the
> > new Debian stable and this broke my font setup.  I have something like
> > the following in my emacs config.
> >
> > (add-to-list 'default-frame-alist '(font . "Terminus-12"))
> >
> > With Emacs 28.2 the default font is now much too small (I’m not even
> > sure whether it’s still Terminus).  It is possible to choose Terminus
> > with M-x menu-set-font, but this shows the same tiny font independently
> > of the chosen size.
> >
> > I noticed the following entry in NEWS:
> >
> >> ** The Cairo graphics library is now used by default if present.
> >> '--with-cairo' is now the default, if the appropriate development
> >> files are found by 'configure'.  Building with Cairo is known to cause
> >> some problems with bitmap fonts.  This may require you to adjust your
> >> font settings, or to build with Xft support instead.
> >
> > Unfortunately, this is not very specific.  Do “some problems” mean that
> > fonts like Terminus no longer work and that I have to recompile Emacs if
> > I want to use them, or is there some workaround?  I tried to find one,
> > but so far without success.
> >
> > ----------------------------------------------------------------
> >
> > So, OK, I thought I’d go with the time and switch to a vector font on
> > low-density displays as well.  I like how Fira Code Light looks in
> > xfce4-terminal.
> >
> > I managed to set it to the size I like through
> >
> > (add-to-list
> >   'default-frame-alist
> >   '(font . "-CTDB-Fira Code-light-normal-normal-*-14-*-*-*-m-0-iso10646-1"))
> >
> > (Interestingly, I am not able to obtain this size by simply using “Fira
> > Code-N”.  The font is either too small or too large!)
> >
> > Anyway, while with the above the vertical line spacing matches the one in
> > xfce4-terminal, the horizontal inter-character distance is somewhat
> > wider.  Is there a way to render the font like in xfce4-terminal?
> >
> > (I believe that this issue could be related to kerning being handled
> > differently by Emacs/Cairo, but I did not manage to find any information
> > on how to adjust it.)
> >
> > For reference:
> >
> > ----------------------------------------------------------------
> > (frame-parameter nil 'font-backend)
> > (ftcrhb x)
> > system-configuration-features
> > "ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG 
> > JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES 
> > NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF 
> > TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB"
> > ----------------------------------------------------------------
> >
> > My ~/.Xresources contains
> >
> > ----------------------------------------------------------------
> > Xft.antialias: 0
> > Xft.hinting: 0
> > Xft.hintstyle: hintfull
> > Xft.lcdfilter: lcddefault
> > Xft.rgba: rgb
> > ----------------------------------------------------------------
> >
> > Cheers
> > Christoph



reply via email to

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