TobiasZawada / preview-dvisvgm

Generate SVG images for `preview-latex`
GNU General Public License v3.0
8 stars 2 forks source link

Setting font color #2

Open dozed opened 7 months ago

dozed commented 7 months ago

This is how preview-dvisgm currently renders latex math:

image

How can I change the font color? Changing "Preview Reference Face" does not seem to have an effect.

dozed commented 6 months ago

Some findings: it seems the SVG overlay inherits the foreground color of the first character.

Example:

Pasted image

This can be fixed by setting a :foreground your-color attribute on the overlay:

(overlay-put ov
         'display
         (list 'image
           :type imagetype
           :text text
           :file image
           :ascent 'center
           :pointer 'hand
           :foreground "#bbc2cf"
           :scale 0.33))))

This results in all fragments having the same foreground color:

image