how does theme1.xml work?

D

David Thielen

Hi;

Ok, I've read through all the Open XML docs and they say that the theme is
applied first for styles - but no where does it say how you find the
theme1.xml file or the named scheme in it.

I created a simple docx file (Hello World) and I see what is happening, but
not how to get it.

1) Where does it reference that the theme file is word\theme\theme1.xml? It
is listed in [Content_Types].xml and has a reference ID in
word\_rels\document.xml.rels but nowhere else does anything make use of that
reference id or filename? Do I assume there is only 1 theme file in
[Content_Types].xml?

2) In theme1.xml it has <a:fontScheme name='Office'> - I assume that there
can be multiple themes and the default or applied one is set by name. Where
do I find the name for the theme applied to the document?

3) In styles.xml it has "<w:rFonts w:asciiTheme="minorHAnsi"
w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi"
w:cstheme="minorBidi"/>" under <w:rPrDefault><w:rPr> so I assume this is the
font to use if no font is specified. Then in theme1.xml it has "<a:minorFont>
<a:latin typeface="Calibri"/>". Does minorHAnsi map to minor/latin? If so,
what are all the mappings?

Is there somewhere where this is all documented?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Hello Dave,
1) Where does it reference that the theme file is word\theme\theme1.xml? It
is listed in [Content_Types].xml and has a reference ID in
word\_rels\document.xml.rels but nowhere else does anything make use of that
reference id or filename? Do I assume there is only 1 theme file in
[Content_Types].xml?

According to "Office Open XML Part 1 - Fundamentals.pdf", Page 132, Section
14.2.7 Theme Part:
(http://www.ecma-international.org/news/TC45_current_work/Office Open XM
L%20Part%201%20-%20Fundamentals.pdf)

"A WordprocessingML or Spreadsheet ML package shall contain *zero or one*
Theme part, which shall be the target of an *implicit* relationship in a
Main Document or Workbook part".

Therefore, there can be only one theme applied to the current Word document
at a time, which is defined by the Content Type:
application/vnd.openxmlformats-officedocument.theme+xml. Microsoft Word
automatically loads the theme according to its value when a document is
opened.
2) In theme1.xml it has <a:fontScheme name='Office'> - I assume that there
can be multiple themes and the default or applied one is set by name. Where
do I find the name for the theme applied to the document?

A new theme for fonts can be created by following the steps below:
a. create a new Word 2007 document.
b. switch to "Page Layout" ribbon, and in the tab "Themes", click the
"Fonts" and choose "Create New Theme Fonts¡­".
c. name the theme as "Custom 1" and specify the heading font, body font,
etc in the "Create New Theme Fonts" dialog.
d. save and close the dialog
e. apply the new theme font to the document.
At this time, you may find that the attribute 'name' of <a:fontScheme is
set to be the newly created theme "Custom 1" in the theme1.xml:
3) In styles.xml it has "<w:rFonts w:asciiTheme="minorHAnsi"
w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi"
w:cstheme="minorBidi"/>" under <w:rPrDefault><w:rPr> so I assume this is the
font to use if no font is specified. Then in theme1.xml it has
<a:latin typeface="Calibri"/>". Does minorHAnsi map to minor/latin? If so,
what are all the mappings?

The description of rFonts in styles.xml is located in "Office Open XML Part
4", Page 201, Section 2.3.2.24; and a:minorFont of Theme is illustrated in
Page 3422, Section 5.1.5.3.7.
The mapping of minorHAnsi can be found in Page 1833, Section 2.18.103
ST_Theme (Theme Font). For instance, minorHAnsi specifies that the current
font is a reference to the
minor theme font for the High ANSI range.

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

Ok, I understand how to pull in the theme file - it's the only one.

I still don't understand how <a:latin typeface="Calibri"/> is used. I see
how it can be set and is a listed element. But how does the theme use it as
elsewhere it is always ascii oh hAnsi?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Jialiang Ge said:
Hello Dave,
1) Where does it reference that the theme file is word\theme\theme1.xml? It
is listed in [Content_Types].xml and has a reference ID in
word\_rels\document.xml.rels but nowhere else does anything make use of that
reference id or filename? Do I assume there is only 1 theme file in
[Content_Types].xml?

According to "Office Open XML Part 1 - Fundamentals.pdf", Page 132, Section
14.2.7 Theme Part:
(http://www.ecma-international.org/news/TC45_current_work/Office Open XM
L%20Part%201%20-%20Fundamentals.pdf)

"A WordprocessingML or Spreadsheet ML package shall contain *zero or one*
Theme part, which shall be the target of an *implicit* relationship in a
Main Document or Workbook part".

Therefore, there can be only one theme applied to the current Word document
at a time, which is defined by the Content Type:
application/vnd.openxmlformats-officedocument.theme+xml. Microsoft Word
automatically loads the theme according to its value when a document is
opened.
2) In theme1.xml it has <a:fontScheme name='Office'> - I assume that there
can be multiple themes and the default or applied one is set by name. Where
do I find the name for the theme applied to the document?

A new theme for fonts can be created by following the steps below:
a. create a new Word 2007 document.
b. switch to "Page Layout" ribbon, and in the tab "Themes", click the
"Fonts" and choose "Create New Theme Fonts¡­".
c. name the theme as "Custom 1" and specify the heading font, body font,
etc in the "Create New Theme Fonts" dialog.
d. save and close the dialog
e. apply the new theme font to the document.
At this time, you may find that the attribute 'name' of <a:fontScheme is
set to be the newly created theme "Custom 1" in the theme1.xml:
3) In styles.xml it has "<w:rFonts w:asciiTheme="minorHAnsi"
w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi"
w:cstheme="minorBidi"/>" under <w:rPrDefault><w:rPr> so I assume this is the
font to use if no font is specified. Then in theme1.xml it has
<a:latin typeface="Calibri"/>". Does minorHAnsi map to minor/latin? If so,
what are all the mappings?

The description of rFonts in styles.xml is located in "Office Open XML Part
4", Page 201, Section 2.3.2.24; and a:minorFont of Theme is illustrated in
Page 3422, Section 5.1.5.3.7.
The mapping of minorHAnsi can be found in Page 1833, Section 2.18.103
ST_Theme (Theme Font). For instance, minorHAnsi specifies that the current
font is a reference to the
minor theme font for the High ANSI range.

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hi Dave,

If you need further assistance, feel free to let me know. I will be more
than happy to be of assistance.

Have a great day!

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave,

Hansi (High ANSI) is a internal reference for fonts from the theme that are
intended to be in the Latin slot.
Each character in Word has six font slots (ASCII, Latin, Complex Script,
East Asia, Symbol, and Math) though only three of them are exposed in the
UI (Latin, Complex Script, and East Asia). To see the font slots in the UI,
enable a CS language (Hebrew, Arabic, Thai, or one of the languages that
require Uniscribe to render) and an East Asian language (CHT, CHS, JPN, or
KOR). The ASCII slot/font reference is for back when we used code pages. A
complete theme file defines a variety of fonts for each of the three slots.
Word use the primary language enabled in the CS and EA groups to pick the
font to use from those sets. For Latin, Word always uses the default Latin
theme font.

Hope that helps.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave,

I am consulting Word Xml development team for this issue, and I will be
back to you as soon as possible. Sorry for the delayed reponse, but the
relationship of fonts in Word is indeed complex. Thank you for your
patience.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello Dave,

Thank you for your patience. A member from WordXML development team helped
to confirm that latin also means the combination of ascii and h-ansi.
Actually, ASCII is a subset of high ANSI.

If you have any other concern or need anything else, please feel free to
let me know.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top