[ttml2] add tts:letterSpacing attribute, applied to span
authorGlenn Adams <glenn@skynav.com>
Sun, 30 Nov 2014 20:10:45 -0700
changeset 792 35ac76f0108f
parent 791 5775ee67280a
child 793 f41466373d5f
[ttml2] add tts:letterSpacing attribute, applied to span
--- a/ttml2/spec/rnc/ttml2-datatypes.rnc	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/rnc/ttml2-datatypes.rnc	Sun Nov 30 20:10:45 2014 -0700
@@ -163,6 +163,9 @@
   "" |
+TTAF.LetterSpacing.datatype =
+  string
 TTAF.LineHeight.datatype =
--- a/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/rnc/ttml2-styling-attribs.rnc	Sun Nov 30 20:10:45 2014 -0700
@@ -40,6 +40,8 @@
   = attribute tts:fontWeight { TTAF.FontWeight.datatype }?
   = attribute tts:height { TTAF.Measure.datatype }?
+  = attribute tts:letterSpacing { TTAF.LetterSpacing.datatype }?
   = attribute tts:lineHeight { TTAF.LineHeight.datatype }?
@@ -107,6 +109,7 @@
+  TTAF.letterSpacing.attrib,
--- a/ttml2/spec/ttml2-changes.html	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/ttml2-changes.html	Sun Nov 30 20:10:45 2014 -0700
@@ -91,6 +91,7 @@
+  'tts:letterSpacing,
@@ -237,6 +238,8 @@
 * In 10.2, add 'tts:height styling attribute.
+* In 10.2, add 'tts:letterSpacing styling attribute.
 * In 10.2, add 'tts:position styling attribute.
 * In 10.2, add 'tts:ruby styling attribute.
--- a/ttml2/spec/ttml2.xml	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/ttml2.xml	Sun Nov 30 20:10:45 2014 -0700
@@ -2875,6 +2875,7 @@
 <loc href="#style-attribute-fontVariantPosition">tts:fontVariantPosition</loc>,
 <loc href="#style-attribute-fontWeight">tts:fontWeight</loc>,
 <loc href="#style-attribute-height">tts:height</loc>,
+<loc href="#style-attribute-letterSpacing">tts:letterSpacing</loc>,
 <loc href="#style-attribute-lineHeight">tts:lineHeight</loc>,
 <loc href="#style-attribute-opacity">tts:opacity</loc>,
 <loc href="#style-attribute-origin">tts:origin</loc>,
@@ -7098,6 +7099,7 @@
 <item><p><specref ref="style-attribute-fontVariantPosition"/></p></item>
 <item><p><specref ref="style-attribute-fontWeight"/></p></item>
 <item><p><specref ref="style-attribute-height"/></p></item>
+<item><p><specref ref="style-attribute-letterSpacing"/></p></item>
 <item><p><specref ref="style-attribute-lineHeight"/></p></item>
 <item><p><specref ref="style-attribute-opacity"/></p></item>
 <item><p><specref ref="style-attribute-origin"/></p></item>
@@ -8800,6 +8802,93 @@
 &sect; 7.15.14, and <bibref ref="css3-box"/>, &sect; 9</p>
