all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Visuwesh <visuweshm@gmail.com>
To: Morgan Willcock <morgan@ice9.digital>
Cc: Tassilo Horn <tsdh@gnu.org>,  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 16:34:17 +0530	[thread overview]
Message-ID: <87bk0hfetq.fsf@gmail.com> (raw)
In-Reply-To: <87h6a9gxvf.fsf@ice9.digital> (Morgan Willcock's message of "Sat,  21 Sep 2024 10:27:32 +0100")

[சனி செப்டம்பர் 21, 2024] Morgan Willcock wrote:

> Tassilo Horn <tsdh@gnu.org> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> When testing the Emacs 30 pre-release I found that all of the PDF
>>>> files which I tried to view were not readable because the text
>>>> appeared to be missing.
>>>>
>>>> Eventually I found the variable doc-view-mupdf-use-svg, and setting
>>>> it to nil reverted the rendering to the old method where the text was
>>>> visible.
>>>
>>> Why is that?  If your system supports display of SVG images, why
>>> wasn't the text readable?  Tassilo, any ideas?
>>
>> I suspect it's some sort of background-equals-foreground issue.  I think
>> by default, the SVGs have transparent background.  So when you use a
>> dark theme (I tested with the built-in modus-vivendi theme which is very
>> dark), you might get black foreground on black background.
>
> I use modus-vivendi and sometimes toggle it to modus-operandi to use the
> light version.  It does seem to be the currently active theme which
> makes the text invisible, with the dark theme making the text
> unreadable.
>
> If I load no theme then the documents are rendered normally (as far as I
> can tell).
>
>> Visuwesh already cited the cure: in emacs 29 you might want to set
>> doc-view-svg-foreground/background to white/black or vice versa (and
>> then re-convert your PDF).
>
> If I use image-save to save a copy of the SVG file, the conversion
> always appears to be usable and a good representation of the original
> document, even when what is displayed in the buffer is not.
>
> Toggling the theme between the light and dark theme while viewing the
> image in the buffer toggles it between readable and unreadable.
>
>> In emacs 30, that has been replaced with the face doc-view-svg-face
>> where you can customize foreground and background such that the contrast
>> works for you and your theme.
>>
>> Hm, but doc-view-svg-face inherits from the default face and that is
>> white-on-black with modus-vivendi, so actually it should all be good,
>> i.e., the PDF display should match your theme.  However, depending on
>> PDF I tested, I sometimes get white-on-black display (good!) and
>> sometimes darkish-on-black (bad!).
>
> Is there any way to opt-out from the theme having any effect on how the
> result is presented while still giving a usable result?

You can customise the face doc-view-svg-face to have :background "white"
and :foreground "black".

>> It seems like it works as intended for "standard black-on-white PDFs"
>> but doesn't really work when the PDF is "fancy", e.g., gray foreground
>> or colorized borders or what not...
>
> This does describe the documents I am testing with.  They all have some
> kind of coloured border.  Azure invoices use a light gray foreground
> colour with black text on it, while also using a darker gray background
> with white text on it.



      reply	other threads:[~2024-09-21 11:04 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
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 [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bk0hfetq.fsf@gmail.com \
    --to=visuweshm@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=morgan@ice9.digital \
    --cc=tsdh@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.