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

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

Font width and frame width


From: Lennart Borgman
Subject: Font width and frame width
Date: Sun, 15 Mar 2009 15:54:49 +0100

How do I get the number of columns on a maximized frame? I expected
the following to give me this in cols, but it does not give the same
value as (frame-width).


;; Run this on a maximized frame
(defun my-display-test ()
  (let* ((display-pixel-width (display-pixel-width))
         (fontname (face-attribute 'default :font))
         (font-info (font-info fontname))
         (font-width  (aref font-info 2))
         (cols (/ display-pixel-width font-width))
         )
    (message "frame-width: %s, cols: %s" (frame-width) cols)
    ))




reply via email to

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