From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Implementing Vertical Text support in Emacs Date: Thu, 08 Sep 2022 22:05:39 +0300 Message-ID: <838rmtelfg.fsf@gnu.org> References: <83r13sttj6.fsf@gnu.org> <87wndi6xau.fsf@yahoo.com> <83mtebq0nd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11914"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?B?4KS44KSu4KWA4KSwIOCkuOCkv+CkguCkuSBTYW1lZXIgU2luZ2g=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 08 21:07:32 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWMs8-0002xi-Av for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 21:07:32 +0200 Original-Received: from localhost ([::1]:59490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWMs7-0003pL-ER for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Sep 2022 15:07:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWMqc-0002uK-FR for emacs-devel@gnu.org; Thu, 08 Sep 2022 15:06:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWMqc-0000zg-6t; Thu, 08 Sep 2022 15:05:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=EUHve9NFq5niQRtvIf517BcdwT02HY4BE45GGK/rdPo=; b=QS+g7TNguL0q7GgsHbCZ sc5Rj5TTtUVG5uM7tUXvH5TiI4svDn76Xa2eNbHOKTsAvCHTB7l095lsb1DFOGsMsrpnp81PmLjzG ccJq5YplEHOhoWbWPVB9o8gyWNkAdUk1sfcadL8GzlLWZeCTCnNA9wFJkKi4hRgPj1h4IbvT+/1Ts +mO6MYSnUKCJQHK3rcS5a/+Fv1MM1jjH4jFK5+X9o4zML0IeHfJcJCcSciojBXVvh/CDIcq/zB11I x1WRo/6pOaiqxSgOr4hKBfYexssM24EauM7Tq5hKlTtE16h72i/VEhGRhCJxxNylfjBD+if/x7i7/ aaPQN7h54/eTzQ==; Original-Received: from [87.69.77.57] (port=4407 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWMqZ-0005MP-Gk; Thu, 08 Sep 2022 15:05:58 -0400 In-Reply-To: (message from =?utf-8?B?4KS44KSu4KWA4KSwIOCkuOCkv+CkguCkuQ==?= Sameer Singh on Fri, 9 Sep 2022 00:14:45 +0530) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295003 Archived-At: > From: समीर सिंह Sameer Singh > Date: Fri, 9 Sep 2022 00:14:45 +0530 > Cc: emacs-devel@gnu.org > > Well after getting some free time I started to work on this for a week or so and I have to say I am quite a bit > lost :( > > Right now I don't care about harfbuzz or correct character composition, I only want to display rows vertically, > but > I don't know where to start, does modifying only display_line and move_it_in_display_line_to work? > Even if this is the case, I don't know how to parse the huge display_line function and find the area of interest > among the lines of wrap and hscroll code? where is the code where the matrix is filled? display_line is the relatively low level which produces a single screen line of a window, i.e. a single row of characters, images, and other "display elements" that occupy a single visual line. Before you modify display_line, you need to decide how will the vertical-layout display produce glyphs. The easiest would be to produce them in column-wise order, because that basically processes the buffer in the order of character positions, like Emacs does now. This will allow you to leave the lower levels, which walk the buffer and deliver characters, mostly intact. So perhaps you should have a display_column function, which will look like display_line, but instead of advancing the X coordinate, it will advance the Y coordinate, and produce a single column, top to bottom. Then the basic calculations should be the same as in display_line, except the column ends when it reaches last_visible_y instead of last_visible_x. IOW, the glyph matrices will be made of glyph columns instead of glyph rows. Basically, the roles of the X and the Y coordinates will be swapped. I suggest to invest some time in reading the code of display_line and studying its main ideas and tasks. Because the hypothetical display_column will have to do something very similar, just vertically instead of horizontally. Ask questions where you cannot figure stuff out. Then design your display_column in a similar way. > Regrettably my inexperience is causing hurdles therefore any guidance would be a huge help. Don't give up. And thanks for working on this.