You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing this down for anyone hacking on the problem.
Use of a line-prefix with a display-property using specified space and the center can, with a bit of elbow grease on the width of text, apply an overlay to center arbitrary contents. Read the Elisp manual entry on text properties and specified space.
It's a bit hairy to write the expressions just from reading the docs. The dashboard package has both image and text examples to look at using (text-properties-at (point))
I am not sure if actions or headings or headers are most valuable to center first. Maybe we want to center the slide contents separately from the header.
A "title" slide using such centering is my most likely first application of the idea. It's possible to turn the header off, narrow the heading for a slide, center all the contents, and that is a "title" slide.
That's all hacky, but dslide is built to readily accommodate hacking anywhere that features are not baked in 🤠
The text was updated successfully, but these errors were encountered:
For proof of concept, just add an overlay. The center expression for an image or text needs to know "half of how much" to subtract, which is honestly quite lame, but that's Emacs barebones display at work.
(overlay-put o 'line-prefix (propertize""'display '(space :align-to (- center (0.5. (image :type jpeg :file"/home/psionic/.emacs.d/elpaca/repos/dslide/test/images/yuki-o-yak.jpeg":width595:max-width1200:scale1:transform-smoothingt))))))
The easy way to get the image dimensions are by calling (mapcar #'overlay-properties (overlays-at (point))) on an image already visible in the buffer. At presentation time, after turning on inline images, the display property of a link is set to a valid value that center can understand.
Writing this down for anyone hacking on the problem.
Use of a
line-prefix
with adisplay-property
using specifiedspace
and thecenter
can, with a bit of elbow grease on the width of text, apply an overlay to center arbitrary contents. Read the Elisp manual entry on text properties and specified space.It's a bit hairy to write the expressions just from reading the docs. The dashboard package has both image and text examples to look at using
(text-properties-at (point))
I am not sure if actions or headings or headers are most valuable to center first. Maybe we want to center the slide contents separately from the header.
A "title" slide using such centering is my most likely first application of the idea. It's possible to turn the header off, narrow the heading for a slide, center all the contents, and that is a "title" slide.
That's all hacky, but dslide is built to readily accommodate hacking anywhere that features are not baked in 🤠
The text was updated successfully, but these errors were encountered: