From: "Elijah G." <eg642616@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, emacs-devel@gnu.org
Subject: Re: Stipples support in MS-Windows port
Date: Mon, 20 May 2024 13:44:37 -0600 [thread overview]
Message-ID: <86r0dww9ne.fsf@gmail.com> (raw)
In-Reply-To: <86r0dwag4n.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 May 2024 14:15:36 +0300")
[-- Attachment #1: Type: text/plain, Size: 990 bytes --]
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
(https://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.
[-- Attachment #2: stipple2.png --]
[-- Type: image/png, Size: 2868 bytes --]
[-- Attachment #3: Type: text/plain, Size: 1827 bytes --]
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:
[-- Attachment #4: stipple.png --]
[-- Type: image/png, Size: 9368 bytes --]
next prev parent reply other threads:[~2024-05-20 19:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 2:53 Stipples support in MS-Windows port Elijah G
2024-05-03 6:09 ` Eli Zaretskii
2024-05-03 7:30 ` Po Lu
2024-05-05 3:43 ` Elijah G
2024-05-05 4:04 ` Po Lu
2024-05-05 4:30 ` Po Lu
2024-05-06 5:17 ` Elijah G
2024-05-11 5:10 ` Elijah G
2024-05-11 5:27 ` Po Lu
2024-05-11 8:24 ` Eli Zaretskii
2024-05-12 23:06 ` Elijah G.
2024-05-14 4:07 ` Elijah G.
2024-05-14 5:28 ` Po Lu
2024-05-15 1:43 ` Elijah G.
2024-05-19 22:37 ` Elijah G.
2024-05-20 11:15 ` Eli Zaretskii
2024-05-20 11:19 ` Po Lu
2024-05-20 12:32 ` Eli Zaretskii
2024-05-20 13:12 ` Po Lu
2024-05-20 19:44 ` Elijah G. [this message]
2024-05-21 2:00 ` Elijah G.
2024-05-21 11:49 ` Eli Zaretskii
2024-05-22 2:06 ` Elijah G.
2024-05-24 1:55 ` Elijah G.
2024-05-24 6:24 ` Po Lu
2024-05-25 7:24 ` Eli Zaretskii
2024-05-25 11:30 ` Arash Esbati
2024-05-26 2:37 ` Po Lu
2024-05-27 15:32 ` Arash Esbati
2024-05-26 0:27 ` Elijah G.
2024-05-26 8:09 ` Yuri Khan
2024-05-27 2:05 ` Elijah G.
2024-05-27 6:20 ` Yuri Khan
2024-05-28 2:06 ` Elijah G.
2024-05-26 8:51 ` Eli Zaretskii
2024-05-28 0:23 ` Elijah G.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86r0dww9ne.fsf@gmail.com \
--to=eg642616@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).