Jump to content

style attribute in tagged text


daustin777

Recommended Posts

I've always placed all my style info into the <p> tag (or alternate tag) via a rule per the Tag Reference Guide, although I have noticed that the guide mentions the use of styles (like CSS?) which I have never figured out how to implement...
Link to comment
Share on other sites

Named paragraph styles are exported from QuarkXPress and InDesign. They can also be modified using the DIF Control API in FusionPro Server jobs. This dictionary of paragraph styles is not directly accessible in FusionPro Desktop, except via <p> tags to invoke the styles as noted.
Link to comment
Share on other sites

  • 2 years later...

How do I do this today? I have Indesign CS5. there is no export styles feature. I am using FusionPro 8 and I need to format text in cells. The cell on the far left will be left justified - the one on the far right will be right justified - the rest will be center justified.

 

The top row will have different leading than the second row.

Can this be done?

Thanks

Link to comment
Share on other sites

Hi mgalligar. I'll answer the second part of your question first, because, while named styles do indeed work, that's not what you need to accomplish what you're trying to do with the table.

I am using FusionPro 8 and I need to format text in cells. The cell on the far left will be left justified - the one on the far right will be right justified - the rest will be center justified.

This can all be done with the JavaScript table API. For example:

for (var r = 0; r < table.Rows.length; r++)
{
   table.Rows[r].Cells[0].HAlign = "Left";
   table.Rows[r].Cells[1].HAlign = "Center";
   table.Rows[r].Cells[table.Columns.length - 1].HAlign = "Right";
}

If you're building the <table> tags manually and not using the table API, then you can prefix each cell's content with a tag such as <p br=false quad=L>, <p br=false quad=C>, or <p br=false quad=R> to align the text in the cell.

The top row will have different leading than the second row.

Can this be done?

Sure. The table API doesn't directly handle this, but all you need to do is prefix the content in the first cell of each row with a tag to specify the leading, something like this:

table.Rows[0].Cells[0].Content = '<p br=false leading=200>' + table.Rows[0].Cells[0].Content;
table.Rows[1].Cells[0].Content = '<p br=false leading=auto>' + table.Rows[1].Cells[0].Content;

Okay, now to talk about named styles specifically:

How do I do this today? I have Indesign CS5. there is no export styles feature.

Every InDesign and QuarkXPress document has a dictionary of named paragraph styles. These are all exported to FusionPro, although they're not made available in the Text Editor dialog, so you can only invoke them via tags. If you export the InDesign document to FusionPro, and then export the Format (DIF) file, you will see all the named styles under the <parastyledict> section.

 

For instance, in the Frodo Travel tutorial, the DIF file contains several named paragraph styles, such as "Normal", "Party", and "besmart", which all come from the original QuarkXPress document (Tut01.qxd). Any of these can be accessed with a <p> tag like in a rule like this:

return '<p style="besmart">Here is some text';

However, you very rarely would need to do this. You can fully control every aspect of the text with tagging, without using named styles. For instance, you can specify <p br=false quad=R> to right-align text, or <f name="Times New Roman"> to change the font. Most of these tags work in tables as well. The Tags Reference Guide has all the information you need.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...