Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: peter.ring on February 02, 2018, 12:02:42 PM

Title: designing visio stencils and templates that support themes
Post by: peter.ring on February 02, 2018, 12:02:42 PM
The following is more or less a duplicate of a Microsoft Community post https://answers.microsoft.com/en-us/msoffice/forum/msoffice_visio-mso_other-mso_2016/visio-custom-theme-colors/830f694e-f2bd-4e16-bd11-88c8aac7a02f (https://answers.microsoft.com/en-us/msoffice/forum/msoffice_visio-mso_other-mso_2016/visio-custom-theme-colors/830f694e-f2bd-4e16-bd11-88c8aac7a02f):

I'd like to develop stencils and templates that adheres to the corporate styleguide for my colleagues. When developing stencils and templates, how do I make new masters themable and compatible with Microsoft supplied stencils and templates?

As far as I can tell, to do this, I need an answer to this questions:


I get confused when creating a new color theme from one of the built-in themes immediately changes Line and Fill color for document masters and shapes. Especially the way Dynamic Connector line color changes.

To reproduce:

For even more dynamic fun, try using Basic Flowchart Shapes and the Linear theme.

What is the logic behind this? Is there a predictable pattern to this?

regards
Peter Ring
Title: Re: designing visio stencils and templates that support themes
Post by: peter.ring on February 06, 2018, 09:50:47 PM
A little progress report. I'm using way too much time on this, and hopefully will save some time for other poor souls.

In addition to all the good stuff from the resident Visio gurus, I found a nice survey of the Visio file format at Library of Congress: https://www.loc.gov/preservation/digital/formats/fdd/fdd000021.shtml (https://www.loc.gov/preservation/digital/formats/fdd/fdd000021.shtml). These guys welcome comments if you have something to correct or add.

I can probably do most of what I want by editing Visio package content XML files. XML schema are very helpful when you you do this.

The various Visio XML schema are documented to some degree in various places; curiously, the most complete that I found was about the SharePoint Visio Graphics Service https://msdn.microsoft.com/en-us/library/hh645006.aspx (https://msdn.microsoft.com/en-us/library/hh645006.aspx). The namespace and targetNamespace URIs are somewhat of a mess; I'm not quite sure whether "http://schemas.microsoft.com/office/visio/2012/main" or "http://schemas.microsoft.com/office/visio/2011/1/core" are the most recent, and I can't find VisioSchema15.xsd or VisioSchema15-2012-06-05.xsd for download.

For some of the theme elements (those in the namespace http://schemas.microsoft.com/office/visio/2012/theme), I can't find a complete XML schema, only piecemeal stuff.

I still find parts of the theme schema documentation completely opaque. Even deliberately opaque; how about:

QuoteMultiformat is specified by the value of the monotone attribute of a CT_VariationClrScheme child element, specified by the VariationColorIndex Cell_Type element of a shape, of a CT_VariationClrSchemeLst child element of an ext child element as specified by the CT_OfficeArtExtension type (specified in [ISO/IEC29500-1:2011] section 20.1.2.2.14) of an extLst child element as specified by the CT_OfficeArtExtensionList type (specified in [ISO/IEC29500-1:2011] section 20.1.2.2.15) of a CT_ColorScheme type (specified in [ISO/IEC29500-1:2011] section 20.1.6.2) of a themeElements child element as specified by the CT_BaseStyles type (specified in [ISO/IEC29500-1:2011] section 20.1.6.10) of a CT_OfficeStyleSheet element in a Theme_XML_Part.

Neither "multiformat" nor "monotone" is described further anywhere AFAIK. Like absolutely nowhere else. What does "monotone" do?

And I still wonder how a theme controls connector color.

Right now, I have a lot of sympathy for a rather defensive attitude towards themes for stencil and template developers.