emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Recent changes incorrectly calculate font size within daemon mode


From: Drew Adams
Subject: RE: Recent changes incorrectly calculate font size within daemon mode
Date: Thu, 30 Aug 2018 09:55:28 -0700 (PDT)

> Michael Heerdegen wrote:
> > The problem is that (aref xlfd-fields xlfd-regexp-pixelsize-subnum)
> > returns nil which I guess is not correct.
> 
> Thanks for this example. However, it relies on some stuff from Drew Adams
> that is not part of Emacs. Can you please give a self-contained example of 
> how to
> reproduce the problem? (If the first step is "download foo from bar", that's
> fine; however, I couldn't easily figure out how to download Adams's code
> from his wiki, as a page seems to be missing.)'

Adams does not have a wiki. ;-)  The code is on Emacs Wiki, at the regular
download location (Elisp Area):

https://www.emacswiki.org/emacs?action=elisp-area;context=0

Download frame-fns.el and frame-cmds.el, and load them in that order.
The function that uses (aref xlfd-fields xlfd-regexp-pixelsize-subnum) is
`frcmds-enlarged-font-name':

(defun frcmds-enlarged-font-name (fontname frame increment)
  "FONTNAME, after enlarging font size of FRAME by INCREMENT.
FONTNAME is the font of FRAME."
  (when (query-fontset fontname)
    (let ((ascii  (assq 'ascii (aref (fontset-info fontname frame) 2))))
      (when ascii (setq fontname  (nth 2 ascii)))))
  (let ((xlfd-fields  (x-decompose-font-name fontname)))
    (unless xlfd-fields (error "Cannot decompose font name"))
    (let ((new-size  (+ (string-to-number (aref xlfd-fields 
xlfd-regexp-pixelsize-subnum))
                        increment)))
      (unless (> new-size 0) (signal 'font-too-small (list new-size)))
      (aset xlfd-fields xlfd-regexp-pixelsize-subnum (number-to-string 
new-size)))
    ;; Set point size & width to "*", so frame width will adjust to new font 
size
    (aset xlfd-fields xlfd-regexp-pointsize-subnum "*")
    (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*")
    (x-compose-font-name xlfd-fields)))

https://www.emacswiki.org/emacs/download/frame-fns.el

https://www.emacswiki.org/emacs/download/frame-cmds.el



reply via email to

[Prev in Thread] Current Thread [Next in Thread]