all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* cannot load fonts
@ 2022-04-11 13:04 Luca Ferrari
  2022-04-27  9:11 ` Luca Ferrari
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Ferrari @ 2022-04-11 13:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,
I've compiled Emacs 28.1 without any particular option on Ubuntu
20.04. Then I've placed the following in my startup file:

(set-frame-font "Source Code Pro")
(set-face-attribute 'default nil :font "Source Code Pro" :height 140)
(set-face-font 'default "Source Code Pro")


However, when Emacs starts, it prints me a warning message and the
font is not loaded:

Warning (initialization): An error occurred while loading
‘/home/luca/.emacs.d/init.el’:
error: Font not available, #<font-spec nil nil Source Code Pro nil nil
nil nil nil nil nil nil nil ((:name . Source Code Pro) (:user-spec .
Source Code Pro))>

but the fonts are there:

% fc-list | grep SourceCodePro
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Regular.otf: Source
Code Pro:style=Regular
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Light.otf: Source
Code Pro,Source Code Pro Light:style=Light,Regular
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-It.otf: Source Code
Pro:style=Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-ExtraLightIt.otf:
Source Code Pro,Source Code Pro ExtraLight:style=ExtraLight
Italic,Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Medium.otf: Source
Code Pro,Source Code Pro Medium:style=Medium,Regular
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-ExtraLight.otf:
Source Code Pro,Source Code Pro ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-SemiboldIt.otf:
Source Code Pro,Source Code Pro Semibold:style=Semibold Italic,Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-MediumIt.otf:
Source Code Pro,Source Code Pro Medium:style=Medium Italic,Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-LightIt.otf: Source
Code Pro,Source Code Pro Light:style=Light Italic,Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-BlackIt.otf: Source
Code Pro,Source Code Pro Black:style=Black Italic,Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Bold.otf: Source
Code Pro:style=Bold
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-BoldIt.otf: Source
Code Pro:style=Bold Italic
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Semibold.otf:
Source Code Pro,Source Code Pro Semibold:style=Semibold,Regular
/usr/share/fonts/adobe-sourcecodepro/SourceCodePro-Black.otf: Source
Code Pro,Source Code Pro Black:style=Black,Regular


What am I missing here?

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: cannot load fonts
  2022-04-11 13:04 cannot load fonts Luca Ferrari
@ 2022-04-27  9:11 ` Luca Ferrari
  2022-04-27  9:29   ` Robert Pluim
  2022-04-27  9:34   ` Po Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Luca Ferrari @ 2022-04-27  9:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Apr 11, 2022 at 3:04 PM Luca Ferrari <fluca1978@gmail.com> wrote:
>
> Hi all,
> I've compiled Emacs 28.1 without any particular option on Ubuntu
> 20.04. Then I've placed the following in my startup file:

I found there is a much more annoying problem that I cannot fix: if I
select the menu 'Set Default Font', the font menu has only three items
with "misc", "courier" and "fontset". This prevents me to select any
decent font in the system, and I don't know how to fix it.
I've tried to load emacs with, in turn, --no-x-resources,
--no-init-file, --no-site-file but nothing changes.
I don't have any font settings in XResoucres:

% xrdb -query
*customization: -color
Xcursor.size:   36
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb

I've tied to recompile emacs with --with-x-toolkit=yes or
--with-x-toolkit=gtk3 but nothing changes.
If I install ubuntu stock emacs (26!) it works as expected and gives
me a full list of fonts.
Anybody has a clue to fix the problem with my emacs 28?

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: cannot load fonts
  2022-04-27  9:11 ` Luca Ferrari
@ 2022-04-27  9:29   ` Robert Pluim
  2022-04-27  9:34   ` Po Lu
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Pluim @ 2022-04-27  9:29 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs

>>>>> On Wed, 27 Apr 2022 11:11:22 +0200, Luca Ferrari <fluca1978@gmail.com> said:

    Luca> On Mon, Apr 11, 2022 at 3:04 PM Luca Ferrari <fluca1978@gmail.com> wrote:
    >> 
    >> Hi all,
    >> I've compiled Emacs 28.1 without any particular option on Ubuntu
    >> 20.04. Then I've placed the following in my startup file:

    Luca> I found there is a much more annoying problem that I cannot fix: if I
    Luca> select the menu 'Set Default Font', the font menu has only three items
    Luca> with "misc", "courier" and "fontset". This prevents me to select any
    Luca> decent font in the system, and I don't know how to fix it.
    Luca> I've tried to load emacs with, in turn, --no-x-resources,
    Luca> --no-init-file, --no-site-file but nothing changes.
    Luca> I don't have any font settings in XResoucres:

Show us your `system-configuration-features' and `(frame-parameter nil
'font-backend)'

I suspect you donʼt have the development packages installed for
various font-related libraries.

Robert
-- 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: cannot load fonts
  2022-04-27  9:11 ` Luca Ferrari
  2022-04-27  9:29   ` Robert Pluim
@ 2022-04-27  9:34   ` Po Lu
  2022-04-27 12:27     ` Luca Ferrari
  1 sibling, 1 reply; 5+ messages in thread
From: Po Lu @ 2022-04-27  9:34 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs

Luca Ferrari <fluca1978@gmail.com> writes:

> I found there is a much more annoying problem that I cannot fix: if I
> select the menu 'Set Default Font', the font menu has only three items
> with "misc", "courier" and "fontset".

That's the fallback font menu displayed if there is no "native" toolkit
font dialog (i.e. the GTK one, when Emacs is built with GTK).  This
problem with the fallback menu has also been fixed in Emacs 29.

> I've tied to recompile emacs with --with-x-toolkit=yes or
> --with-x-toolkit=gtk3 but nothing changes.

Do you have the GTK 3 development files installed?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: cannot load fonts
  2022-04-27  9:34   ` Po Lu
@ 2022-04-27 12:27     ` Luca Ferrari
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ferrari @ 2022-04-27 12:27 UTC (permalink / raw)
  To: Po Lu; +Cc: help-gnu-emacs

On Wed, Apr 27, 2022 at 11:34 AM Po Lu <luangruo@yahoo.com> wrote:
> That's the fallback font menu displayed if there is no "native" toolkit
> font dialog (i.e. the GTK one, when Emacs is built with GTK).  This
> problem with the fallback menu has also been fixed in Emacs 29.

Great!
Installng libgtk-3-dev and recompiling (not sure it was required) it now works.

Thanks,
Luca



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-27 12:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 13:04 cannot load fonts Luca Ferrari
2022-04-27  9:11 ` Luca Ferrari
2022-04-27  9:29   ` Robert Pluim
2022-04-27  9:34   ` Po Lu
2022-04-27 12:27     ` Luca Ferrari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.