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: Mon, 20 May 2024 13:44:37 -0600
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> 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.

PNG image

That is not done yet, currently setting the bitmap as shown below from
the documentation is done and works well:

  Alternatively, the value can specify the bitmap directly, with a list of
  the form (width height data). Here, width and height specify the size in
  pixels, and data is a string containing the raw bits of the bitmap, row
  by row. Each row occupies (width + 7) / 8 consecutive bytes in the
  string (which should be a unibyte string for best results). This means
  that each row always occupies at least one whole byte.


>> 2. I had to use `w32_create_pixmap_from_bitmap_data` for make it usable,
>>    but it is defined before `image_create_bitmap_from_data`, i had to
>>    copy its code for use it, Is there a problem move that function
>>    before `image_create_bitmap_from_data` ?
>
> I don't understand the problem: in C there's no requirement to have a
> function defined before it is used.  All you need is its prototype to
> be defined before the first use.

It's now solved, thank you, i forgot that it is possible in C.

>> 3. The bitmap created using the copied code have colors inverted,
>>    I fixed it setting text color to background color and bg to fg color,
>>    I'm not sure how w32_create_pixmap_from_bitmap_data works, as far as
>>    i could see it does some operations to the memory, something that i
>>    don't think i can help so much.
>> 
>> After fixing 1 (and maybe 2), I will only need to format the code (and
>> maybe rename XFillRectangle function) for send the final patch here.
>> 
>> I'm attaching the work done if you all want to test it.
>
> Maybe I'm missing something, but where is the stipple in the attached
> image?

The stipples are the color lines.

In case there are any doubt, here is another image showing another 2
stipples with whitespace-mode turned-on:

PNG image


reply via email to

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