I am working on a Visio project where the client wants to be able to configure the font used in each document. These documents have many custom masters, but the user can add there own annotations too. Therefore, I needed to find a way to synchronise the fonts used in both cases. Visio has Themes and Variants, and some of these built-in settings use different fonts, but there is no way of editing the fonts used in each theme since Office 2010 ( see Create a custom theme). There have been many questions on the web about changing the default font used in Visio, which is currently Calibri, but there were no easy answers found. Visio used to use Styles rather than Themes, and these capabilities are still there, but the buttons are not displayed in the default ribbon. However, the Drawing Explorer window does show the Styles and their hierarchies.
In the slideshow above, the four shapes on the left have the No Style, Theme, Normal and None styles applied from bottom to top. The right-hand shape is just a freshly drawn rectangle. Applying different themes changes the appearance and font.
The Drawing Explorer window reveals how the styles are based on other styles, but you cannot see that Theme is actually based on No Style until you use the right-mouse menu option Define Styles… which opens a dialog. Here you can see that a style can include Text, Line or Fill settings. however I merely want to change the default font for the document, so the Text button opens a dialog where that can be changed.
The default formula in most cells in the ShapeSheet for these sections is =ThemeVal(), and this means that the value will be inherited from the active Design/Theme. If the Char.Font formula is replaced with just an equals sign then the value is inherited from the Theme style. Therefore, changing the values here will mean that the document version of the Theme style is customised, and the same desired font will be applied, whichever Design/Theme is applied.
One remaining issue is that a user may wish to revert to using the default font value set in the the Theme style, rather than one applied within the UI. This requires the formula in the Char.Font cell to be set to either =ThemeVal(), if the Design/Theme is required, or just =, once more. This can be done by re-applying the Theme style to a shape using the Style or Text Style buttons that can be added back into your customised ribbon.
The fourth 34 of the Visio ShapeSheet functions that start with the letters L through to N are visually described in the Visio document below that is available for download. Please see the general introduction to this series at ShapeSheet Functions A-Z for more information. (more…)
Back in 2012, my fellow Visio MVPs, Scott Helmers and Chris Roth, and I recorded a series of 24 videos about Visio 2010. They were first hosted on Microsoft’s web site, then they put them up on YouTube, they they got deleted :-(. Well, we have managed to retrieve them, and put them back up…
The third 26 of the Visio ShapeSheet functions that start with the letters G through to K are visually described in the Visio document below that is available for download. Please see the general introduction to this series at ShapeSheet Functions A-Z for more information. (more…)
… that is the question! I have known for some time that it is safer to copy and paste code from the web into Notepad or similar, before copying and pasting that into my own code. It is not only new line characters that can be different but also the double-quotes. I recently noticed this…
Developing a Visio solution usually involves both .Net code and Visio ShapeSheet formulas. Good practice dictates that the source code is saved into a code repository, such as Git, where changes can be committed and commented. Visual Studio 2019 now includes native Git support, and can be linked to Azure DevOps easily. The code can…
The second 32 of the Visio ShapeSheet functions that start with the letters D through to F are visually described in the Visio document below that is available for download. Please see the general introduction to this series at ShapeSheet Functions A-Z for more information. (more…)