ksqsf / emacsmoe

Emacs with Moe Visual Effects!
http://www.gnu.org/software/emacs/
GNU General Public License v3.0
12 stars 1 forks source link

Text shadows #1

Open ksqsf opened 4 years ago

ksqsf commented 4 years ago

This PR implements the EmacsMoe proposal Text shadows.

ksqsf commented 1 year ago

Finally resolved the performance issue on Linux! It's now as snappy as the Mac version. Excited!

The OpenCV code is kept because it provides consistent performance. I probably need to figure out a way to always enable vectorization optimizations for xcairo.c.

(If you come across this and would like to test it, please note that the current HEAD only supports pgtk. This will be fixed soon.) Done

ksqsf commented 1 year ago

The support for PGTK, X11, and NS now seems in good shape. Maybe need a bit more testing. The text extents problem is known, but I don't know how to fix it properly. I'll need to ask emacs-devel some day. (I guess redisplay needs to be changed?)

To workaround this issue:

  1. NEVER enable shadow for default, and especially avoid using it on the mode line or any place where a small amount of text is frequently updated, like a counter.
  2. DISABLE blink-cursor-mode.

Some (maybe) interesting ideas:

  1. Emphasize mutable variables in Rust (integrate with LSP semantic highlighting)
  2. Emphasize the current symbol (integrate with symbol-overlay)
  3. Emphasize Org/Markdown headlines

And less interesting ones: emphasize keywords, etc.

(Here, by "emphasize" I mean add shadow.)

I guess Haiku could be supported as well (it uses the same font drive), but I don't think I'll bother.

The radius calculation is still inconsistent. But it should be easy to fix by changing the sigma factor.

Some show-offs: (Black on White looks underwhelming. People seem to prefer the "neon" effects, ie. White on Black. Maybe :shadow is a misnomer?)

PGTK (Wayland)

image

X11 (GTK3)

image

MacOS

Coding EmacsMoe using EmacsMoe :)

image