+<div3 id="style-attribute-letterSpacing">
+<p>The <att>tts:letterSpacing</att> attribute is used to specify a style property that
+increases or decreases the nominal distance between glyph areas.</p>
+<p>Letter spacing has no affect at the beginning or ending of a line area, and must not
+be applied to zero-width glyphs. Furthermore, letter spacing must not cause normally connected glyphs,
+e.g., as used in cursive scripts or with cursive fonts, to become disconnected.</p>
+<p>Letter spacing is applied independently from kerning and justification. Depending upon the font(s) in use,
+the script(s) being presented, and the capabilities of a presentation processor, either or both kerning and
+justification may be applied in addition to letter spacing.</p>
+<p>This attribute may be specified by any
+element type
+that permits use of attributes in the TT Style Namespace; however, this attribute applies
+as a style property only to those element types indicated in the following table.</p>
+<table id="style-property-details-letterSpacing" role="common">
+<col width="25%"/>
+<code>normal</code> |
+<loc href="#style-value-length">&lt;length&gt;</loc>
+<td><emph>Applies to:</emph></td>
+<loc href="#content-vocabulary-span"><el>span</el></loc>
+<td>see prose</td>
+<td>discrete, continuous</td>
+<p>For the purpose of determining applicability of this style property,
+each character child of a <el>p</el> element is considered to be enclosed in an anonymous
+<p>The value <code>normal</code> corresponds to specifying a <loc href="#style-value-length">&lt;length&gt;</loc> value of zero (0),
+i.e., neither expand nor compress adjacent glyph spacing.</p>
+<p>If a <loc href="#style-value-length">&lt;length&gt;</loc> value is expressed as a positive scalar (not a percentage),
+then the spaces between adjacent glyphs are expanded by an additional amount equal to that scalar value.
+If expressed as a negative scalar,
+then the spaces between adjacent glyphs are compressed by an additional amount equal to that scalar value, possibly resulting
+in overlapping glyph areas, up to a maximum amount that results in the origin of a subsequent glyph being equal to the
+origin of its preceding glyph.</p>
+<p>If a <loc href="#style-value-length">&lt;length&gt;</loc> value is expressed as a percentage, then that
+percentage is to be interpreted as relative to the value implied by <code>normal</code> letter spacing.
+Negative percentage values are not permitted.</p>
+<note role="example">
+<p>For example, a value of 100% is interpreted as equal to <code>normal</code> letter spacing, while
+50% is interpreted as half of normal letter spacing and 200% is interpreted as double normal spacing.</p>
+<p>If a computed value of the letter spacing associated with this attribute is not supported,
+then a <loc href="#terms-presentation-processor">presentation processor</loc> must use the closest supported value.</p>
+<note role="elaboration">
+<p>In this context, the phrase <emph>closest supported value</emph> means the value for which the one-dimensional Euclidean distance between
+the computed letter spacing and the supported letter spacing is minimized. If there are multiple closest supported values equally distant from
+the computed value for a given edge, then the value least distant from 0 is used.</p>
+<p>The <att>tts:letterSpacing</att> style is illustrated by the following
+<name>Letter Spacing Example</name>
+<edtext>Insert example fragment and image of tts:letterSpacing.</edtext>
+<note role="derivation">
+<p>The semantics of the style property
+represented by this attribute are based upon that defined by <bibref ref="css3-text"/>,
+&sect; 8.2.</p>
 <div3 id="style-attribute-lineHeight">
 <p>The <att>tts:lineHeight</att> attribute is used to specify a style property that
@@ -18744,6 +18833,10 @@
 W3C Editor's Draft.
 (See <xspecref href="http://dev.w3.org/csswg/css-ruby-1/">http://dev.w3.org/csswg/css-ruby-1/</xspecref>.)
+<bibl id="css3-text" key="CSS Text">Elika Etamad (aka fantasai) and Koji Ishii,
+<titleref href="http://dev.w3.org/csswg/css-text-3/">CSS Text Module Level 3</titleref>, W3C Editor's Draft. (See
+<xspecref href="http://dev.w3.org/csswg/css-text-3/">http://dev.w3.org/csswg/css-text-3/</xspecref>.)
 <bibl id="css3-wm" key="CSS Writing Modes">Elika Etamad and Koji Ishii,
 <titleref href="http://dev.w3.org/csswg/css-writing-modes-3/">CSS Writing Modes Level 3</titleref>, W3C Editor's Draft. (See
 <xspecref href="http://dev.w3.org/csswg/css-writing-modes-3/">http://dev.w3.org/csswg/css-writing-modes-3/</xspecref>.)
--- a/ttml2/spec/xsd/ttml2-datatypes.xsd	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/xsd/ttml2-datatypes.xsd	Sun Nov 30 20:10:45 2014 -0700
@@ -293,6 +293,12 @@
     <xs:restriction base="xs:string"/>
+  <xs:simpleType name="letterSpacing">
+    <xs:annotation>
+      <xs:documentation>normal | length</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
   <xs:simpleType name="lineHeight">
       <xs:documentation>normal | length</xs:documentation>
--- a/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Sun Nov 30 19:22:34 2014 -0700
+++ b/ttml2/spec/xsd/ttml2-styling-attribs.xsd	Sun Nov 30 20:10:45 2014 -0700
@@ -21,6 +21,7 @@
   <xs:attribute name="fontVariantPosition" type="ttd:fontVariantPosition"/>
   <xs:attribute name="fontWeight" type="ttd:fontWeight"/>
   <xs:attribute name="height" type="ttd:measure"/>
+  <xs:attribute name="letterSpacing" type="ttd:letterSpacing"/>
   <xs:attribute name="lineHeight" type="ttd:lineHeight"/>
   <xs:attribute name="opacity" type="ttd:opacity"/>
   <xs:attribute name="origin" type="ttd:origin"/>
@@ -59,6 +60,7 @@
     <xs:attribute ref="tts:fontVariantPosition"/>
     <xs:attribute ref="tts:fontWeight"/>
     <xs:attribute ref="tts:height"/>
+    <xs:attribute ref="tts:letterSpacing"/>
     <xs:attribute ref="tts:lineHeight"/>
     <xs:attribute ref="tts:opacity"/>
     <xs:attribute ref="tts:origin"/>