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: Sun, 26 May 2024 11:51:54 +0300 Message-ID: <86wmnhvtud.fsf@gnu.org> References: <87a5l49a53.fsf@yahoo.com> <87seyw7udp.fsf@yahoo.com> <87wmo0zzni.fsf@yahoo.com> <86r0e83gez.fsf@gnu.org> <861q661vgf.fsf@gmail.com> <86le4dvxx9.fsf@gmail.com> <87frulynby.fsf@yahoo.com> <86zfslctt8.fsf@gmail.com> <86r0dwag4n.fsf@gnu.org> <86r0dww9ne.fsf@gmail.com> <86le43x6ss.fsf@gmail.com> <86o78z8jw2.fsf@gnu.org> <86o78yr45t.fsf@gmail.com> <86h6em1hih.fsf@gnu.org> <86cyp9h0xq.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5062"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: "Elijah G." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 26 10:52:50 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 1sB9cY-00018h-8G for ged-emacs-devel@m.gmane-mx.org; Sun, 26 May 2024 10:52:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB9bj-00043Z-FX; Sun, 26 May 2024 04:51:59 -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 1sB9bh-000433-M0 for emacs-devel@gnu.org; Sun, 26 May 2024 04:51:57 -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 1sB9bh-00088s-DM; Sun, 26 May 2024 04:51:57 -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=DV5E2z2+11loOxNbDM9Vub7m3awH+CH3K+CiLcoD6d8=; b=Z8EKs8gk/VnO quCJLV5qEm7noqLo+xgrr5a8HZ8qu4SftTfg1Bx4+JvmydBXzxVi7ENgZBcbMsk6ag0uNk5gURj7a CtaLzVGzOlpq1MHtY5hXD00WIJRWGDUfZn8xepj0zrSiiIyVDp+a5kk0V61IEkcnbRHGzKkzSvuXX PxM2Qb42ow4Gn0nR/uvToH/qx2aDi8JlmjE9/XUYOZA3n2+W3vu3OKsbQlGknGPMhOW2IVXe2wfV2 ToPFmuNeF5wQz3CbgKUiUSG8R12oibpHtxFHNvXyrIbCjGMb0PFJZRpRepbT5QAic0OILHvQjmg9w pYtF3KQMbAiTLROs+02Sxg==; In-Reply-To: <86cyp9h0xq.fsf@gmail.com> (eg642616@gmail.com) 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:319581 Archived-At: > From: "Elijah G." > Cc: luangruo@yahoo.com, emacs-devel@gnu.org > Date: Sat, 25 May 2024 18:27:45 -0600 > > I'm wondering if the patch must be here or to the bug tracker, if > should it be sent here i think bug#71159 can be closed. It's better to send to the bug tracker (and to start the discussion there in the first place). But sending both here and to the bug tracker is the absolute worst, so please don't do that in the future. > >> +static void > >> +w32_fill_stipple_pattern (HDC hdc, struct glyph_string *s, Emacs_GC *gc, > >> + int x, int y, unsigned int width, unsigned int height) > >> +{ > >> + /* BUG: stipple bitmap has the inverted colors, inverting > >> + those 2 functions color must fix this. */ > > > > Can we fix this before installing, please? If there are problems with > > inverting the colors that you are unsure how to fix, please describe > > those problems in detail, so that others could provide advice or code. > > I would like fix it, but I don't have a clear answer as to why this > problem happens, I just left the notice there as a temp solution in case > someone comes up with a better solution. > > I could see that BitBlt maybe can fix this (I've had problems for test > it). > > Also I don't think w32_create_pixmap_from_bitmap_data cause this > problem, as far as i could see it's a problem with the bitmap data > > image_create_bitmap_from_data (struct frame *f, char *bits, > ^^^^ > (as example this function) > > One solution that i was thinking is using a kind of inverse-video for > make it use fg as bg and vice-versa but I'm not sure how. > > Also I was thinking in modifying bitmap data with something like this, > but i don't have idea how: > > for (i = 0; i < height; i++) > { > -- Invert bitmap data-- > for (j = 0; j < w1; j++) > { > -- Invert bitmap data-- > } > } Please explain the problem in more detail. Above you are talking about the possible cause and the potential solutions, but do not describe the problem itself. It's hard to think about solutions without understanding the problem in detail. > > > > Finally, this change needs a NEWS entry, in the "Changes in Emacs 30.1 > > on Non-Free Operating Systems" section. > > Done. > > >> I would like if someone else can test it for see if there are any > >> issues. > > > > Please suggest how to test this. > > Sure, after apply patch and build Emacs, i open runemacs.exe with -Q, > inside the scratch-buffer i paste these code snippets and eval them: > > (let* ((w (window-font-width)) > (stipple `(,w 1 ,(apply #'unibyte-string > (append (make-list (1- (/ (+ w 7) 8)) ?\0) > '(1)))))) > (insert "\n" (propertize (concat (make-string 15 ?\s) > "THIS IS A TEST" > (make-string 15 ?\s)) > 'face `(:background "red" :foreground "blue" :stipple ,stipple)))) > > The first makes a stipple with blue lines with a red background. It crashed for me. I needed to make the following changes in image_create_bitmap_from_data: #ifdef HAVE_NTGUI Emacs_Pixmap bitmap = CreateBitmap (width, height, dpyinfo->n_planes, dpyinfo->n_cbits, bits); instead of using XFRAME(frame) there, since the variable 'frame' was not initialized, and you have dpyinfo already anyway. I guess you sent code that was not the final version? > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -2779,6 +2779,9 @@ title bars' and scroll bars' appearance. If the new user option > will disregard the system's Dark mode and will always use the default > Light mode. > > ++++ > +*** Support for stipples. That's too terse. It should say --- *** Emacs on MS-Windows now supports the :stipple face attribute. Also, "---" not "+++" since this change does not require any changes in the manuals. Thanks.