Vector icons in SU 16

The release notes for SU16 says:

UI::Command class and UI.create_cursor were modified to accept vector format (SVG under Windows, PDF under OSX). Both toolbars and cursors can now accept vector icons.

So, if I put as set of SVG files and PDF files in an extension’s icon folder, I’m assuming SU will use the correct set based on user environment?

Or do I have to test mac vs windows when assigning Command.large_icon=

you need to test for version and platform…

mac has always accepted PDF as icons…

john

Thanks,
Ideally I could draw my vector icons in SketchUp, but it can’t export to SVG(?)
And SU > pdf puts output on an 8.5x11 page (maybe that will be ignored?)

How do you recommend creating the SVGs?

I set the SU viewport to 512 X 512 then frame the model of the icon I’m wanting and export to pdf with a line weight of 5…

I convert to SVG using a command line tool…

I also save a png…

    # to handle the new file formats for toolbar images...
    ext = '.png'
    ver = Sketchup.version.to_i
    if ver >= 16
      osx = Sketchup.platform == :platform_osx
      ext = osx ? '.pdf' : '.svg'
    end
# and at the appropriate place
 cmd.large_icon = cmd.small_icon = File.join(path, 'Resources', 'images', "#{NAME}#{ext}")

sine_circle.pdf (16.2 KB)

john

SU export to pdf has “hidden line options”. Where is "line weight of 5?
What command line tool?

I’m on a mac, line weight is an option for 2d export…

pdf2svg is a command line tool I use, but I have never tried the Windows version…

other people just use Inkscape or Illustrator…

john