Translation5:Character Style Range Elements

From IDMLWiki

Jump to: navigation, search

Contents

CharacterStyleRangeエレメント

エレメントとしてのCharacterStyleRangeプロパティは、Textプロパティと共通です。「10.4.6 共通のTextプロパティ」を参照してください。<CharacterStyleRang>プロパティは、下記の表に示すユニークなエレメントを含むこともできます。

表103 ChacterStyleRangeエレメント
名前 必須 説明
Content string <CharacterStyleRange>のコンテンツ。文字列か、インラインエレメントへの参照

下記は、「A」、「B」、「C」の3文字をストーリーに含む例です。真ん中の文字だけに、他と少し違うフォーマットをします。(フォントスタイル「イタリック」を適用)よって、その文字だけが違うCharacterStyleRangeです。ストーリーには<ParagraphStyleRange>エレメント1つと、<CharacterStyleRange>エレメント3つのみがあります。

IDMLの例45 ParagraphStyleRangeとCharcterStyleRange
  1. <Story Self="ucb" AppliedTOCStyle=" n" TrackChanges=" false" StoryTitle="$ ID/" AppliedNamedGrid=" n">
  2.   <StoryPreference Self="ucbStoryPreference1" OpticalMarginAlignment=" false" OpticalMarginSize=" 12" FrameType=" TextFrameType" StoryOrientation=" Horizontal" StoryDirection=" LeftToRightDirection"/>
  3.   <ParagraphStyleRange AppliedParagraphStyle= "ParagraphStyle\ kNormalParagraphStyle">
  4.     <CharacterStyleRange AppliedCharacterStyle= "CharacterStyle\ k[No character style]">
  5.       <Content>A</Content>
  6.     </CharacterStyleRange>
  7.     <CharacterStyleRange AppliedCharacterStyle= "CharacterStyle\ k[No character style]" FontStyle=" Italic">
  8.       <Content>B</Content>
  9.     </CharacterStyleRange>
  10.     <CharacterStyleRange AppliedCharacterStyle= "CharacterStyle\ k[No character style]">
  11.       <Content>C</Content>
  12.     </CharacterStyleRange>
  13.   </ParagraphStyleRange>
  14. </Story>
図31 複数の文字フォーマットのある最小のストーリー

Image:Fig030.png

複数の段落を1つの<PargraphStyleRange>で表すことができます。下記は1つの<ParagraphStyleRange>内で、1つの<CharacterStyleRange>を、<br/>エレメントを使って複数の<Content>エレメントに分けている例です。空の<br/>エレメントは段落改行を表します。このエレメントのオプションの属性で、他の分割文字を指定できます。この例では、最小の<Story>エレメントを省略しています。

IDMLの例46 CharacterStyleRange内の段落改行
  1. <ParagraphStyleRange AppliedParagraphStyle=" ParagraphStyle\ NormalParagraphStyle">
  2.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]">
  3.     <Content>ABC</Content>
  4.     <br/>
  5.     <Content>DEF</Content>
  6.     <br/>
  7.     <Content>GHI</Content>
  8.   </CharacterStyleRange>
  9. </ParagraphStyleRange>
図32 <Content>エレメントを<br/>エレメントで分割する

Image:Fig031.png

下記は、<CharacterRange>エレメントで特別な「分割文字」を使う例です。3番目の段落(「GHI」)の後に改段を挿入し、4番目の段落(「JKL」)を次の段組またはテキストフレームに送ります。分割文字は<CharacterStyleRange>エレメントの属性として適用されます。<CharacterStyleRange>エレメントの<Content>エレメントには<br/>エレメントだけがあります。

<br/>エレメントの持つ意味は、<CharacterStyleRange>エレメントのGoToNextX属性で決められます。この属性の値はAnywhere(デフォルト。省略可)、NextColumn、NextFrame、NextPage、NextOddPageまたはNextEvenPageです。

IDMLの例47 ParagraphStyleRangeエレメントと改段
  1. <ParagraphStyleRange AppliedParagraphStyle=" ParagraphStyle\ NormalParagraphStyle">
  2.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]">
  3.     <Content>ABC</Content>
  4.     <br/>
  5.     <Content>DEF</Content>
  6.     <br/>
  7.     <Content>GHI</Content>
  8.   </CharacterStyleRange>
  9.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]" GotoNextX=" NextColumn">
  10.     <br/>
  11.   </CharacterStyleRange>
  12.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]">
  13.     <Content>JKL</Content>
  14.   </CharacterStyleRange>
  15. </ParagraphStyleRange>
図33 改段

Image:Fig032.png

Note:通常は、改段または改ページは、段落スタイルプロパティ(<ParagraphStyle>エレメントのStartParagraph属性)を使って行ったほうがよいでしょう。

下記は複数の<PargraphStyleRange>エレメントの例です。2番目の段落(「DEF」)には「Heading」という段落スタイルが適用され、最初の段落(「ABC」)および3番目の段落(「GHI」)と違うフォーマットが適用されています。

IDMLの例48 複数のParagraphStyleRangeエレメント
  1. <ParagraphStyleRange AppliedParagraphStyle=" ParagraphStyle\ NormalParagraphStyle">
  2.   <CharacterStyleRange AppliedCharacterStyle= "CharacterStyle\[ No character style]">
  3.     <Content>ABC</Content>
  4.     <br/>
  5.   </CharacterStyleRange>
  6.   </ParagraphStyleRange>
  7. <ParagraphStyleRange AppliedParagraphStyle=" ParagraphStyle\ Heading">
  8.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]">
  9.     <Content>DEF</Content>
  10.     <br/>
  11.   </CharacterStyleRange>
  12. </ParagraphStyleRange>
  13. <ParagraphStyleRange AppliedParagraphStyle=" ParagraphStyle\ NormalParagraphStyle">
  14.   <CharacterStyleRange AppliedCharacterStyle=" CharacterStyle\[ No character style]">
  15.     <Content>GHI</Content>
  16.   </CharacterStyleRange>
  17. </ParagraphStyleRange>
図34 複数の<ParagraphStyleRange>エレメントのある最小のストーリー

Image:Fig033.png

IDMLの例49 複数の段組をまたぐ段落(段抜き)(IDML 7.0)
  1. <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/ NormalParagraphStyle" SpaceAfter="12" SpanColumnType="SpanColumns">
  2.   <Properties>
  3.     <SpanSplitColumnCount type="short">2</SpanSplitColumnCount>
  4.   </Properties>
  5.   <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]" FontStyle="Bold Condensed" PointSize="20">
  6.     <Properties>
  7.       <Leading type="unit">24</Leading>
  8.       <AppliedFont type="string">Myriad Pro</AppliedFont>
  9.     </Properties>
  10.     <Content>Multi-Column Headline</Content>
  11.     <Br/>
  12.   </CharacterStyleRange>
  13. </ParagraphStyleRange>
  14. <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/ NormalParagraphStyle">
  15.   <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
  16.     <Properties>
  17.       <Leading type="unit">12</Leading>
  18.     </Properties>
  19.     <Content>Ris curenat, quament. Besuam inatus nimum imorterra tam inum sid senimum med C. Scivis a re, noverraverce iae elinterei ca pre hil consupicae dica; noc, seniamdit. As cres ac ta invo, Palis rei si propost quit publicauro visses cur us, senaritimmor quam deesilis addum se nulem hiculi prae, caelicae ta, nos consum nem auconvo, molis hos co poensuludem et di poeris satquam mo</Content>
  20.   </CharacterStyleRange>
  21. </ParagraphStyleRange>
図35 段抜き

Image:Fig35bver7.png