Skip to content

Commit

Permalink
Explain how to use Bidi text better (#165)
Browse files Browse the repository at this point in the history
* Add  text about direction in note under Text

* Add Bidirectional text section

Closes #163 and #164
  • Loading branch information
nigelmegitt authored Jul 27, 2023
1 parent 5412095 commit 61e5494
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,9 @@ <h4>Text</h4>
which can include or reference TTML style attributes
such as <code>tts:ruby</code> used to alter the layout or styling of
sections of text within each paragraph.
Mixed direction text, for example interleaved left to right (ltr)
and right to left (rtl) text, can be specified by using the
<code>tts:direction</code> attribute on <code>&lt;span&gt;</code> elements.
Similarly metadata can be added using attributes or <code>&lt;metadata&gt;</code> elements.</aside>
</li>
<li>The <code>style</code> attribute MAY be present.
Expand Down Expand Up @@ -1668,6 +1671,26 @@ <h4>Layout</h4>
<div class="note">Layout of the paragraphs may rely on the default TTML region (i.e. if no <code>&lt;layout&gt;</code> element is used in the <code>&lt;head&gt;</code> element) or may be explicit by the use of the <code>region</code> attribute, to refer to a <code>&lt;region&gt;</code> element present at <code>/tt/head/layout/region</code>.</div>
</section> <!-- Layout -->

<section>
<h4>Bidirectional text</h4>
<p>
The following metadata elements are permitted in DAPT and specified in [[TTML2]] as containing <code>#PCDATA</code>,
i.e. text data only with no element content.
Where bidirectional text is required within the character content within such an element,
Unicode control characters can be used to define the base direction within arbitrary ranges of text.
</p>
<ul>
<li><code>&lt;ttm:copyright&gt;</code></li>
<li><code>&lt;ttm:desc&gt;</code></li>
<li><code>&lt;ttm:item&gt;</code></li>
<li><code>&lt;ttm:name&gt;</code></li>
<li><code>&lt;ttm:title&gt;</code></li>
</ul>
<p>The content elements <code>&lt;p&gt;</code> and <code>&lt;span&gt;</code> permit the direction of text
to be specified using the <code>tts:direction</code> and <code>tts:unicodeBidi</code> attributes.
Document authors should use this more robust mechanism rather than using Unicode control characters.</p>
</section> <!-- Bidirectional text -->

</section> <!-- Profile Constraints -->

<section id="conformance"><!-- keep section id, not use h2 -->
Expand Down

0 comments on commit 61e5494

Please sign in to comment.