On Fri, May 3, 2024 at 1:30 AM Po Lu wrote: > > The closest thing i got was using w32_draw_rectangle > > inside w32_draw_glyph_string_background > > but for some reason it freezes and crashes after evaling > > the snippet, I'm not sure if it is related to the way I did it or is > > anything related to GC. > > You appear to fundamentally misunderstand the nature of stipples and > which component bears the burden of its implementation. A stipple > pattern is a repeating bitmap pattern that replaces the solid background > color of a face, in which pattern "on" pixels are tinted the foreground > color of the face, and off pixels the background, and whose repetition > is such that its tiles (instances of its bitmap) extend from a > conceptual "origin" defined by the position of the drawable. In X, > stipples are natively supported by graphics primitives, being simply > properties of the GC (graphics context), to wit, the fill style, the > stipple bitmap, and the tile/stipple origin offset, which three > properties are direct determinants of the imagery produced by > polygon-filling or stroking operations, and are configured some time > before x_draw_glyph_string_background is invoked, relieving the latter > of all responsibility, with respect to stipples, but enabling the > prepared stipple pattern when appropriate. This is the reason that the > disabled code in the related W32 function is no more than a few calls to > XDrawRectangle, but as the supporting infrastructure, both in Emacs and > the display server, is not present on MS Windows, enabling just this > code, even if it does not crash, serves little purpose. Thank you for explain me, I was a little confused in how stipples works. > Your task is not to uncomment this handful of lines, but to establish > how best to express these X concepts in terms of primitives available on > MS Windows, and implement them in a manner appropriate for _Windows_, > without regard to the specifics of the X implementation. Thanks, as far as i understood then should not i touch or even edit those lines? I was thinking in define them (since them are only available in X) inside the same file, similar in how pgtkterm.c or androidterm.c does, i think i should check again `image_create_bitmap_from_data' and `prepare_face_for_display' definitions. > > Below this mail can you get the patch for test it > > (Also i'm sorry if the patch is too long i accidentally > > formatted it with clang-format) > > I suggest reverting the portions of the patch that are the work of > clang-format, as we cannot accept such drastic whitespace changes, and > the substantive changes simply vanish in their midst. Thank you, i've reverted the changes done by clang-format, reviewing the test that i made i got notice it works a bit similar to `box' property and not to a stipple, but anyways i'm sending it here if it can be useful. > > Also can i ask what is the purpose of this line? > > ``` > > # include "bitmaps/gray.xbm" > > ``` > > It includes the bitmap image, bitmap/gray.xbm, which is a C header > defining an array and several parameters. This is not relevant on > Windows. Thank you for the help, I wasn't familiar with X.org stuffs (since I'm in Windows and most of them are not available) and with C (specially in a big project such as emacs). But I have faith that I can help in this.