bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16028: 24.3.50; Latest build completely breaks my thumnail frames co


From: martin rudalics
Subject: bug#16028: 24.3.50; Latest build completely breaks my thumnail frames code
Date: Tue, 10 Dec 2013 11:49:40 +0100

Yet simpler:

(defun 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 adjusts to new font
    (aset xlfd-fields xlfd-regexp-pointsize-subnum "*")
    (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*")
    (x-compose-font-name xlfd-fields)))

(defun enlarge-font-by (increment)
  (let* ((old-font (cdr (assq 'font (frame-parameters (selected-frame)))))
         (new-font (enlarged-font-name old-font (selected-frame) increment)))
    (modify-frame-parameters
     (selected-frame) (list (cons 'font new-font)
                            (cons 'scroll-bar-width 6)))))

(enlarge-font-by -4)






reply via email to

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