Translation:Character Style Range Elements

From IDMLWiki

Jump to: navigation, search

Contents

CharacterStyleRangeエレメント

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

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

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

IDMLの例38 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>
図30 複数の文字フォーマットのある最小のストーリー

Image:Fig030.png

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

IDMLの例39 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>
図31 <Content>エレメントを<br/>エレメントで分割する

Image:Fig031.png

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

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

IDMLの例40 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>
図32 改段

Image:Fig032.png

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

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

IDMLの例41 複数の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>
図33 複数の<ParagraphStyleRange>エレメントのある最小のストーリー

Image:Fig033.png

Personal tools