caldwell / build-emacs

Build scripts for www.emacsformacosx.com
http://www.emacsformacosx.com/about
GNU General Public License v3.0
364 stars 61 forks source link

The 29.1/29.2 builds don't respect certain user-installed Mac fonts #133

Open shipmints opened 1 year ago

shipmints commented 1 year ago

Thank you for providing these builds. Very convenient.

Some issues with Mac fonts, though. I can set Courier or Menlo or other system fonts and when I try Consolas or Inconsolata it defaults to Helvetica. Is something missing in this build? In the same vein, I don't see ns-popup-font-panel or mac-font-panel-mode. I've been using your 28 series builds with Inconsolata (self installed) just fine until yesterday when I tried 29.1 (for eglot). Perhaps self-installed fonts are special in some way.

e.g.,

This doesn't work

(custom-set-faces
 '(default ((t (:inherit nil :extend nil :stipple nil :background "black" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 240 :width normal :foundry "nil" :family "Inconsolata")))))

This works

(custom-set-faces
 '(default ((t (:inherit nil :extend nil :stipple nil :background "black" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight regular :height 240 :width normal :foundry "nil" :family "Courier")))))
shipmints commented 1 year ago

Weirdly, find-font does find Inconsolata

(find-font (font-spec :name "Courier"))
#<font-entity mac-ct nil Courier nil iso10646-1 regular normal normal 0 nil 100 0 ((:font-entity #<ptr 0x72656972756f4375> . 1342178304) (:name . "Courier"))>
(find-font (font-spec :name "Inconsolata"))
#<font-entity mac-ct nil Inconsolata nil iso10646-1 medium normal normal 0 nil 100 0 ((:font-entity #<ptr 0x356e1ad8312088b5> . 1024) (:name . "Inconsolata"))>
shipmints commented 7 months ago

Still trying to understand this, to no avail so far, except for one new clue. The latest 29.2 build has the same erroneous font behavior as 29.1. I also tested on both Mojave and on Monterey and the behavior is the same so it's not O/S API related.

I launched via the command line to look for errors and none visible.

I specified --font='Inconsolata' WHICH DOES WORK and allows custom-set-faces to work. Why these builds have inconsistent behavior vs older builds that worked, and specifically what changed, I still can't say.

Is anyone else experiencing the same thing? Is this command-line clue helpful?

shipmints commented 7 months ago

Another clue. Even without specifying --font on the command line, changing the default font using the Options...Set Default Font... menu via the Mac-supplied font dialog box does work, but only for the session.

shipmints commented 7 months ago

Switching to Iosevka Fixed, installed as a ttc file (very convenient), it works fine.

Uninstalling my existing Inconsolata otf file and reinstalling a fresh Inconsolata Medium font as a ttf file does not work.

However, using the variable-font file "Inconsolata-VariableFont_wdth,wght.ttf" seems to work fine.

This is now no longer an issue for me but remains a mystery to me why Emacs 29.1 and 29.2 have changed font handling behavior from the 28 and earlier releases. Since no errors or complaints are produced, it's a silent failure. And why --font works on the command line also a mystery and clearly indicates that emacs 29.x is capable of finding and rendering the font.

caldwell commented 7 months ago

I was having trouble with fonts as well. I tried to track it down but wasn't able to find the issue. I was using a bitmap font that a colleague made and I can't get it to be seen at all in 29. I ended up going back to Inconsolata, which works fine for me. Interestingly that's one you were having trouble with. I'm using the normal .ttfs that I've had forever.

I configured it through M-x customize-face RET default RET. In my .emacs my custom-set-faces for the default face looks like

(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 (:height 120 :width normal :foundry "apple" :family "Inconsolata"))))

All that said, I don't think this is a build issue. I think this would be better reported to M-x report-emacs-bug.

shipmints commented 7 months ago

Agree, at this point, these issues are likely not related to your helpful and welcome builds. I'm tempted to leave this issue open as, perhaps, it will help others who are experiencing font issues.