From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: HTML-Info design Date: Sun, 25 Jan 2015 18:06:18 +0200 Message-ID: <83wq4argjp.fsf@gnu.org> References: <83ppbanqhe.fsf@gnu.org> <87vbl2xigp.fsf@ferrier.me.uk> <83ioh2nlow.fsf@gnu.org> <87sig6xech.fsf@ferrier.me.uk> <83fvc5ni0u.fsf@gnu.org> <87k31fwwyv.fsf@ferrier.me.uk> <87bnmq9ibf.fsf@ferrier.me.uk> <87lhlrx5fc.fsf@building.gnus.org> <878uhrcr5l.fsf@building.gnus.org> <83sifzjflk.fsf@gnu.org> <87fvbyagaw.fsf@building.gnus.org> <83iogujvbq.fsf@gnu.org> <87tx0ee7rf.fsf@building.gnus.org> <83egricpvg.fsf@gnu.org> <87zj97vic8.fsf@building.gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422202019 32356 80.91.229.3 (25 Jan 2015 16:06:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Jan 2015 16:06:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 25 17:06:59 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 1YFPiE-0003IA-T1 for ged-emacs-devel@m.gmane.org; Sun, 25 Jan 2015 17:06:59 +0100 Original-Received: from localhost ([::1]:38118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFPiE-0004PH-4h for ged-emacs-devel@m.gmane.org; Sun, 25 Jan 2015 11:06:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFPhy-0004P4-B6 for emacs-devel@gnu.org; Sun, 25 Jan 2015 11:06:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFPhr-0006z0-D8 for emacs-devel@gnu.org; Sun, 25 Jan 2015 11:06:42 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:40398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFPhr-0006yM-4s for emacs-devel@gnu.org; Sun, 25 Jan 2015 11:06:35 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NIQ00900PN5YZ00@mtaout25.012.net.il> for emacs-devel@gnu.org; Sun, 25 Jan 2015 18:01:49 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NIQ007SVPV1BT30@mtaout25.012.net.il>; Sun, 25 Jan 2015 18:01:49 +0200 (IST) In-reply-to: <87zj97vic8.fsf@building.gnus.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 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:181751 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Sun, 25 Jan 2015 11:01:43 +1100 > > >> I've just looked at the doc string of that function briefly, and I'm not > >> sure how I would use that to do filling. I need to know the width a > >> text will take in the buffer, so that I know when to break the line and > >> start a new one. Is it now possible to write a function like > >> `pixel-region-width' that would say how much space the text will occupy? > > > > Either make a string of the text you want to display, or insert that > > text in a temporary buffer, then use this function to find the width > > of that text by summing the widths of all the glyphs. > > I haven't played much with fonts before, so I'm afraid I don't know how > to do this. I've played around with buffer-setting font code for half > an hour, and I'm still not able to get to a font object from text in a > buffer. > > So, starting with (say) > > (with-temp-buffer > (buffer-face-set '(:family "Symbola" :height 150 :width semi-condensed)) > (insert "This is a text")) > > how do I get the font object for each character there so that I can feed > it to `font-get-glyphs'? The function 'font-at' will give you the font object you can feed to 'font-get-glyphs'. Does this solve your problem?