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: Pixel-based display functions Date: Sun, 01 Feb 2015 20:36:19 +0200 Message-ID: <8361bliin0.fsf@gnu.org> References: <87k306pfi9.fsf@building.gnus.org> <87egqekrd7.fsf@building.gnus.org> <877fw53eat.fsf@building.gnus.org> <877fw4zsdv.fsf@building.gnus.org> <831tmcn4k4.fsf@gnu.org> <87386szq1w.fsf@building.gnus.org> <83wq44ljm9.fsf@gnu.org> <87vbjowlqv.fsf@building.gnus.org> <83oapglbx6.fsf@gnu.org> <83lhkkl23i.fsf@gnu.org> <83bnlgkl1s.fsf@gnu.org> <837fw3l7uz.fsf@gnu.org> <54CD4B27.4080201@gmx.at> <874mr6qvi5.fsf@building.gnus.org> <87sieqpfxh.fsf@building.gnus.org> <54CDE908.7050908@gmx.at> <87ioflq0dz.fsf@building.gnus.org> <54CE2187.9070003@gmx.at> <83lhkhiq8t.fsf@gnu.org> <54CE54A3.1020707@gmx.at> <838ughilmo.fsf@gnu.org> <54CE6BD2.8000402@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422815823 27809 80.91.229.3 (1 Feb 2015 18:37:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Feb 2015 18:37:03 +0000 (UTC) Cc: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 01 19:37:02 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 1YHzOF-0003GE-Uw for ged-emacs-devel@m.gmane.org; Sun, 01 Feb 2015 19:37:00 +0100 Original-Received: from localhost ([::1]:51497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHzOF-00021K-9g for ged-emacs-devel@m.gmane.org; Sun, 01 Feb 2015 13:36:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHzNx-00020N-DT for emacs-devel@gnu.org; Sun, 01 Feb 2015 13:36:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHzNs-0003Tx-Vz for emacs-devel@gnu.org; Sun, 01 Feb 2015 13:36:41 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:35979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHzNs-0003Tp-O0 for emacs-devel@gnu.org; Sun, 01 Feb 2015 13:36:36 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NJ300400V5CXE00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sun, 01 Feb 2015 20:36:35 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJ3004MEVOYVW50@a-mtaout21.012.net.il>; Sun, 01 Feb 2015 20:36:35 +0200 (IST) In-reply-to: <54CE6BD2.8000402@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:182200 Archived-At: > Date: Sun, 01 Feb 2015 19:09:22 +0100 > From: martin rudalics > CC: larsi@gnus.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org > > > The problem, as I understand it, is to find the place where to insert > > these breaks, when column text is wider than the column. And > > window-text-pixel-size cannot tell you that, it can only tell whether > > the chunk of text fits or not. > > IIUC he would have to check each word whether it still fits into his > column including a leading space. Maybe he could start with some n > words and remove those that don't fit. Yes, that's possible. But font-get-glyphs allows to do this directly, without iterations. > I have no idea how Emacs deals with line-breaking embedded R2L text > anyway. The same as it does with L2R text. Line breaking in Emacs works in visual order. > > It's not kaput. The problem happens only if its results are used for > > inserting a newline in order to break the line in two. In all other > > use cases, it does exactly TRT. > > I haven't looked into this yet but am afraid that if FROM or TO are > somewhere within R2L text it won't necessarily report the maximum length > of a line. I don't see why it wouldn't report the maximum length. It actually reports the maximum X coordinate, so bidirectional reordering cannot break that, since pixel coordinates are still measured left to right. Unless, that is, you mean R2L lines (and not R2L text within a L2R line), in which case you indeed need to offset the X coordinate by the window's text-box width. This needs to be done in move_it_to. See near the end of pos_visible_p for how this is done.