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, 24 Nov 2022 13:39:24 +0200 Message-ID: <83mt8gwphv.fsf@gnu.org> References: <83r13sttj6.fsf@gnu.org> <87wndi6xau.fsf@yahoo.com> <83mtebq0nd.fsf@gnu.org> <838rmtelfg.fsf@gnu.org> <83leqr9pb4.fsf@gnu.org> <83v8p5e5mt.fsf@gnu.org> <83ilj96ec6.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="1160"; 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 Nov 24 12:41: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 1oyAbk-00006V-Fd for ged-emacs-devel@m.gmane-mx.org; Thu, 24 Nov 2022 12:41:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyAZu-00045z-DW; Thu, 24 Nov 2022 06:39:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyAZS-0002k7-HS for emacs-devel@gnu.org; Thu, 24 Nov 2022 06:39:11 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyAZR-0007Cg-St; Thu, 24 Nov 2022 06:39:09 -0500 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=oiGCMZmStppxk8Ngp0hgDCwfgXsrsirfvGERuwh3nMM=; b=UNfzJ3UMB3ebSahpPiW5 EFkBjK2ilWytJtgN1oTB7UzmoZQEW4KM4NnkJOGFzDeVtYbHQJKlKZx5rE2IfhIJDff/EcATEa50F PCZo/SVUoM6N4QGlXrq/w6k5OzBLq8rf31a/T2igAOCMKVj40nFaCXwJ5AHnsGfgpL+VeJafBNIAa 1nVvAUK9wHgalrmK6zKdYHUQNMb5HqWv9a9wcH+aIYIpmDfnO5DMYnVzXm4kO0SDLSMe+Ygul54ei wBGMVpzvdD3pFaJVUx1PcAV2Y19ck2f/Q5H9ndnPnk8JheQ0hZfDD2qi9PI/Nu9PHh9+gZvEeLdqx Kugo+KqwiVdcww==; Original-Received: from [87.69.77.57] (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 1oyAZO-0003Gu-Ho; Thu, 24 Nov 2022 06:39:07 -0500 In-Reply-To: (message from =?utf-8?B?4KS44KSu4KWA4KSwIOCkuOCkv+CkguCkuQ==?= Sameer Singh on Sun, 20 Nov 2022 17:38:05 +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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300436 Archived-At: > From: समीर सिंह Sameer Singh > Date: Sun, 20 Nov 2022 17:38:05 +0530 > Cc: emacs-devel@gnu.org > > I'm not sure I understand the question. Are you saying that if you ignore > the line overflow, termination of a line, etc., you can write code that does > display characters column-wise? > > I thought that displaying line row wise is the "base" of the display_line function with code for > line truncation, overflow, bidi etc added on top of it in "if" blocks That is basically correct. > so if I could just get the base to work (i.e. displaying lines in a > column) then I could work on the the finer details. Am I wrong? No, you are not wrong. But the base of display_line is very simple: prepare_desired_row (it->w, row, false); row->y = it->current_y; row->start = it->start; row->continuation_lines_width = it->continuation_lines_width; row->displays_text_p = true; row->starts_in_middle_of_char_p = it->starts_in_middle_of_char_p; it->starts_in_middle_of_char_p = false; it->stretch_adjust = 0; row->ascent = it->max_ascent; row->height = it->max_ascent + it->max_descent; row->phys_ascent = it->max_phys_ascent; row->phys_height = it->max_phys_ascent + it->max_phys_descent; row->extra_line_spacing = it->max_extra_line_spacing; while (true) { if (!get_next_display_element (it)) { row->ends_at_zv_p = true; break; } PRODUCE_GLYPHS (it); if (/* Not a newline. */ nglyphs > 0 /* Glyphs produced fit entirely in the line. */ && it->current_x < it->last_visible_x) { it->hpos += nglyphs; row->ascent = max (row->ascent, it->max_ascent); row->height = max (row->height, it->max_ascent + it->max_descent); row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); } else { ++it->hpos; row->ascent = max (row->ascent, it->max_ascent); row->height = max (row->height, it->max_ascent + it->max_descent); row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); row->phys_height = max (row->phys_height, it->max_phys_ascent + it->max_phys_descent); row->extra_line_spacing = max (row->extra_line_spacing, it->max_extra_line_spacing); } if (ITERATOR_AT_END_OF_LINE_P (it)) { /* Add a space at the end of the line that is used to display the cursor there. */ if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) append_space_for_newline (it, false); /* Extend the face to the end of the line. */ extend_face_to_end_of_line (it); /* Consume the line end. This skips over invisible lines. */ set_iterator_to_next (it, true); it->continuation_lines_width = 0; break; } } compute_line_metrics (it); Basically, it loops calling get_next_display_element, then PRODUCE_GLYPHS, and then set_iterator_to_next.