More about Visio document fonts

Back in 2007, I wrote an article about Visio Document fonts ( see Displaying Document Fonts ), but I did not notice the importance of the screenshot that shows the fonts with the IDs from 10 through to 20, and a few others. These fonts were not installed, and had been substituted by Calibri. So, I have now written some code, this time in C#, that lists all of the Visio document fonts, and indicates if they are installed in Windows.

I use LINQPad for a lot of these ad-hoc queries now, rather than VBA, so please visit my fellow Visio MVPS blog at Getting Started With C# in LINQPad with Visio to find out more about this.

I imported the following namespaces:

System.Drawing
System.Drawing.Text
Visio=Microsoft.Office.Interop.Visio

First, I created a simple class, DocFont:

public class DocFont
{
 public int ID { get; set;}
 public string Name { get; set;}
 public short CharSet { get; set;}
 public bool Installed { get; set;}
}

Then I created the Main():

void Main()
{
 var vApp = MyExtensions.GetRunningVisio();
 if (vApp.ActiveDocument == null) return;

 Visio.Document doc = vApp.ActiveDocument;
 if (doc == null) return;
 FontFamily[] fontFamilies;
 InstalledFontCollection installedFontCollection = new InstalledFontCollection();

 // Get the array of FontFamily objects.
 fontFamilies = installedFontCollection.Families;

 List<DocFont> fonts = new List<UserQuery.DocFont>();
 foreach (Visio.Font fnt in doc.Fonts)
 {
  fonts.Add(new DocFont() { 
   ID=fnt.ID, 
   CharSet=fnt.CharSet,
   Name=fnt.Name,
   Installed= fontFamilies.Any(f => f.Name.Equals(fnt.Name) )
   });
 }

 foreach (FontFamily fnt in fontFamilies)
 {
  if (!fonts.Any(f => f.Name.Equals(fnt.Name) == false))
     {
   fonts.Add(new DocFont()
   {
    Name = fnt.Name,
    Installed = true
   });
  }
 }

 fonts.OrderBy(f => f.Name).Dump("Visio document fonts");
}

This produces a table like this:

