From: Rodrigo Morales <me@rodrigomorales.site>
To: Eli Zaretskii <eliz@gnu.org>, <help-gnu-emacs@gnu.org>
Subject: Re: Error when using Unifont and trying to launch M-x term
Date: Thu, 16 May 2024 14:43:00 -0500 [thread overview]
Message-ID: <87zfspzgor.fsf@rodrigomorales.site> (raw)
In-Reply-To: <86eda2jl21.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
> Maybe because you are setting up your fonts and fontsets incorrectly?
> For example, you cannot affect the default font, the one used for the
> ASCII characters, via set-fontset-font, at least not in the naïve way
> you are doing that. Instead, you should do it the "traditional" way,
> by adding this:
>
> (add-to-list 'default-frame-alist '(font . "Unifont"))
>
> to your init file, and then tell Emacs (again in the init file) that
> Unifont should be used for the entire Unicode space of non-ASCII
> characters:
>
> (set-fontset-font t 'unicode "Unifont" nil 'prepend)
>
> In addition, you may need to customize face-font-family-alternatives,
> and specifically the alternatives for "Sans Serif" (not sure about
> this, but that's where the "-Sans-Serif" suffix above might be coming
> from), if the above two measures are still not enough.
>
> Please try the above, and if it also produces an error, report a bug
> using "M-x report-emacs-bug RET", with all the details.
Thanks. I wasn't aware of those methods for setting the default
font. The same error is still being thrown. I have reported a bug:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-05/msg00953.html
> P.S. Let me just note, and I will only do this once, that doing all of
> that just to have all the lines in "M-x term" be the same height in
> 110% of cases is IMNSHO too much effort for a little gain. Your time
> and energy will be spent much better by looking at fonts for
> characters that make the line height higher, then finding alternative
> fonts for those characters which don't have that effect, and
> configuring your fontset to use those better fonts for those
> problematic characters. As a nice bonus, this will leave you with
> much nicer fonts than Unifont can ever be.
Thanks for the suggestion. I am afraid I didn't make my use case clear:
I value more efficiency over aesthetics so I don't care whether a bitmap
font looks ugly or not. I work with different scripts from different
languages in Emacs, some of these scripts contain characters with
minimal details. For example, consider the following pairs of
characters: 璧壁, 镱镜 and 畲畬. In order to easily different those
characters, I display them with a big size using a OpenType font. A big
font size for ASCII characters is not required, because ASCII characters
can be easily differentiated, so I use an extremely small bitmap font
for ASCII characters, a benefit of doing this is that the most number of
lines fit on my screen and I can read the most information without
scrolling. A combination of big OpenType fonts and extremely small
bitmap fonts doesn't mix well inside *terminal* because it seems that
*terminal* assumes that all lines have the same height, so some
information in the *terminal* window is displayed out of the limits of
the window. Now, most of my work inside *terminal* involves displaying
ASCII characters so I want to make *terminal* use the extremely small
bitmap font, non-ASCII characters are hardly shown but if they are shown
I want the entire content of *terminal* still fit the window. Here's
another use case: when I am learning new things or I feel tired, I
change the extremely small bitmap font in *terminal* to an OpenType
font, whether a bitmap font or a OpenType font I want the entire
contents of *terminal* to fit the window.
So, the question I really want to solve is: Given one and only one
arbitrary font with an arbitrary size, how can I always ensure that the
information displayed in *terminal* fits the window in its entirety?
Some terminal emulators such as gnome-terminal and kitty are able to fit
the entire content regardless of the characters that are being shown (I
haven't done exhaustive testing on this, but I tried some scenarios). I
think they are able to do that by assigning the same height to all lines
and trying to fit all characters for that height.
prev parent reply other threads:[~2024-05-16 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 19:46 Error when using Unifont and trying to launch M-x term Rodrigo Morales
2024-05-16 7:03 ` Eli Zaretskii
2024-05-16 19:43 ` Rodrigo Morales [this message]
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=87zfspzgor.fsf@rodrigomorales.site \
--to=me@rodrigomorales.site \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/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.
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).