Change the font color

Post here questions and problems related to editing and publishing DITA content.
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Change the font color

Post by Le Basque »

Hi,

I want to know if there is an attribute to change the color of text without modifying the stylesheet

thank you
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Change the font color

Post by sorin_ristache »

Hi,

In what output do you want to set a text color? Is it DITA PDF output? If yes, you have to add a color attribute for the DITA element that you want to set the color. For example to set a green color for the text that comes from DITA codeblock elements you have to add the following:

Code: Select all

  <xsl:attribute name="color">rgb(0, 250, 0)</xsl:attribute>
in the attribute set with the attribute name="codeblock" in the following file, or in the customized version of the following file if you set the customization.dir parameter in your DITA PDF transformation:

Code: Select all

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\cfg\fo\attrs\pr-domain-attr.xsl

Regards,
Sorin
Post Reply