Visio document fonts
5IOrderedEnumerable<DocFont> (282 items)4
ID Name CharSet Installed
24 Agency FB 0 True
25 Algerian 0 True
26 Andy 0 True
21 Arial 0 True
27 Arial Black 0 True
28 Arial Narrow 0 True
29 Arial Rounded MT Bold 0 True
1 Arial Unicode MS 0 True
30 Arvo 0 True
31 Baskerville Old Face 0 True
32 Bauhaus 93 0 True
33 Bell MT 0 True
34 Berlin Sans FB 0 True
35 Berlin Sans FB Demi 0 True
36 Bernard MT Condensed 0 True
37 Blackadder ITC 0 True
38 Bodoni MT 0 True
39 Bodoni MT Black 0 True
40 Bodoni MT Condensed 0 True
41 Bodoni MT Poster Compressed 0 True
42 Book Antiqua 0 True
43 Bookman Old Style 0 True
44 Bookshelf Symbol 7 2 True
45 Bradley Hand ITC 0 True
46 Britannic Bold 0 True
47 Broadway 0 True
48 Brush Script MT 0 True
49 Buxton Sketch 0 True
4 Calibri 0 True
50 Calibri Light 0 True
51 Californian FB 0 True
52 Calisto MT 0 True
53 Cambria 0 True
54 Cambria Math 0 True
55 Candara 0 True
56 Castellar 0 True
57 Centaur 0 True
58 Century 0 True
59 Century Gothic 0 True
60 Century Schoolbook 0 True
61 Chiller 0 True
62 Colonna MT 0 True
63 Comic Sans MS 0 True
64 Consolas 0 True
65 Constantia 0 True
66 Cooper Black 0 True
67 Copperplate Gothic Bold 0 True
68 Copperplate Gothic Light 0 True
69 Corbel 0 True
20 Cordia New 0 False
70 Courier New 0 True
71 Curlz MT 0 True
72 DengXian 0 True
17 Dhenu 0 False
8 Dotum 0 False
73 Droid Serif 0 True
74 Ebrima 0 True
75 Edwardian Script ITC 0 True
76 Elephant 0 True
77 Engravers MT 0 True
78 Eras Bold ITC 0 True
79 Eras Demi ITC 0 True
80 Eras Light ITC 0 True
81 Eras Medium ITC 0 True
10 Estrangelo Edessa 0 False
82 Felix Titling 0 True
83 Footlight MT Light 0 True
84 Forte 0 True
85 Franklin Gothic Book 0 True
86 Franklin Gothic Demi 0 True
87 Franklin Gothic Demi Cond 0 True
88 Franklin Gothic Heavy 0 True
89 Franklin Gothic Medium 0 True
90 Franklin Gothic Medium Cond 0 True
91 Freestyle Script 0 True
92 French Script MT 0 True
93 Gabriola 0 True
94 Gadugi 0 True
95 Garamond 0 True
19 Gautami 0 False
96 Georgia 0 True
97 Gigi 0 True
98 Gill Sans MT 0 True
99 Gill Sans MT Condensed 0 True
100 Gill Sans MT Ext Condensed Bold 0 True
101 Gill Sans Ultra Bold 0 True
102 Gill Sans Ultra Bold Condensed 0 True
103 Gloucester MT Extra Condensed 0 True
104 Goudy Old Style 0 True
105 Goudy Stout 0 True
125 Haettenschweiler 0 True
126 Harlow Solid Italic 0 True
127 Harrington 0 True
106 HGHeiseiKakugothictaiW3 128 True
107 HGHeiseiKakugothictaiW5 128 True
108 HGHeiseiKakugothictaiW9 128 True
109 HGHeiseiMinchotaiW3 128 True
110 HGHeiseiMinchotaiW9 128 True
111 HGMinchoL 128 True
112 HGPHeiseiKakugothictaiW3 128 True
113 HGPHeiseiKakugothictaiW5 128 True
114 HGPHeiseiKakugothictaiW9 128 True
115 HGPHeiseiMinchotaiW3 128 True
116 HGPHeiseiMinchotaiW9 128 True
117 HGPMinchoL 128 True
118 HGSHeiseiKakugothictaiW3 128 True
119 HGSHeiseiKakugothictaiW5 128 True
120 HGSHeiseiKakugothictaiW9 128 True
121 HGSHeiseiMinchotaiW3 128 True
122 HGSHeiseiMinchotaiW9 128 True
123 HGSMinchoL 128 True
128 High Tower Text 0 True
124 HYSWLongFangSong 134 True
129 Impact 0 True
130 Imprint MT Shadow 0 True
131 Indie Flower 0 True
132 Informal Roman 0 True
133 Javanese Text 0 True
134 Jing Jing 0 True
135 Jokerman 0 True
136 Juice ITC 0 True
137 Kootenay 0 True
138 Kristen ITC 0 True
139 Kunstler Script 0 True
18 Latha 0 False
140 Leelawadee 0 True
141 Leelawadee UI 0 True
142 Leelawadee UI Semilight 0 True
143 Lindsey 0 True
144 Lobster 0 True
145 Lucida Bright 0 True
146 Lucida Calligraphy 0 True
147 Lucida Console 0 True
148 Lucida Fax 0 True
149 Lucida Handwriting 0 True
150 Lucida Sans 0 True
151 Lucida Sans Typewriter 0 True
152 Lucida Sans Unicode 0 True
160 Magneto 0 True
161 Maiandra GD 0 True
22 Malgun Gothic 0 True
162 Malgun Gothic Semilight 0 True
13 Mangal 0 False
163 Marlett 2 True
164 Matura MT Script Capitals 0 True
165 Microsoft Himalaya 0 True
166 Microsoft JhengHei 0 True
167 Microsoft JhengHei Light 0 True
168 Microsoft JhengHei UI 0 True
169 Microsoft JhengHei UI Light 0 True
170 Microsoft MHei 0 True
171 Microsoft NeoGothic 0 True
172 Microsoft New Tai Lue 0 True
173 Microsoft PhagsPa 0 True
174 Microsoft Sans Serif 0 True
175 Microsoft Tai Le 0 True
176 Microsoft Uighur 0 True
177 Microsoft YaHei 0 True
178 Microsoft YaHei Light 0 True
179 Microsoft YaHei UI 0 True
180 Microsoft YaHei UI Light 0 True
181 Microsoft Yi Baiti 0 True
183 MingLiU_HKSCS-ExtB 0 True
182 MingLiU-ExtB 0 True
184 Miramonte 0 True
185 Mistral 0 True
186 Modern No. 20 0 True
187 Moire 0 True
188 Moire ExtraBold 0 True
189 Moire Light 0 True
190 Mongolian Baiti 0 True
191 Monotype Corsiva 0 True
192 Motorwerk 0 True
153 MS Gothic 0 True
154 MS Outlook 2 True
7 MS PGothic 0 True
155 MS Reference Sans Serif 0 True
156 MS Reference Specialty 2 True
157 MS UI Gothic 0 True
158 MT Extra 2 True
159 MV Boli 0 True
193 Myanmar Text 0 True
195 News Gothic 0 True
196 Niagara Engraved 0 True
197 Niagara Solid 0 True
198 Nirmala UI 0 True
199 Nirmala UI Semilight 0 True
194 NSimSun 0 True
200 OCR A Extended 0 True
201 Old English Text MT 0 True
202 Onyx 0 True
203 Open Sans 0 True
205 Palace Script MT 0 True
206 Palatino Linotype 0 True
207 Papyrus 0 True
208 Parchment 0 True
209 Pericles 0 True
210 Pericles Light 0 True
211 Perpetua 0 True
212 Perpetua Titling MT 0 True
213 Pescadero 0 True
214 Playbill 0 True
6 PMingLiU 0 False
204 PMingLiU-ExtB 0 True
215 Poiret One 0 True
216 Poor Richard 0 True
217 Pristina 0 True
218 Quartz MS 0 True
16 Raavi 0 False
219 Rage Italic 0 True
220 Raleway 0 True
221 Ravie 0 True
222 Roboto 0 True
223 Roboto Condensed 0 True
224 Roboto Slab 0 True
225 Rockwell 0 True
226 Rockwell Condensed 0 True
227 Rockwell Extra Bold 0 True
229 Script MT Bold 0 True
230 Segoe Keycaps 0 True
232 Segoe Marker 0 True
231 Segoe MDL2 Assets 0 True
233 Segoe Print 0 True
234 Segoe Script 0 True
235 Segoe UI 0 True
236 Segoe UI Black 0 True
237 Segoe UI Emoji 0 True
238 Segoe UI Historic 0 True
239 Segoe UI Light 0 True
240 Segoe UI Mono 0 True
241 Segoe UI Semibold 0 True
242 Segoe UI Semilight 0 True
243 Segoe UI Symbol 0 True
244 Segoe WP 0 True
245 Segoe WP Black 0 True
246 Segoe WP Light 0 True
248 Segoe WP Semibold 0 True
247 Segoe WP SemiLight 0 True
15 Sendnya 0 False
249 Showcard Gothic 0 True
12 Shruti 0 False
5 SimSun 0 True
250 SimSun-ExtB 0 True
251 Sitka Banner 0 True
252 Sitka Display 0 True
253 Sitka Heading 0 True
254 Sitka Small 0 True
255 Sitka Subheading 0 True
256 Sitka Text 0 True
257 SketchFlow Print 0 True
258 Snap ITC 0 True
259 Stencil 0 True
228 SWGamekeys MT 2 True
282 SWMacro 0 False
9 Sylfaen 0 True
2 Symbol 2 True
260 Tahoma 0 True
261 Tempus Sans ITC 0 True
23 Times New Roman 0 True
262 Trebuchet MS 0 True
14 Tunga 0 False
263 Tw Cen MT 0 True
264 Tw Cen MT Condensed 0 True
265 Tw Cen MT Condensed Extra Bold 0 True
266 Verdana 0 True
267 Viner Hand ITC 0 True
268 Vivaldi 0 True
269 Vladimir Script 0 True
11 Vrinda 0 False
270 Wasco Sans 0 True
271 Webdings 2 True
272 Wide Latin 0 True
3 Wingdings 2 True
273 Wingdings 2 2 True
274 Wingdings 3 2 True
275 Yu Gothic 0 True
276 Yu Gothic Light 0 True
277 Yu Gothic Medium 0 True
278 Yu Gothic UI 0 True
279 Yu Gothic UI Light 0 True
280 Yu Gothic UI Semibold 0 True
281 Yu Gothic UI Semilight 0 True

By the way, I tested exporting a Visio document with all of the document fonts to SVG and PDF using Visio Pro for Office 365. They all rendered fine, apart from those fonts which are not installed in my English Windows 10.

I have asked Microsoft why Visio documents include the names of fonts that are not normally installed by Windows. I have not had an answer yet ….

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

davecra.wordpress.com/

Microsoft Office Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: