From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Pixel-based display functions Date: Fri, 30 Jan 2015 18:27:23 +1100 Message-ID: <87386szq1w.fsf@building.gnus.org> References: <83iogujvbq.fsf@gnu.org> <87tx0ee7rf.fsf@building.gnus.org> <83egricpvg.fsf@gnu.org> <87zj97vic8.fsf@building.gnus.org> <83wq4argjp.fsf@gnu.org> <87iofui8vo.fsf@building.gnus.org> <838ugqqczp.fsf@gnu.org> <877fw9dndz.fsf@building.gnus.org> <83a914ozsh.fsf@gnu.org> <874mrb1t62.fsf_-_@building.gnus.org> <87vbjrl49k.fsf@violet.siamics.net> <8361bqogah.fsf@gnu.org> <87k306pfi9.fsf@building.gnus.org> <87egqekrd7.fsf@building.gnus.org> <877fw53eat.fsf@building.gnus.org> <877fw4zsdv.fsf@building.gnus.org> <831tmcn4k4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=shift_jis Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422602885 3784 80.91.229.3 (30 Jan 2015 07:28:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2015 07:28:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 30 08:28:04 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 1YH5zn-0003py-Qs for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 08:28:03 +0100 Original-Received: from localhost ([::1]:35098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH5zn-00040x-0q for ged-emacs-devel@m.gmane.org; Fri, 30 Jan 2015 02:28:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH5zh-00040g-7M for emacs-devel@gnu.org; Fri, 30 Jan 2015 02:28:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YH5zc-0003yg-Jo for emacs-devel@gnu.org; Fri, 30 Jan 2015 02:27:57 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:57840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YH5zc-0003yL-D0; Fri, 30 Jan 2015 02:27:52 -0500 Original-Received: from diaman3.lnk.telstra.net ([203.45.116.145] helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1YH5zD-0000vp-OW; Fri, 30 Jan 2015 08:27:28 +0100 In-Reply-To: <831tmcn4k4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 30 Jan 2015 08:52:27 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-MailScanner-ID: 1YH5zD-0000vp-OW MailScanner-NULL-Check: 1423207649.24492@OwEifQh67a9dWQaejCYbQA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:182025 Archived-At: Eli Zaretskii writes: >> From: Lars Ingebrigtsen >> Date: Fri, 30 Jan 2015 17:37:00 +1100 >>=20 >> `font-get-glyphs' on a large region is quite fast, but since the font >> may vary, I'm calling it on a char-by-char basis, and that's s-l-o-w. > > That's your problem: you should call it on a run of characters that > have the same face. Use next-single-char-property-change to find > where such runs begin and end. The face doesn't say what font is going to be used. If I put =93=FA=96{=8C= =EA here, the entire preceding line has the same face, but two different fonts. I've done further experimentation, and it turns out my previous analysis was kinda wrong. `font-get-glyphs' isn't really the problem -- `font-at' is. Calling it once per character is just way too slow. If you have a handy function that can segment lines according to font (even though it can't say what the font is (yet)), that would be useful. If I could (on the first line there) just call `font-at' twice, I think that would allow me to write an algorithm that should be fast enough. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/