Visio Guy

Visio Discussions => Visio 2016 Issues => Topic started by: sunnyimran on April 25, 2020, 06:40:37 PM

Title: how to list fonts used in my VSDX?
Post by: sunnyimran on April 25, 2020, 06:40:37 PM
Hi there,

I have a visio drawing containing 32 pages. there are a few textboxes and rectangle shapes with text. some of those rectangle are used to display barcode.

Q. Is there a ways to get a list of all fonts used in my VSDX drawing. fonts relating to textboxes and shapes that contain text ?

regards
Title: Re: how to list fonts used in my VSDX?
Post by: sunnyimran on April 26, 2020, 12:06:21 PM
OK I got it the hard way.

I opened my VSDX file as XML and beneath hierarchy I found Page..XML files. each represents the page on vsdx. This file have entries for all drawing objects used in that page including its font name

I aggregated a complete list of fonts by finding and filtering "fonts" word in each XML

that's the way I did it !!
Title: Re: how to list fonts used in my VSDX?
Post by: Surrogate on April 26, 2020, 04:33:02 PM
I did not opened xml for find fonts in vsdx-document. There used font's named stored as font IDs or font names?

In other thread (http://visguy.com/vgforum/index.php?topic=8927.msg40462;topicseen#msg40462) you can find my post. Where i write how font stored in ShapeSheet.
Title: Re: how to list fonts used in my VSDX?
Post by: sunnyimran on April 26, 2020, 07:26:21 PM
There is a lot of stuff buried in XML.
I found my required font info by searching/filtering and lot of manual work observing the XML

shape-sheet is obvious way when working inside visio (Main app is executing) while XML can be observed without even touching visio App.

you are right each registered font has an ID that is registered by OS and becomes part of system enumeration entity means any app can call a font by that ID. But I think font ID will be different on different PC/different OS. I am sort of sure on this but not yet confirmed.

I am attaching a portion of XML that's how a shape is represented in XML of a Visio page. There is a lot of stuff above this portion and a lot more below this portion. but searching for keyword 'font' returned similar portions

Please have a look at attachment 

Actually I was looking for a VBA script module that will go through all shapes in all pages of current drawing and then list out the fonts that are in use in this drawing. anyways at the moment I got it inside XML. Some other time I will try to getting it through VBA script.
Title: Re: how to list fonts used in my VSDX?
Post by: Nikolay on April 26, 2020, 10:26:07 PM
As an idea to get the list of fonts:

- Save your Visio file to PDF.
- Open the PDF with Adobe Reader, go to Properties => Fonts. This should show you all fonts used in the drawing.