Disclaimer

The content of this blog is my personal opinion only. Although I am an employee - currently of Imagination Technologies's MIPS group, in the past of other companies such as Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

Tuesday, May 02, 2017

Emacs Fontsets for new Cygwin SurfBook

I recently switched from a MacMook to a Microsoft Surface Book (UNIX/MacOS is nice, but Microsoft is more innovative wrt form factor).



Of course I am still using EMACS.  This go-around using emacs-w32 rather than XWin based emacs.



The default font (fonsets, faces) for emacs-w32 were well-nigh unreadable, at least when scaled up onto large high resolution monitors. Much too thin, too light.



;; Microsoft / emacs-w32
;; w32-standard-fontset-spec
;; "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
I first tried bolding everything

(set-face-attribute 'default nil :weight 'bold)
but this lost places where the emacs faces were already using bold to indicate something.

So eventually I figured out how to create new fontsets out of existing fonts on the system
(create-fontset-from-fontset-spec "-outline-Lucida Sans Typewriter-*-*-*-mono-*-*-*-*-*-*-fontset-lucida_sans_typewriter_AGfs")
(create-fontset-from-fontset-spec "-outline-Lucida Console-*-*-*-mono-*-*-*-*-*-*-fontset-lucida_console_AGfs")
(create-fontset-from-fontset-spec "-outline-MS Gothic-*-*-*-mono-*-*-*-*-*-*-fontset-ms_gothic_AGfs")
(create-fontset-from-fontset-spec "-outline-Modern-*-*-*-mono-*-*-*-*-*-*-fontset-modern_AGfs")
(create-fontset-from-fontset-spec "-outline-Consolas-*-*-*-mono-*-*-*-*-*-*-fontset-modern_AGfs")
;; Emacs should support proportional, non-monospace font, but occasionally has problems
(create-fontset-from-fontset-spec "-outline-Arial-*-*-*-*-*-*-*-*-*-*-fontset-Arial_AGfs")
(create-fontset-from-fontset-spec "-outline-Times New Roman-*-*-*-*-*-*-*-*-*-*-fontset-Times_New_Roman_AGfs")
(create-fontset-from-fontset-spec "-outline-Lucida Sans Unicode-normal-normal-normal-sans-*-*-*-*-p-*-fontset-Lucida_Sans_Unicode_AGfs")
;; the create-fontset-from-fontset-spec above apparently create shorthand names
(and nil
  ;; DISABLED - don't load unless needed
  (set-face-font 'default "fontset-lucida_sans_typewriter")
  (set-face-font 'default "Consolas") ; MS font good for programming
  (set-face-font 'default "Courier")
  (set-face-font 'default "Courier New")
  (set-face-font 'default "Lucida Sans Typewriter")
  (set-face-font 'default "Lucida Console")
  (set-face-font 'default "MS Gothic")
  (set-face-font 'default "Arial")
  (set-face-font 'default "Times New Roman")
  (set-face-font 'default "Lucida Sans Unicode")
  )
;; Default font
(set-face-font 'default "Consolas") ; MS font good for programming
With "Consolas" being my new default font.  Oscillating between Consolas and Lucida Console.



TBD: overlap fonts in fontsets to cover the unicode characters that I want to use - French, German, Japanese, Chinese, and math symbols.

I am missing how Apple had better integrated Unicode coverage.

---

See also

EmacsWiki: Font Sets: