emacs-devel
[Top][All Lists]
Advanced

[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: Tue, 21 May 2024 20:06:38 -0600
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Elijah G." <eg642616@gmail.com>
>> Cc: luangruo@yahoo.com,  emacs-devel@gnu.org
>> Date: Mon, 20 May 2024 20:00:51 -0600
>> 
>> "Elijah G." <eg642616@gmail.com> writes:
>> 
>> >>> From: "Elijah G." <eg642616@gmail.com>
>> >>> Cc: emacs-devel@gnu.org
>> >>> Date: Sun, 19 May 2024 16:37:07 -0600
>> >>> 
>> >>> Good news, the stipple implementation is now done, now works using
>> >>> indent-bars package and other stipples, however there are some
>> >>> issues that i want to remark
>> >>> 
>> >>> 1. Currently it only works for stipple data and not for X Bitmap files,
>> >>>    I don't know where is stored the code for using X Bitmap in stipples.
>> >>
>> >> Please elaborate: what doesn't work yet with this implementation?
>> >
>> > It's kind of hard for me to explain, but I think that doesn't mean it's
>> > hard to solve.
>> >
>> > In the documentation
>> > (http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html)
>> > specifies that stipples can be a filepath to an X Bitmap file:
>> >
>> >   The value can be a string; that should be the name of a file containing
>> >   external-format X bitmap data. The file is found in the directories
>> >   listed in the variable x-bitmap-file-path.
>> >
>> > That is not done yet ...
>> 
>> About this last one, i've forgot that `image_create_bitmap_from_file`
>> can fix this, in case i can solve it, the only issue will be the bitmap
>> having the colors inverted.
>> 
>> A more detailed example about that issue:
>> 
>>     1111001111    0000110000
>>     1111001111    0000110000
>>     1111001111    0000110000
>>     1111001111    0000110000
>>     1111111111    0000000000
>>     1111001111    0000110000
>> 
>>      Expected       Result
>> 
>>   in Windows, bitmaps uses 1 for bg color and 0 for fg.
>
> Why is it a problem to invert the bits programmatically?  We already
> do that in w32_create_pixmap_from_bitmap_data (maybe you could reuse
> it?).

I'd to use `w32_create_pixmap_from_bitmap_data` for convert the stipple
bitmap to a Windows bitmap but i've noticed it inverts stipple bits.

It's just something that could be confusing in the future specifically
these 2 lines since it's using bc color for the text color and
vice-versa:

+  SetTextColor (hdc, gc->background);
+  SetBkColor (hdc, gc->foreground);

I tried reuse w32_create_pixmap_from_bitmap_data to obtained bitmap but
it doesn't seem to work, I just hope it's not a problem.

For now the stipple implementation is now complete (as far as i could test),
Now uses xbm files and stipple data.

Here an example using gnus.xbm file:

PNG image

I would like if someone else can test it for see if there are any
issues.

Thanks.

Attachment: 0001-Stipple-support-for-MS-Windows.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]