cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

BoldItalic

ptc-3063012
1-Newbie

BoldItalic

Hello,

In our DTD we are using <emphasis> element for font styling which has a attributed variant=bold|italic|normal|bolditalic. I modified the textstyles in the DCF file to these elements. My question is how can I made bold and italic to the attribute value bolditalic i.e., when the user click both bold and italic it should tag <emphasis variant="bolditalic">. For underline we have another attribute called underline=yes|no. So when the user want bold and underline and if he clicks both bold and underline options in ArborText the tag should be <emphasis variant="bold" underline="yes">.

Karthik

3 REPLIES 3

On Fri, Mar 5, 2010 at 10:29 AM, Karthik Kumar
<karthik.kumar@merrillcorp.com> wrote:
> In our DTD we are using <emphasis> element for font styling which has a
> attributed variant=bold|italic|normal|bolditalic. I modified the textstyles
> in the DCF file to these elements. My question is how can I made bold and
> italic to the attribute value bolditalic i.e., when the user click both bold
> and italic it should tag <emphasis variant="bolditalic">. For underline we
> have another attribute called underline=yes|no. So when the user want bold
> and underline and if he clicks both bold and underline options in ArborText
> the tag should be <emphasis variant="bold" underline="yes">.

Unfortunately, Editor has not been equipped for a tag that can do both
bold and italic at the same time, so if the user sets both properties
on some text, it's going to want to create markup like:

<emphasis variant="bold"><emphasis variant="italic">text</emphasis></emphasis>

As long as your DTD allows this and you can equip your style sheet to
do the right thing in the presence of this combination of tags (or the
reverse, with the italic tag on the outside), you should be all right.

-Brandon 🙂

Thanks Brandon - Is it possible to do something like this. I have edited the editwindow.xml and added my new icon for bolditalic. Now I want to write something underneath that that will insert <emphasis variant="bolditalic">. I understand you cannot have bold and italic together. What I need is that the <emphasis>'s variant attribute value should be "bolditalic". I have stylesheet setup to show bold and italic.

Right now I manaully insert the tag around the text and then change the attribute via modify attributes. I would like this to do via the icon similar to how we do it for bold. Is that possible.

Karthik

On Fri, Mar 5, 2010 at 1:33 PM, Karthik Kumar
<karthik.kumar@merrillcorp.com> wrote:
> Thanks Brandon - Is it possible to do something like this. I have edited the
> editwindow.xml and added my new icon for bolditalic. Now I want to write
> something underneath that that will insert <emphasis variant="bolditalic">.
> I understand you cannot have bold and italic together. What I need is that
> the <emphasis>'s variant attribute value should be "bolditalic". I have
> stylesheet setup to show bold and italic.
>
> Right now I manaully insert the tag around the text and then change the
> attribute via modify attributes. I would like this to do via the icon
> similar to how we do it for bold. Is that possible.

It's possible, but not trivial. Editor has about 1000 lines of ACL
code dedicated to making the existing bold, italic and underline
buttons work properly, including gory details like handling selections
containing table cells correctly. Unfortunately, this code does not
appear to have been designed to work with a single element that can
apply multiple styles, such as yours.

I'd still strongly suggest having your DTD allow emphasis elements to
be nested (if it doesn't already) and setting up your style sheet to
handle the various nesting cases properly (again, if it doesn't
already). Otherwise, if you really want to take on duplicating the
application toolbar functionality for a new "combined" style button,
you might be able to get ideas and useful code snippets from
packages/tools/_style.acl.

-Brandon 🙂
Top Tags