From: Tassilo Horn <tsdh@gnu.org>
To: Morgan Willcock <morgan@ice9.digital>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback)
Date: Sat, 21 Sep 2024 19:35:33 +0200 [thread overview]
Message-ID: <87msk0oqoq.fsf@gnu.org> (raw)
In-Reply-To: <87ldzlgxvh.fsf@ice9.digital> (Morgan Willcock's message of "Sat, 21 Sep 2024 10:27:30 +0100")
Morgan Willcock <morgan@ice9.digital> writes:
>>> I think it is rendering the text and the background of the document
>>> in the same colour.
>>
>> In that case, you may wish to customize the new face
>> doc-view-svg-face.
>
> It seems to be the currently active theme which determines whether the
> the document is readable or not.
The value of the foreground and background doc-view-svg-face properties
are passed as :foreground / :background values to create-image when
inserting the SVG into the buffer. Their docs are here (info "(elisp)
SVG Images").
--8<---------------cut here---------------start------------->8---
SVG (Scalable Vector Graphics) is an XML format for specifying images.
SVG images support the following additional image descriptor properties:
‘:foreground FOREGROUND’
FOREGROUND, if non-‘nil’, should be a string specifying a color,
which is used as the image's foreground color. If the value is
‘nil’, it defaults to the current face's foreground color.
‘:background BACKGROUND’
BACKGROUND, if non-‘nil’, should be a string specifying a color,
which is used as the image's background color if the image supports
transparency. If the value is ‘nil’, it defaults to the current
face's background color.
--8<---------------cut here---------------end--------------->8---
Since doc-view-svg-face inherits from the default theme, in theory the
SVG should be adjusted acording to your theme.
> If the SVG rendering is enabled (when available) by default, does this
> mean that it is the user's responsibility to set usable default
> colours? Or should the theme be setting usable default colours?
The latter. If the theme sets the default face sensibly (which it
surely does), then your PDFs should look the same. Well, and that's
true for "normal" PDF documents (black on white, e.g., academic papers)
but somehow fails for "fancy" documents.
I don't know how the :foreground/:background SVG image properties work
but it looks to me as if :background works well every time but
:foreground doesn't as soon as the text is not black. I suspect the
heuristic is something like: if it's transparent, it's the background,
and if it's either black or white, it's the foreground.
>> What do other applications, like a browser, show for the produced SVG
>> file? Is it possible that your version of mpdf produces bad SVG
>> images?
>
> I couldn't find any installed utility by that name,
Its mupdf or mudraw.
> but using image-save in the DocView buffer suggests that the actual
> conversion to SVG doesn't have any problems. It seems to be purely an
> issue with how the SVG image is displayed in the buffer.
You can find the generated SVG files easily using M-x
doc-view-dired-cache RET which opens a dired buffer in the temporary
directory where doc-view stores the files.
Bye,
Tassilo
next prev parent reply other threads:[~2024-09-21 17:35 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 17:53 No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback) Morgan Willcock
2024-09-20 18:53 ` Eli Zaretskii
2024-09-20 19:34 ` Visuwesh
2024-09-20 19:39 ` Morgan Willcock
2024-09-20 22:29 ` chad
2024-09-20 22:46 ` Morgan Willcock
2024-09-21 8:09 ` Eli Zaretskii
2024-09-21 9:27 ` Morgan Willcock
2024-09-21 17:35 ` Tassilo Horn [this message]
2024-09-22 20:57 ` Morgan Willcock
2024-09-23 6:44 ` Tassilo Horn
2024-09-23 8:34 ` Manuel Giraud via Emacs development discussions.
2024-09-23 8:45 ` Tassilo Horn
2024-09-23 11:34 ` Manuel Giraud via Emacs development discussions.
2024-09-23 11:56 ` Eli Zaretskii
2024-09-23 14:51 ` Tassilo Horn
2024-09-23 15:35 ` Eli Zaretskii
2024-09-23 15:50 ` Morgan Willcock
2024-09-23 16:10 ` Tassilo Horn
2024-09-23 16:27 ` Eli Zaretskii
2024-09-23 16:54 ` Tassilo Horn
2024-09-24 11:17 ` Eli Zaretskii
2024-09-24 11:22 ` Tassilo Horn
2024-09-23 17:56 ` Manuel Giraud via Emacs development discussions.
2024-09-23 18:35 ` Tassilo Horn
2024-09-23 19:06 ` Manuel Giraud via Emacs development discussions.
2024-09-23 9:36 ` Visuwesh
2024-09-23 11:55 ` Eli Zaretskii
2024-09-23 12:05 ` Tassilo Horn
2024-09-23 15:32 ` Eli Zaretskii
2024-09-21 7:28 ` Tassilo Horn
2024-09-21 9:27 ` Morgan Willcock
2024-09-21 11:04 ` Visuwesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msk0oqoq.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=morgan@ice9.digital \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).