Posts

Showing posts from June, 2024

Text along a path (GNU Emacs)

Image
  SVG 2 specifications allows flowing text along a curve via textPath element. This opens up possibilities for cool text effects e.g. Formula Editor in GNU Emacs . GNU Emacs uses librsvg for SVG rendering on GNU/Linux. This fix for librsvg was  available in 2014 [4]. But this wasn't applied for some reason. Librsvg has moved to Rust since then. The code below is pre-Rust version of librsvg. sample.svg <?xml version="1.0" encoding="UTF-8"?> <svg height="300" width="800" xmlns="http://www.w3.org/2000/svg"      xmlns:xlink="http://www.w3.org/1999/xlink">     <path id="my_path1" d="M 50 100 Q 25 10 180 100 T 350 100 T 520 100 T 690 100" fill="transparent" />     <text>         <textPath xlink:href ="#my_path1" font-size="34"> Text along a path looks awesome!!         </textPath>     </text> </svg> ...

Context Menu is Personal (GNU Emacs)

Image
  Define custom menu based on your preferences. Note the definition of visibility conditions ( :visible keyword) and sub-menu ( More ). They are helpful in reducing the clutter. (Note: There are some placeholders in the code below.) (easy-menu-define my-menu global-map "My context menu"   '("Context Menu"     ["Cut"   kill-region :visible (region-active-p)]     ;; ["Copy"  kill-ring-save t] ;; Menu copies by default for further action     ["Paste" yank :visible (not (region-active-p))]     ["Open    " org-open-at-point t]     ["Calculate    " calc-grab-region t]     ["Execute    " (lambda () (interactive)             (shell-command-on-region (region-beginning) (region-end) "sh")) t]     ["Search Web" (lambda () (interactive) (eww (car kill-ring))) t]     ...