[Cuis-dev] SVG Icons

Juan Vuletich JuanVuletich at zoho.com
Fri Dec 3 10:16:42 PST 2021


On 12/3/2021 6:29 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> I just received a new set of SVG icons for DrGeo. I am exploring how I 
> should use it with DrGeo UI. Should I import as SVG files or 
> preconvert it as PNG files?
>
> I attached a sample of the icon and it looks like bellow. The red 
> background shows how the drawing is centered.
>
> For now I am exploring the former options with your SVG package. When 
> I open it with Cuis, it looks like its attributes in the SVG element 
> are not honored:
>
> <svg
>     xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
>     xmlns:dc="http://purl.org/dc/elements/1.1/"
>     xmlns:cc="http://creativecommons.org/ns#"
>     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>     xmlns:svg="http://www.w3.org/2000/svg"
>     xmlns="http://www.w3.org/2000/svg"
>     xmlns:xlink="http://www.w3.org/1999/xlink"
>     id="svg5"
>     version="1.1"
>     viewBox="0 0 12.506998 12.507"
>     height="47.27055"
>     width="47.270542">
>
> Indeed it looks very tiny in Cuis and when scaled up, the bounding box 
> is not square as it should be. It could be problematic when doing the 
> layout in GUI. I could help myself using the center of the icons but 
> it will be better for the general interest these attributes be honored 
> though. I may be completely off as I am exploring the topic. So fell 
> free to correct me.
>
> Thanks
>
> Hilaire
>
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu

Hi Hilaire,

Using PNG (as you know) means no scaling, handling renders at different 
sizes by hand, etc. It is much better to stick to vector graphics.

The current SVG morphs may be a bit slow, as they hold the whole 
structure of the SVG file in a tree of submorphs. For the window control 
buttons, I made faster custom versions that also use less memory. See 
for example #drawMenuIcon especially in AbstractVectorCanvas. If you 
don't find performance to be a problem, maybe using SVG is OK.

WRT the the height and width attributes, yes, we'd honor them. I won't 
be able to dig into that for the next few days, though.

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211203/8e338d9c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 1200 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211203/8e338d9c/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 31939 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211203/8e338d9c/attachment-0003.png>


More information about the Cuis-dev mailing list