[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stipples support in MS-Windows port
From: |
Elijah G. |
Subject: |
Re: Stipples support in MS-Windows port |
Date: |
Mon, 27 May 2024 18:23:39 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (windows-nt) |
Eli Zaretskii <eliz@gnu.org> writes:
>> 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.
I'm sorry about that, i thought that emacs-devel was the right place for
this, now i will send the patch to the bug tracker (specifically to
bug#71159 thread)
> 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.
It's hard to me explain it with details, i will do my best,
AFAIK the problem is with the bitmap data, which have their bits
inverted, Windows monochromatic bitmaps are reversed compared with X,
what I'm trying to do is reverse the bitmap bytes for make they use the
correct faces.
As i could see, this problem has already happened (see:
http://git.savannah.gnu.org/cgit/emacs.git/tree/src/image.c#n5222)
I would like to know how to apply or reuse that little code snippet for
this stipple implementation.
>> > 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?
I'm not sure why it crashed you, I've tested it a lot of times and I
didn't have any problem.
>> --- 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.
I've applied your changes, i will send the patch to the bug tracker when
the stipple problem is solved.
- Re: Stipples support in MS-Windows port, (continued)
- Re: Stipples support in MS-Windows port, Elijah G., 2024/05/25
- Re: Stipples support in MS-Windows port, Yuri Khan, 2024/05/26
- Re: Stipples support in MS-Windows port, Elijah G., 2024/05/26
- Re: Stipples support in MS-Windows port, Yuri Khan, 2024/05/27
- Re: Stipples support in MS-Windows port, Elijah G., 2024/05/27
- Re: Stipples support in MS-Windows port, Eli Zaretskii, 2024/05/26
- Re: Stipples support in MS-Windows port,
Elijah G. <=