Discussion:
[PATCH] gnu: emacs: Use libotf.
Roel Janssen
2016-03-10 21:30:04 UTC
Permalink
Dear Guix,

The reason I packaged libotf a while ago was to use it in Emacs, in the
hope that I would be able to get better font rendering for otf fonts.

Here's a very small patch to compile Emacs with libotf support.
Unfortunately for me, it hasn't given me better font rendering.
Nevertheless, I hope it will be useful to someone.

Kind regards,
Roel Janssen
Ludovic Courtès
2016-03-11 16:27:15 UTC
Permalink
Post by Roel Janssen
Here's a very small patch to compile Emacs with libotf support.
Unfortunately for me, it hasn't given me better font rendering.
Does the resulting Emacs refer to libotf, as per:

guix gc --references $(./pre-inst-env guix build emacs) | grep libotf

?

If it does, could you check how it’s supposed to use it? I don’t see
how it would be used, but I guess this has nothing to do with rendering.

How “wrong” is font rendering for you?

Ludo’.
Roel Janssen
2016-03-14 12:22:09 UTC
Permalink
Post by Ludovic Courtès
Post by Roel Janssen
Here's a very small patch to compile Emacs with libotf support.
Unfortunately for me, it hasn't given me better font rendering.
guix gc --references $(./pre-inst-env guix build emacs) | grep libotf
?
Yes, here's the output:
[***@roel-tp guix]$ guix gc --references $(./pre-inst-env guix build emacs) | grep libotf
/gnu/store/kzc2zkdl3aadrs3iiml7vva80fgsd2b9-libotf-0.9.13

You can also see "Does Emacs use libotf?" turn to "yes" with my patch in
the overview at the end of the configure phase.
Post by Ludovic Courtès
If it does, could you check how it’s supposed to use it? I don’t see
how it would be used, but I guess this has nothing to do with rendering.
It seems that Emacs can use it for complex font rendering of OTF fonts:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Font.html

(search for "libotf").
Post by Ludovic Courtès
How “wrong” is font rendering for you?
I attached two screenshots, emacs-from-guix.png and
emacs-from-fedora.png. Both are compiled with libotf support. Besides
the missing Fira font, the text on the Emacs from Guix looks stretched
and not properly anti-aliased to me.

Kind regards,
Roel Janssen
Alex Kost
2016-03-14 20:20:34 UTC
Permalink
Post by Roel Janssen
I attached two screenshots, emacs-from-guix.png and
emacs-from-fedora.png. Both are compiled with libotf support. Besides
the missing Fira font, the text on the Emacs from Guix looks stretched
and not properly anti-aliased to me.
For me, Emacs displays font properly (something similar to your
"emacs-from-fedora.png") even without libotf support. Did you install
any ttf fonts in your user profile (like "font-dejavu" or
"font-liberation")? After installing the fonts you can run "fc-cache
-fv", though it is probably not needed.

I use the following in my emacs config to set up the default font:

(set-frame-font "Liberation Mono-12" nil t)
--
Alex
Ludovic Courtès
2016-03-15 16:08:30 UTC
Permalink
Post by Alex Kost
Post by Roel Janssen
I attached two screenshots, emacs-from-guix.png and
emacs-from-fedora.png. Both are compiled with libotf support. Besides
the missing Fira font, the text on the Emacs from Guix looks stretched
and not properly anti-aliased to me.
For me, Emacs displays font properly (something similar to your
"emacs-from-fedora.png") even without libotf support. Did you install
any ttf fonts in your user profile (like "font-dejavu" or
"font-liberation")? After installing the fonts you can run "fc-cache
-fv", though it is probably not needed.
(set-frame-font "Liberation Mono-12" nil t)
I have:

(set-frame-font "DejaVu Sans Mono-12" nil)

and it seems to display correctly too.

Ludo’.

Ludovic Courtès
2016-03-15 16:01:30 UTC
Permalink
Post by Roel Janssen
Post by Ludovic Courtès
Post by Roel Janssen
Here's a very small patch to compile Emacs with libotf support.
Unfortunately for me, it hasn't given me better font rendering.
guix gc --references $(./pre-inst-env guix build emacs) | grep libotf
?
/gnu/store/kzc2zkdl3aadrs3iiml7vva80fgsd2b9-libotf-0.9.13
You can also see "Does Emacs use libotf?" turn to "yes" with my patch in
the overview at the end of the configure phase.
Post by Ludovic Courtès
If it does, could you check how it’s supposed to use it? I don’t see
how it would be used, but I guess this has nothing to do with rendering.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Font.html
(search for "libotf").
Oh, interesting, glad to be proved wrong! ;-)

Well that seems like a useful addition, so feel free to add it to
‘emacs’ (and to make sure it is removed from ‘emacs-no-x’.)
Post by Roel Janssen
Post by Ludovic Courtès
How “wrong” is font rendering for you?
I attached two screenshots, emacs-from-guix.png and
emacs-from-fedora.png. Both are compiled with libotf support. Besides
the missing Fira font, the text on the Emacs from Guix looks stretched
and not properly anti-aliased to me.
Right, but it’s a different font. You’re probably right that something
is wrong, but it’s hard to tell with a different font.

Thanks!

Ludo’.
Loading...