From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Implement functions for measuring fonts and max chars per line Date: Sat, 17 Jan 2015 15:38:39 -0500 Message-ID: <20150117153839.0de5fa7b@jabberwock.cb.piermont.com> References: <87k31j3g03.fsf@posteo.de> <87d27b2ugp.fsf@posteo.de> <87zjaeo7eg.fsf@posteo.de> <874mrp46ns.fsf@posteo.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1421527128 4378 80.91.229.3 (17 Jan 2015 20:38:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 20:38:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Titus von der Malsburg Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 17 21:38:48 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YCa8t-0005Py-F6 for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 21:38:47 +0100 Original-Received: from localhost ([::1]:60222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCa8s-0006Fa-LX for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 15:38:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCa8n-0006FJ-UB for emacs-devel@gnu.org; Sat, 17 Jan 2015 15:38:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCa8m-0003JE-QZ for emacs-devel@gnu.org; Sat, 17 Jan 2015 15:38:41 -0500 Original-Received: from hacklheber.piermont.com ([2001:470:30:84:e276:63ff:fe62:3400]:58540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCa8m-0003JA-Lw for emacs-devel@gnu.org; Sat, 17 Jan 2015 15:38:40 -0500 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id D7C7D323; Sat, 17 Jan 2015 15:38:39 -0500 (EST) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 9A6FD2DEB17; Sat, 17 Jan 2015 15:38:39 -0500 (EST) In-Reply-To: <874mrp46ns.fsf@posteo.de> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.25; x86_64-apple-darwin14.0.0) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:470:30:84:e276:63ff:fe62:3400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181384 Archived-At: On Sat, 17 Jan 2015 10:13:27 -0800 Titus von der Malsburg wrote: > +** A new function `default-font-width' returns the average width > of a +character in the current buffer's default font. If the > default face +is remapped (see `face-remapping-alist'), the value > for the remapped +face is returned. This function complements the > existing function +`default-font-height'. > + > +** New functions `window-font-height' and `window-font-width return > +the height and average width of characters in a specified face and > +window. If FACE is remapped (see `face-remapping-alist'), the > +function returns the information for the remapped face. > + > +** A new function `window-max-chars-per-line' returns the maximal > +number of characters that can be displayed on one line. If a face > +and/or window are provided, these values are used for the > +calculation. This function is different from `window-body-width' > in +that it accounts for (i) continuation glyphs, (ii) the size of > the +font, and (iii) the specified window. This all brings to mind: is there a good way now to determine what the maximum number of lines in a frame would be in a given font on the user's display? Perry -- Perry E. Metzger perry@piermont.com