Ask Your Question
0

how to change default color and font for graphical objects in calc [closed]

asked 2014-01-21 13:23:13 +0100

ROSt52 gravatar image

updated 2014-01-22 00:44:39 +0100

oweng gravatar image

In the default template for Calc, the graphical objects like rectangles, ovals, etc have a lighter blue as default color and Liberation Serif 12 as the default font.

How can I change the color and the font in such objects that the change remains in the template?

Searching the AskLibO and the help wiki did not bring up any information.

Any hint is appreciated!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-18 17:36:57.911736

1 Answer

Sort by » oldest newest most voted
1

answered 2014-01-22 00:42:32 +0100

oweng gravatar image

I do not believe this is currently possible, as Calc only supports Cell and Page styles (not Graphics styles as Draw / Impress do). In basic terms the Graphics category of styles would need to be added to Calc in order for a template to be able to store this information.

The default line / area colour for graphics and the font for paragraph text in a graphic do appear to be stored as a style, however as changes are only possible on a per-object basis these are stored as direct formatting. For example, the graphic object and related paragraph information for a basic rectangle with some text in it:

<draw:rect draw:z-index="0" draw:style-name="gr1" draw:text-style-name="P1" svg:width="4.983cm" svg:height="2.603cm" svg:x="4.571cm" svg:y="1.941cm">
    <text:p text:style-name="P1">text</text:p>
</draw:rect>

... has corresponding default entries in content.xml:

<style:style style:name="gr1" style:family="graphic">
    <style:graphic-properties draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle"/>
</style:style>
<style:style style:name="P1" style:family="paragraph">
    <style:paragraph-properties fo:text-align="center"/>
</style:style>

These definitions do not store the default attributes such as colour and font, which appear instead to come from the corresponding family style definition in styles.xml:

<style:default-style style:family="graphic">
    <style:graphic-properties svg:stroke-color="#3465af" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm"/>
    <style:paragraph-properties style:text-autospace="ideograph-alpha" style:punctuation-wrap="simple" style:line-break="strict" style:writing-mode="page" style:font-independent-line-spacing="false">
        <style:tab-stops/>
    </style:paragraph-properties>
    <style:text-properties style:use-window-font-color="true" fo:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable" fo:font-size="12pt" fo:language="en" fo:country="AU" style:letter-kerning="true" style:font-name-asian="Segoe UI" style:font-size-asian="24pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Tahoma" style:font-size-complex="24pt" style:language-complex="hi" style:country-complex="IN"/>
</style:default-style>

In this instance the default line colour is #3465af, the default area colour is #729fcf, and the default font is Times New Roman. The only method available in Calc to change these attributes is via direct formatting. Changing the line / area colour results in the corresponding gr1 entry in content.xml being amended to reflect the colour changes and a new gr2 entry being created to again point to the default style. Conversely changing the font results in a new P2 entry created in content.xml to reflect ... (more)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-01-21 13:23:13 +0100

Seen: 1,528 times

Last updated: Jan 22 '14