texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] Improving SVG support


From: Darcy Shen
Subject: [Texmacs-dev] Improving SVG support
Date: Sat, 09 Nov 2019 01:53:57 +0800
User-agent: ZohoCN Mail

https://doc.qt.io/qt-5/qtsvg-index.html

There is a SVG module for Qt. And there are C++ libraries:

https://github.com/igagis/svgren

http://www.svgpp.org/




============ Forwarded message ============
From: Darcy Shen <address@hidden>
To: "Darcy Shen"<address@hidden>, <address@hidden>, <address@hidden>, <address@hidden>
Date: Sat, 2019-11-09 01:46:07
Subject: [bug #57193] The imported SVG/PNG images is too vague
============ Forwarded message ============

Follow-up Comment #1, bug #57193 (project texmacs):

For SVG images under TeXmacs with Qt, we use qt_image_size to determine the
size of the image.


bool
qt_image_size (url image, int& w, int& h) {// w, h in points
if (DEBUG_CONVERT) debug_convert << "qt_image_size :" <<LF;
QImage im= QImage (utf8_to_qstring (concretize (image)));
if (im.isNull ()) {
convert_error << "Cannot read image file '" << image << "'"
<< " in qt_image_size" << LF;
w= 35; h= 35;
return false;
}
else {
w= (int) rint ((((double) im.width ())*2834)/im.dotsPerMeterX());
h= (int) rint ((((double) im.height())*2834)/im.dotsPerMeterY());
if (DEBUG_CONVERT) debug_convert <<"QT dotsPerMeter: "
<<w<<" x "<<h<<LF;
return true;
}
}




But QImage will fail to work without Qt SVG support.

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?57193>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]