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: Stipples support in MS-Windows port Date: Fri, 03 May 2024 09:09:41 +0300 Message-ID: <86h6ffjuje.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11501"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Elijah G Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 03 08:10:53 2024 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 1s2m8C-0002qm-H5 for ged-emacs-devel@m.gmane-mx.org; Fri, 03 May 2024 08:10:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2m7B-0001YN-9h; Fri, 03 May 2024 02:09:49 -0400 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 1s2m76-0001Y8-FB for emacs-devel@gnu.org; Fri, 03 May 2024 02:09:44 -0400 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 1s2m76-0005Ul-6q; Fri, 03 May 2024 02:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7muJD422c++feuaCgC+P1Pu+aBw4xIjbKvfi9rJRlQ8=; b=IrZjYuYQsPIV TSEykuq2MAJHP0Rqi1dlWwLUATl3bklY3aQlBf6hZymj1tWIo7/08/SpHDOGykLflzvgiy0KKZDvC DbE3NzBuyk/0UXKILr4LxqJ6fIbjdOKBcRhawsvGyvartYOZRw2skSsN9gUmSagPVNaJar265Ywcf xd7YHvGJLYU10ORaJnVPCusBVeEZy1U9ux7/q0Zu0qoHSg1EG9zYmMn593Zj/ilpvotsWrkKNQI6G 93xgk9Dxqw0uvMYReGQDtTSC7QbKaLNMfrcuzEGSW3oTTZa52AqlJJ6xqNukZk9XbRskIv3RtH3ta EOphWIuspwGmEu4LnswAjg==; In-Reply-To: (message from Elijah G on Thu, 2 May 2024 20:53:17 -0600) 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:318634 Archived-At: > From: Elijah G > Date: Thu, 2 May 2024 20:53:17 -0600 > > Hi, i'm starting this thread to discuss the > support for stipples in windows port. Thank you for working on this. > My ideas in how this can be done is using > the w32term.c functions for drawing rects, > i tested using w32_fill_rect but it doesn't > work, i don't know how it works. > > The elisp snippet that i'm using for test this is this: > ``` > (let* ((w (window-font-width)) > (stipple `(,w 1 ,(apply #'unibyte-string > (append (make-list (1- (/ (+ w 7) 8)) ?\0) > '(1)))))) > (insert "\n" (propertize " " 'face `(:background "red" > :foreground "blue" :stipple ,stipple)))) > ``` > The closest thing i got was using w32_draw_rectangle > inside w32_draw_glyph_string_background > but for some reason it freezes and crashes after evaling > the snippet, I'm not sure if it is related to the way I did it or is > anything related to GC. > > Below this mail can you get the patch for test it > (Also i'm sorry if the patch is too long i accidentally > formatted it with clang-format) Please undo the reformatting, it resulted in an ocean of unrelated changes that completely drown your real changes, and make it very hard, almost impossible, to review the patch. Especially since you are asking why the code crashes, the answer to which is likely to be in some subtle aspect of the code. > Also can i ask what is the purpose of this line? > ``` > # include "bitmaps/gray.xbm" > ``` It comes from xterm.c, and defines gray_bits, gray_width, and gray_height, which xterm.c uses for implementing the stipple. See in xterm.c for the details.