amake / orgro

An Org Mode file viewer for iOS and Android
https://orgro.org
GNU General Public License v3.0
452 stars 21 forks source link

Support for SVG #74

Closed luk3ya0 closed 1 year ago

luk3ya0 commented 1 year ago

What about add svg ext support for image widget? Like the org babel plotting as svg file output in emacs

luk3ya0 commented 1 year ago
Screenshot 2023-05-07 at 08 35 25
amake commented 1 year ago

Do I understand correctly that the verbatim content of the RESULTS block is actually [[file:./images/radial-tree.svg]] (like if you were to view it in fundamental-mode)?

If so, then I can add rendering support for SVG but the ability of Orgro to access the file will be dependent on all of the stuff listed here.

luk3ya0 commented 1 year ago

yep, the output is actually a OrgFileLink, but without file protocol

luk3ya0 commented 1 year ago

IMG_0927

I try to get some points to approach, but svg image in flutter isn't mature as the binary ones.

amake commented 1 year ago

This will be available shortly for testing. Look for v1.28.1

amake commented 1 year ago

@luk3ya0 I see you have some effort in your code to manipulate the size of the SVG image with FittedBox. That didn't seem necessary to me, but please let me know if the current sizing behavior needs improvement.

luk3ya0 commented 1 year ago

I think it maybe useful to wrapped with FittedBox while the svg file coming from article documentclass (latex) with redundant white spaces, or outputted from inkscape with complicated path transformation. In that circumstance, the svg display fullfill the screen height.

amake commented 1 year ago

I think it will be hard to come up with a single strategy that gives good results in all cases. If there is a specific case where things need improvement, please open a new ticket with the specifics.

luk3ya0 commented 1 year ago

ok, thanks for adding the improvement