From 235053c6cbc4f16ca3b04e043c31488875465e97 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Fri, 23 Feb 2024 23:52:02 +0800 Subject: [PATCH] [38_7] SVG: prefer the scm converter --- .../progs/texmacs/menus/preferences-widgets.scm | 16 +--------------- TeXmacs/tests/tm/38_7.tm | 14 +++++++++++--- src/System/Files/image_files.cpp | 4 +--- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/TeXmacs/progs/texmacs/menus/preferences-widgets.scm b/TeXmacs/progs/texmacs/menus/preferences-widgets.scm index 7802388541..c3843b57b6 100644 --- a/TeXmacs/progs/texmacs/menus/preferences-widgets.scm +++ b/TeXmacs/progs/texmacs/menus/preferences-widgets.scm @@ -584,8 +584,6 @@ (eval `(define-preference-names "texmacs->image:format" ,@valid-image-format-list)) (cadr (apply map list valid-image-format-list)))) -(define (supports-inkscape?) (url-exists-in-path? "inkscape")) - (tm-widget (image-preferences-widget) ====== (bold (text "TeXmacs -> Image")) @@ -600,19 +598,7 @@ (enum (set-pretty-preference "texmacs->image:format" answer) (pretty-format-list) (get-pretty-preference "texmacs->image:format") - "8em"))) - ====== ====== - (bold (text "Image -> TeXmacs")) - === - (aligned - (meti - (when (supports-inkscape?) - (hlist // (text "Use Inkscape for conversion from SVG"))) - (when (supports-inkscape?) - (toggle (set-boolean-preference - "image->texmacs:svg-prefer-inkscape" answer) - (get-boolean-preference - "image->texmacs:svg-prefer-inkscape")))))) + "8em")))) ;; All converters ---------- diff --git a/TeXmacs/tests/tm/38_7.tm b/TeXmacs/tests/tm/38_7.tm index 5c2a1d5b78..40c75a3320 100644 --- a/TeXmacs/tests/tm/38_7.tm +++ b/TeXmacs/tests/tm/38_7.tm @@ -3,6 +3,12 @@ > <\body> + small svg: + + + + big svg: + @@ -62,9 +68,7 @@ <\references> <\collection> > - > - > - > + > @@ -74,6 +78,10 @@ |math-font-series||1rsvg-convert Binary Plugin > |.>>>>|> + + |math-font-series||2inkscape + Binary Plugin> |.>>>>|> + \ No newline at end of file diff --git a/src/System/Files/image_files.cpp b/src/System/Files/image_files.cpp index 294c490454..e199711214 100644 --- a/src/System/Files/image_files.cpp +++ b/src/System/Files/image_files.cpp @@ -433,9 +433,7 @@ image_to_pdf (url image, url pdf, int w_pt, int h_pt, int dpi) { if (DEBUG_CONVERT) debug_convert << "image_to_pdf ... "; string s= suffix (image); // First try to preserve "vectorialness" - if ((s == "svg") && !wrap_qt_supports (image) && - call_scm_converter (image, pdf)) - return; + if ((s == "svg") && call_scm_converter (image, pdf)) return; #ifdef USE_PLUGIN_GS if (gs_supports (image)) { if (DEBUG_CONVERT) debug_convert << " using gs " << LF;