<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tei-c.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lou</id>
	<title>TEIWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tei-c.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lou"/>
	<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Special:Contributions/Lou"/>
	<updated>2026-04-18T19:19:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=TEI_manuscript_catalogues&amp;diff=15945</id>
		<title>TEI manuscript catalogues</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=TEI_manuscript_catalogues&amp;diff=15945"/>
		<updated>2017-10-15T13:38:03Z</updated>

		<summary type="html">&lt;p&gt;Lou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a location to record manuscript catalogues which use TEI as a source, preservation, or output format. Please feel free to add any others that you know of -- Perhaps inserting them alphabetically by name?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Digital Averroes Research Environment (DARE)&lt;br /&gt;
* '''URL:''' http://dare.uni-koeln.de/&lt;br /&gt;
* '''Is TEI Available?''' Yes&lt;br /&gt;
* '''Description of Catalogue/Project:''' The Digital Averroes Research Environment (DARE) collects and edits the works of the Andalusian Philosopher Averroes or Abū l-Walīd Muḥammad Ibn Aḥmad Ibn Rušd, born in Cordoba in 1126, died in Marrakesh in 1198. DARE makes accessible online digital editions of Averroes's works, and images of all textual witnesses, including manuscripts, incunabula, and early prints. Averroes's writings and the scholarly literature are documented in a bibliographical database.&lt;br /&gt;
* '''Notes on use of TEI:''' Bibliographically and structurally, the content of the digital library of Averroes works will be described on the basis of the established standard OAI/PMH and the texts are to be encoded in XML in accordance to the guidelines of the Text Encoding Initiative (TEI P5).&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' FIHRIST &lt;br /&gt;
* '''URL:''' http://www.fihrist.org.uk/&lt;br /&gt;
* '''Is TEI Available?''' Yes -- TEI XML download of individual manuscript descriptions&lt;br /&gt;
* '''Description of Catalogue/Project:''' The FIHRIST catalogue provides a searchable interface to TEI XML manuscript descriptions from some of the major manuscript collections in the UK. With the continuing contribution of manuscript records from UK libraries, Fihrist aims to become a union catalogue for manuscripts in Arabic script. Partners include: Bodleian Library - University of Oxford, British Library, Cambridge University Library, The Islamic Manuscript Association, The Royal Asiatic Society of Great Britain and Ireland, SOAS - University of London, University of Birmingham, The John Rylands University Library - University of Manchester, Wellcome Library. See http://www.fihrist.org.uk/about for more information.&lt;br /&gt;
* '''Notes on use of TEI:''' The FIHRIST Schema was a customisation for Islamic manuscripts based on the [http://code.google.com/p/tei-enrich/ ENRICH TEI ODD customisation for western manuscript description] created for the [http://enrich.manuscriptorium.com/ ENRICH project].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Guide to Medieval and Renaissance Manuscripts in the Huntington Library (2003)&lt;br /&gt;
* '''URL:''' http://bancroft.berkeley.edu/digitalscriptorium/huntington/toc.html&lt;br /&gt;
* '''Is TEI Available?''' No&lt;br /&gt;
* '''Description of Catalogue/Project:''' This static web segment translates the two-volume printed ''Guide'' to TEI-XML and thence to HTML. There is a simple search facility; users are encouraged also to consult the indexes of authors, scribes, artists, places, dates, and titles, which have been converted from print and linked. Since the project doesn't say: it was led by Consuelo Dutschke, with encoding and best-practices contributions by Sharon Goetz and XSL rendering by Liz Shaw.&lt;br /&gt;
* '''Notes on use of TEI:''' HEHweb uses a customization of TEI P4 based upon MASTER and TEIMMSS drafts and discussions that were not yet final. Its use of &amp;amp;lt;msDesc&amp;amp;gt; and child elements follows the 1989 printed Huntington catalogue and is a recognizable early cousin of the P5 msDesc module.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Name:''' Manuscriptorium&lt;br /&gt;
* '''URL:''' http://www.manuscriptorium.com&lt;br /&gt;
* '''Is TEI Available?''' Yes&lt;br /&gt;
* '''Description of Catalogue/Project:'''... creating a virtual research environment providing access to all existing digital documents in the sphere of historic book resources (manuscripts, incunabula, early printed books, maps, charters and other types of documents). These historical resources, otherwise scattered in various digital libraries around the world, are now available under a single digital library interface.&lt;br /&gt;
* '''Notes on use of TEI:''' Uses the TEI P5 Enrich customization with some additional local constraints.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Register of Early Modern Slovenian Manuscripts&lt;br /&gt;
* '''URL:''' http://ezb.ijs.si/nrss/&lt;br /&gt;
* '''Is TEI Available?''' Yes &lt;br /&gt;
* '''Description of Catalogue/Project:''' The web portal presents Slovenian manuscripts from the Baroque and Enlightenment periods. The on-line Register in open access comprises manuscript descriptions of the first 100 manuscripts, researched so far, and 7.000+ digital images. The system, based on Fedora Commons, enables browsing the manuscript descriptions and associated facsimiles, as well as complex searches over structured data, including taxonomies of text types and social contexts (monastic, diocesan, civil etc.) in which the manuscripts came into existence. Even as work in progress, the repository demonstrates the variety and longevity of manuscript culture in early modern period and its important role in Slovenian literature. &lt;br /&gt;
* '''Notes on use of TEI:''' No modifications.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Saramusik&lt;br /&gt;
* '''URL:''' http://www.saramusik.org&lt;br /&gt;
* '''Is TEI Available?''' No&lt;br /&gt;
* '''Description of Catalogue/Project: ''' SARAMusiK is an arabic catalogue project of known arabic manuscripts on Music. It is based on different paper catalogues. This catalogue is extented to include a critical edition of the texts.&lt;br /&gt;
* '''Notes on use of TEI:''' The main data is filled using a php/mysql database. The body text of the critical edition is stored using the TEI format. All output is in a TEI format.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Syriaca.org &lt;br /&gt;
* '''Project Status:''' In development &lt;br /&gt;
* '''URL:''' http://www.syriaca.org/&lt;br /&gt;
* '''URL:''' https://github.com/srophe/manuscripts/&lt;br /&gt;
* '''Is TEI Available?''' Yes -- TEI XML download of the whole repository on [https://github.com/srophe/manuscripts/ github].&lt;br /&gt;
* '''Description of Catalogue/Project:''' Syriaca.org is currently in active development. We aim to provide TEI records for Syriac manuscripts and also to serialize our data through RDF using the RDF crosswalks of [http://mesa.performantsoftware.com/ The Medieval Electronic Scholarly Alliance]. Our project is intentionally modeled after the very successul FIHRIST catalogue. We plan to eventually provide a similar searchable interface to TEI XML manuscript descriptions for multiple Syriac holdings at institutions around the world. We are currently actively cataloging the Syriac holdings of the British Library (using Wright's catalogue) and the holdings of American institutions (based on Clemons' checklist).&lt;br /&gt;
* '''Notes on use of TEI:''' The Syriaca.org Schema is a customization for Syriac manuscripts based on the [http://www.fihrist.org.uk/ Fihrist Schema], which was itself a customization of [http://code.google.com/p/tei-enrich/ ENRICH TEI ODD customisation for western manuscript description] created for the [http://enrich.manuscriptorium.com/ ENRICH project].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Manuscript database of the Herzog August Bibliothek Wolfenbüttel&lt;br /&gt;
* '''URL:''' http://diglib.hab.de/?db=mss&lt;br /&gt;
* '''Is TEI Available?''' yes&lt;br /&gt;
* '''Description of Catalogue/Project:''' Basically it shall have descriptions of '''all''' manuscripts of the HAB.&lt;br /&gt;
* '''Notes on use of TEI:''' The mssDB differentiates between a socalled Signaturdokument (roughly: Shelfmark file) and catalogue(s). The Shelfmark file represents the manuscript itself, containing the most important bits of information on the ms only, &amp;lt;facsimile&amp;gt; and references to descriptions. The descriptions are representations of a (usually printed) catalogue in electronic form thus preserving the historical form and information of that very catalogue entry. We use an ODD based upon the ENRICH ODD, taking it further e.g. by offering value lists on several attributes. The ODD is available at http://diglib.hab.de/rules/schema/ER/v0.4/europeana-regia.xml&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' e-codices - Virtual Manuscript Library of Switzerland&lt;br /&gt;
* '''URL:''' http://www.e-codices.unifr.ch&lt;br /&gt;
* '''Is TEI Available?''' yes&lt;br /&gt;
* '''Description of Catalogue/Project:''' The goal of e-codices is to provide access to all medieval and selected early modern manuscripts of Switzerland via a virtual library. It contains almost 1000 mss from 42 institutions.&lt;br /&gt;
* '''Notes on use of TEI:''' &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:''' Beta maṣāḥǝft: Manuscripts of Ethiopia and Eritrea&lt;br /&gt;
* '''Project Status:''' in development&lt;br /&gt;
* '''URL:''' &lt;br /&gt;
* '''Is TEI Available?''' Yes -- TEI XML download of the whole repository on [https://github.com/BetaMasaheft/Manuscripts github]&lt;br /&gt;
* '''Description of Catalogue/Project:''' The project Beta maṣāḥǝft: Manuscripts of Ethiopia and Eritrea (Schriftkultur des christlichen Äthiopiens: eine multimediale Forschungsumgebung) is a long-term project funded within the framework of the Academies' Programme (coordinated by the Union of the German Academies of Sciences and Humanities) under survey of the Akademie der Wissenschaften in Hamburg. The funding will be provided for 25 years, from 2016–2040. The project is hosted by the Hiob Ludolf Centre for Ethiopian Studies at the University of Hamburg. It aims at creating a virtual research environment that shall manage complex data related to predominantly Christian manuscript tradition of the Ethiopian and Eritrean Highlands.&lt;br /&gt;
* '''Notes on use of TEI:''' [https://github.com/BetaMasaheft/Documentation/wiki/guidelines Project Guidelines Documentation]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Cut and Paste this template to add your own, but leave a copy of it at the bottom for others. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
* '''Name:'''&lt;br /&gt;
* '''Project Status:''' (e.g. completed, ongoing, in development, no longer actively maintained, etc). &lt;br /&gt;
* '''URL:''' &lt;br /&gt;
* '''Is TEI Available?''' &lt;br /&gt;
* '''Description of Catalogue/Project:''' &lt;br /&gt;
* '''Notes on use of TEI:''' &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:SIG:Manuscripts]]&lt;br /&gt;
[[category:Markup]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15914</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15914"/>
		<updated>2017-10-02T19:33:41Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
==  &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved in response to the needs of the TEI community, both as the core specification language for the TEI guidelines, and also as a generic customization language. Since 2004, much&lt;br /&gt;
effort has been put into making it less of a hybrid language, combining its own vocabulary with RelaxNG fragments and Schematron rules. Versions of TEI P5 later than 2.5 contain elements which can be used to express content models directly in the TEI ODD language, rather than in RELAXNG.  ODD is thus an entirely self-contained generic specification language, independent&lt;br /&gt;
of other existing grammars, and hence known as Pure ODD.  The proposals for Pure ODD were included in the Guidelines during January 2016, and are included as part of the 3.0.0 release&lt;br /&gt;
&lt;br /&gt;
If your existing TEI schema was developed prior to this release, you should probably read up on [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]]   Not updated since 2012&lt;br /&gt;
*[[ODD chaining]]  Not updated since 2012&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoGenerate.html How to Make an ODD Automagically]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoChain.html ODD chaining for Beginners]&lt;br /&gt;
* [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD] (from a pre 3.0 version)&lt;br /&gt;
* [http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
* [[Mapping ODD processing]]&lt;br /&gt;
&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15913</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15913"/>
		<updated>2017-10-02T19:32:33Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
==  &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved in response to the needs of the TEI community, both as the core specification language for the TEI guidelines, and also as a generic customization language. Since 2004, much&lt;br /&gt;
effort has been put into making it less of a hybrid language, combining its own vocabulary with RelaxNG fragments and Schematron rules. Versions of TEI P5 later than 2.5 contain elements which can be used to express content models directly in the TEI ODD language, rather than in RELAXNG.  ODD is thus an entirely self-contained generic specification language, independent&lt;br /&gt;
of other existing grammars, and hence known as Pure ODD.  The proposals for Pure ODD were included in the Guidelines during January 2016, and are included as part of the 3.0.0 release&lt;br /&gt;
&lt;br /&gt;
If your existing TEI schema was developed prior to this release, you should probably read up on [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]  Not updated since 2012]&lt;br /&gt;
*[[ODD chaining] Not updated since 2012]&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoGenerate.html How to Make an ODD Automagically]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoChain.html ODD chaining for Beginners]&lt;br /&gt;
* [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD] (from a pre 3.0 version)&lt;br /&gt;
* [http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
* [[Mapping ODD processing]]&lt;br /&gt;
&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD-dev&amp;diff=15912</id>
		<title>ODD-dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD-dev&amp;diff=15912"/>
		<updated>2017-10-02T19:29:08Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Problems which do not seem amenable to ODD as it stands and need a new version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Suggestions]]&lt;br /&gt;
[[Category:Customization]]&lt;br /&gt;
&lt;br /&gt;
This page has been set up to record underlying problems with the TEI [[ODD]] language and look at methods for improving them.&lt;br /&gt;
&lt;br /&gt;
== Areas of concern for [[ODD-Dev-meetingDH2012]] ==&lt;br /&gt;
&lt;br /&gt;
The following areas of concern were collated by Sebastian Rahtz for discussion at the DH2012 ODD meeting:&lt;br /&gt;
&lt;br /&gt;
=== Areas of ODD2 which are not expressive enough but which can be fixed without a new paradigm===&lt;br /&gt;
* Module inter-dependency (if you ask for module X, also bring in module Y)&lt;br /&gt;
* Bertrand's model classes questions&lt;br /&gt;
&lt;br /&gt;
=== Areas of ODD2 which are not well-enough defined ===&lt;br /&gt;
* the processing model. what order are things worked on?&lt;br /&gt;
* there is no defined test suite for an ODD processor&lt;br /&gt;
* is the DTD/RELAXNG/XSD output defined or can a processor choose different methods?&lt;br /&gt;
* what documentation generation options are supported? how to document customizations&lt;br /&gt;
&lt;br /&gt;
=== ODD-processing which is unimplemented at present ===&lt;br /&gt;
* Chaining of ODDs (a customization of a customization)&lt;br /&gt;
* Per-element attribute-based customisation at source (specialized @type on div)&lt;br /&gt;
* Supporting multiple customizations of the same element (in different areas)&lt;br /&gt;
* Declaring an attribute class and then customizing it straightaway&lt;br /&gt;
* Generating XSD natively&lt;br /&gt;
&lt;br /&gt;
=== Problems which do not seem amenable to ODD as it stands and need a new version ===&lt;br /&gt;
* Durand Conundrum: Express content models as native TEI? : DONE&lt;br /&gt;
* Subclasses (element &amp;lt;foo&amp;gt; has a simpler content model if its in the header)&lt;br /&gt;
* Attribute/content interdependency (if &amp;lt;foo&amp;gt;, then attribute @y must be used)&lt;br /&gt;
* Alternation of attribute/element (either child &amp;lt;y&amp;gt; or attribute @y)&lt;br /&gt;
* Expressing XPath-based constraints (Schematron) in a  TEI language with embedded documentation&lt;br /&gt;
* Short-cut content models based entirely on model classes (&amp;lt;classes&amp;gt;&amp;lt;containerOf key=&amp;quot;model.foo&amp;quot;/&amp;gt;&amp;lt;/classes&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Other problems / earlier discussions ==&lt;br /&gt;
=== Problem: Module inter-dependency ===&lt;br /&gt;
* '''Desc:''' In some cases elements in one TEI module (A) require that another TEI module (B) is loaded because the content models of an element in A directly requires something that is defined in B (e.g. a class or element) but no method exists indicate this module inter-dependency.  This sort of dependency can, of course, happen inside a single module as well with a content model explicitly referring to a particular element which is then removed.  Some concept of dependency of references needs to be implemented.&lt;br /&gt;
* '''Suggested solutions:'''  &lt;br /&gt;
This is largely mitigated by ensuring that content models reference model classes rather than explicit elements. A further prosecution of class warfare might therefore be useful.&lt;br /&gt;
* '''Points for discussion:'''&lt;br /&gt;
** None so far&lt;br /&gt;
&lt;br /&gt;
=== Problem: Subclasses ===&lt;br /&gt;
* '''Desc:''' The ability to add subclass membership to an element to, for example, grant it some extra attributes in a particular location. e.g. “I want the head inside figure to be the real &amp;lt;tt&amp;gt;&amp;amp;lt;tei:head&amp;gt;&amp;lt;/tt&amp;gt; element but have it be a member of &amp;lt;tt&amp;gt;att.mySpecialAttributes&amp;lt;/tt&amp;gt; to give it some extra attributes, but only when it is inside &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt;”. This may also relate to Per-element attribute-based customisation in specific circumstances mentioned below.&lt;br /&gt;
* '''Suggested solutions:''' none so far&lt;br /&gt;
* '''Points for discussion:'''&lt;br /&gt;
# I ([[User:Syd|Syd]]) am under the impression that the problem cannot occur exactly as described. If you add attributes to the &amp;lt;tt&amp;gt;&amp;amp;lt;head&amp;gt;&amp;lt;/tt&amp;gt; element (whether directly or by adding it to the class &amp;lt;tt&amp;gt;att.mySpecialAttributes&amp;lt;/tt&amp;gt;), it will not validate against &amp;lt;tt&amp;gt;tei_all&amp;lt;/tt&amp;gt;, and has to be placed in another namespace. I.e., it ''cannot'' be &amp;lt;tt&amp;gt;&amp;amp;lt;tei:head&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
***# '''Reply:''' Perhaps poorly phrased in the description. How about we reverse it: let's say you want to remove @n from &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt; globally, but then allow it back when inside &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt;.  Obviously you can test that with schematron, but not (I think) simply by adding &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt; to a new attribute class.  [[User:James|James]] 10:23, 1 September 2009 (EDT)&lt;br /&gt;
&lt;br /&gt;
# That said, the desire to have special attributes on &amp;lt;tt&amp;gt;&amp;amp;lt;my:head&amp;gt;&amp;lt;/tt&amp;gt; when it is a child of &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt; and not otherwise is a very reasonable one.&lt;br /&gt;
# RELAX NG permits co-occurrence constraints like this, but ODD and DTDs do not. W3C Schema 1.0 does not. Rumor has it that XSD 1.1 will, but I haven't looked carefully.&lt;br /&gt;
# As it stands it would be very reasonable to add the attributes to &amp;lt;tt&amp;gt;&amp;amp;lt;my:head&amp;gt;&amp;lt;/tt&amp;gt; in the ODD tagdoc, and then add a “don't use these attributes unless a child of &amp;lt;tt&amp;gt;&amp;amp;lt;figure&amp;gt;&amp;lt;/tt&amp;gt;” as a &amp;lt;tt&amp;gt;&amp;amp;lt;constraintSpec&amp;gt;&amp;lt;/tt&amp;gt;, i.e., in Schematron.&lt;br /&gt;
&lt;br /&gt;
It seems to me that this is very much in schematron country, because of the element content/context dependency.&lt;br /&gt;
&lt;br /&gt;
=== Problem: Per-element attribute-based customisation ===&lt;br /&gt;
* '''Desc:''' The ability to customise the desc, valList, and other aspects of an attribute inherited from a class on a per-element basis.  For example giving different suggested values for @type on an element, or a more specific description of an attribute when used on a certain element.&lt;br /&gt;
* '''Suggested solutions:''' This is probably the request of http://purl.org/tei/fr/337683, allowing specialization of elements back at source level rather than in a customization&lt;br /&gt;
* '''Points for discussion:'''&lt;br /&gt;
** None so far&lt;br /&gt;
&lt;br /&gt;
=== Problem: attribute/content interdependency ===&lt;br /&gt;
* '''Desc:''' Attributes and content interdependency means that you can have either attribute or content but not both.&lt;br /&gt;
* '''Suggested solutions:''' none so far&lt;br /&gt;
* '''Points for discussion:'''&lt;br /&gt;
** None so far&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Chaining of ODDs ===&lt;br /&gt;
* '''Desc:''' ODD should be able to be based not on the full TEI but on another ODD customisation of ODD.&lt;br /&gt;
* '''Suggested solutions:''' I think the new @source attribute makes a major step in this direction&lt;br /&gt;
* '''Points for discussion:'''&lt;br /&gt;
** None so far&lt;br /&gt;
&lt;br /&gt;
=== Problem: Referencing ODD from Document Instance ===&lt;br /&gt;
NOTE: This was discussed by Counci in Ann Arbor in April 2012, and will be going ahead. The ticket for this is [[http://purl.org/tei/fr/1650195]].&lt;br /&gt;
* '''Desc:''' The best place to reference an ODD in a document instance that creates the schema that the document instance is meant to validate against.  Equally, whether an ODD can be embedded (or XIncluded) into a document instance.  This would create a truly portable TEI document which held the document itself, and the means to create the schema and schema documentation all in a single document.  This is potentially useful as an archival format.&lt;br /&gt;
* '''Suggested solutions:''' &lt;br /&gt;
*Doesn't Roma now include details of the ODD from which a schema was generated as a comment inside the schema? That is probably as far as we should go in this direction.&lt;br /&gt;
** But Lou, a mere link to a TEI source, whilst an improvement isn't a consistently machine-processable way of storing that information.  If I want to process a bunch of TEI document instances and find out what ODD they were created against, I have no good method of doing so.  Somewhere in the header (in encodingDesc? tagsDecl?) should be an appropriate place for someone to, at very least, store a &amp;amp;lt;ptr/&amp;amp;gt; to the ODD file.  XML comments inside generated schemas are not reliable and you may not have a copy of the schema, but want to regenerate it from the ODD.  The simple case of embedding a link in the teiHeader somewhere seems quite a trivial bug in that the TEI doesn't make any recommendation of where to put it (so a prose change and maybe allowing &amp;lt;ptr/&amp;gt; somewhere). Comments in XML can be and are thrown away by XML processors according to the spec.  The more difficult case of embedding the entire ODD with the document as an archival format is admittedly more extreme... I mean I have an example ODD which does this by allowing instances to embed it in encodingDesc, but a better solution might be more useable for archival formats of the TEI.&lt;br /&gt;
&lt;br /&gt;
=== Problem: Classification of Elements as belonging to one or more category to aid interoperability ===&lt;br /&gt;
* '''Desc:''' This may be already possible in TEI ODD, but not clearly documented for this purpose. The idea is that any form of customization inside a &amp;amp;lt;schemaSpec&amp;amp;gt; or any element/attribute/class should be able to be categorized as to its nature(s). This categorization can then be used to know whether this item is considered important for interchange/interoperability on one or more lossy exports of the document for interchange or interoperable uses. Thus for various uses elements of a certain category could just be silently ignored, whereas others could be processed following their 'equiv', and other preserved as essential, etc.&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15911</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=15911"/>
		<updated>2017-10-02T19:27:39Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Future plans: &amp;quot;Pure ODD&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
==  &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved in response to the needs of the TEI community, both as the core specification language for the TEI guidelines, and also as a generic customization language. Since 2004, much&lt;br /&gt;
effort has been put into making it less of a hybrid language, combining its own vocabulary with RelaxNG fragments and Schematron rules. Versions of TEI P5 later than 2.5 contain elements which can be used to express content models directly in the TEI ODD language, rather than in RELAXNG.  ODD is thus an entirely self-contained generic specification language, independent&lt;br /&gt;
of other existing grammars, and hence known as Pure ODD.  The proposals for Pure ODD were included in the Guidelines during January 2016, and are included as part of the 3.0.0 release&lt;br /&gt;
&lt;br /&gt;
If your existing TEI schema was developed prior to this release, you should probably read up on [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]]&lt;br /&gt;
*[[ODD chaining]]&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoGenerate.html How to Make an ODD Automagically]&lt;br /&gt;
* [http://teic.github.io/TCW/howtoChain.html ODD chaining for Beginners]&lt;br /&gt;
* [http://teic.github.io/TCW/purifyDoc.html How to Update your ODD] (from a pre 3.0 version)&lt;br /&gt;
* [http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
* [[Mapping ODD processing]]&lt;br /&gt;
&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15218</id>
		<title>Rahtz Prize for TEI Ingenuity</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15218"/>
		<updated>2016-09-12T20:23:16Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Review Process and Criteria */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About the Rahtz Prize==&lt;br /&gt;
&lt;br /&gt;
The TEI Consortium has created the Rahtz Prize for TEI Ingenuity in memory of [https://en.wikipedia.org/wiki/Sebastian_Rahtz Sebastian Rahtz] (13 February 1955 – 15 March 2016). The  award&lt;br /&gt;
is intended to honour Sebastian’s major technical and philosophical contributions to the TEI, and to encourage TEI innovation by the TEI community.&lt;br /&gt;
&lt;br /&gt;
Sebastian was responsible for the design and implementation of a great deal of the TEI's technical infrastructure. Within the TEI community he was best known for the creation and maintenance of the XSLT Stylesheets that underlie much TEI conversion work, customization, and schema generation. As a member of both the TEI's Technical Council and its Board, he helped shape the direction of the Consortium.&lt;br /&gt;
&lt;br /&gt;
The Rahtz Prize for TEI Ingenuity is awarded to an individual or team judged to have made a significant contribution to the [http://www.tei-c.org/About/mission.xml TEI-C's mission] in particular by&lt;br /&gt;
means of technical innovation.  Many members of the TEI Community are engaged in exploring new&lt;br /&gt;
ways of implementing and expanding the coverage of the TEI system. It is hoped that this Prize will not only recognize excellent work already completed, but also encourage new projects and fresh approaches.&lt;br /&gt;
&lt;br /&gt;
==Important Info and Dates ==&lt;br /&gt;
&lt;br /&gt;
* $1,000 USD will be awarded to one individual or team per year&lt;br /&gt;
* 1 August: Submissions Due&lt;br /&gt;
* 15 September: Winner Selected&lt;br /&gt;
* Annual Business Meeting: Winner Announced &lt;br /&gt;
&lt;br /&gt;
==Submission Rules and Guidelines==&lt;br /&gt;
&lt;br /&gt;
Applications for the Rahtz Prize for TEI Ingenuity may be [https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 submitted online] ([https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2]) at any time but must be submitted by midnight in Hawaii on 1 August in order to be considered for awarding at that year's TEI members' meeting.  &lt;br /&gt;
&lt;br /&gt;
Along with contact information, applicants will be asked to submit a 500-1,500 summary describing the project/initiative.  This summary should reflect the [http://www.tei-c.org/About/mission.xml TEI-C's mission] and the criteria as outlined below.  &lt;br /&gt;
&lt;br /&gt;
===Eligibility===&lt;br /&gt;
* Individuals or teams are eligible to apply.  Membership to the TEI-Consortium is not a requirement.  &lt;br /&gt;
* If awarded, the individuals/teams are eligible to submit another application three (3) years after the granted award.&lt;br /&gt;
&lt;br /&gt;
==Review Process and Criteria==&lt;br /&gt;
&lt;br /&gt;
Nominations will be reviewed by an Awards Panel comprising  the Chair of the TEI-C Board of Directors, the Chair of the TEI-C Technical Council, and one invited, long-time and active member of the TEI Community.  No member of the Panel may serve more than three consecutive years. Membership of the Panel will be agreed upon jointly by the Board and the Council by 1 July.&lt;br /&gt;
&lt;br /&gt;
Nominations should demonstrate that the person or team nominated has made an outstanding&lt;br /&gt;
contribution to one or more of the following:&lt;br /&gt;
&lt;br /&gt;
* innovative development of the TEI Guidelines&lt;br /&gt;
* creation of TEI-aware tools and technologies that further dissemination, adoption, and engaged use of the TEI Guidelines&lt;br /&gt;
* expansive and inclusive TEI training and outreach opportunities&lt;br /&gt;
* informed development and cultivation of particular TEI practitioner communities&lt;br /&gt;
&lt;br /&gt;
The Awards Panel is not required to make an award in every year, nor to consider only the nominations received.&lt;br /&gt;
&lt;br /&gt;
==Terms==&lt;br /&gt;
The recipient(s) will receive a cash award of $1,000 USD, or a round number of about the same value in the currency in which the prize is to be awarded. The final selection is made by the panel of judges and announced as part of the Business Meeting, which occurs as part of the annual TEI-C Conference and Members' Meeting. The disbursement of the cash award is arranged through the TEI-C Treasurer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Board]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15217</id>
		<title>Rahtz Prize for TEI Ingenuity</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15217"/>
		<updated>2016-09-12T20:05:20Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* About the Rahtz Prize */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About the Rahtz Prize==&lt;br /&gt;
&lt;br /&gt;
The TEI Consortium has created the Rahtz Prize for TEI Ingenuity in memory of [https://en.wikipedia.org/wiki/Sebastian_Rahtz Sebastian Rahtz] (13 February 1955 – 15 March 2016). The  award&lt;br /&gt;
is intended to honour Sebastian’s major technical and philosophical contributions to the TEI, and to encourage TEI innovation by the TEI community.&lt;br /&gt;
&lt;br /&gt;
Sebastian was responsible for the design and implementation of a great deal of the TEI's technical infrastructure. Within the TEI community he was best known for the creation and maintenance of the XSLT Stylesheets that underlie much TEI conversion work, customization, and schema generation. As a member of both the TEI's Technical Council and its Board, he helped shape the direction of the Consortium.&lt;br /&gt;
&lt;br /&gt;
The Rahtz Prize for TEI Ingenuity is awarded to an individual or team judged to have made a significant contribution to the [http://www.tei-c.org/About/mission.xml TEI-C's mission] in particular by&lt;br /&gt;
means of technical innovation.  Many members of the TEI Community are engaged in exploring new&lt;br /&gt;
ways of implementing and expanding the coverage of the TEI system. It is hoped that this Prize will not only recognize excellent work already completed, but also encourage new projects and fresh approaches.&lt;br /&gt;
&lt;br /&gt;
==Important Info and Dates ==&lt;br /&gt;
&lt;br /&gt;
* $1,000 USD will be awarded to one individual or team per year&lt;br /&gt;
* 1 August: Submissions Due&lt;br /&gt;
* 15 September: Winner Selected&lt;br /&gt;
* Annual Business Meeting: Winner Announced &lt;br /&gt;
&lt;br /&gt;
==Submission Rules and Guidelines==&lt;br /&gt;
&lt;br /&gt;
Applications for the Rahtz Prize for TEI Ingenuity may be [https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 submitted online] ([https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2]) at any time but must be submitted by midnight in Hawaii on 1 August in order to be considered for awarding at that year's TEI members' meeting.  &lt;br /&gt;
&lt;br /&gt;
Along with contact information, applicants will be asked to submit a 500-1,500 summary describing the project/initiative.  This summary should reflect the [http://www.tei-c.org/About/mission.xml TEI-C's mission] and the criteria as outlined below.  &lt;br /&gt;
&lt;br /&gt;
===Eligibility===&lt;br /&gt;
* Individuals or teams are eligible to apply.  Membership to the TEI-Consortium is not a requirement.  &lt;br /&gt;
* If awarded, the individuals/teams are eligible to submit another application three (3) years after the granted award.&lt;br /&gt;
&lt;br /&gt;
==Review Process and Criteria==&lt;br /&gt;
&lt;br /&gt;
The submissions will be reviewed by a panel of three judges:  the Chair of the TEI-C Board of Directors, the Chair of the TEI-C Technical Council, and an invited, long-time and active member from the TEI Community.  A new panel of judges may change as frequently as every year, but the same jury member should not serve more than 3 consecutive years.  The Community judge will be identified and agreed upon jointly by the Board and the Council by 1 July.&lt;br /&gt;
&lt;br /&gt;
Contributions should reflect: &lt;br /&gt;
&lt;br /&gt;
* innovative development of the TEI-C Guidelines&lt;br /&gt;
* the creation of TEI-aware tools and technologies that further dissemination, adoption, and engaged use of the TEI-C Guidelines&lt;br /&gt;
* expansive and inclusive training and outreach opportunities&lt;br /&gt;
* the cultivation of particular TEI-C researcher and practitioner communities&lt;br /&gt;
&lt;br /&gt;
==Terms==&lt;br /&gt;
The recipient(s) will receive a cash award of $1,000 USD, or a round number of about the same value in the currency in which the prize is to be awarded. The final selection is made by the panel of judges and announced as part of the Business Meeting, which occurs as part of the annual TEI-C Conference and Members' Meeting. The disbursement of the cash award is arranged through the TEI-C Treasurer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Board]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15216</id>
		<title>Rahtz Prize for TEI Ingenuity</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Rahtz_Prize_for_TEI_Ingenuity&amp;diff=15216"/>
		<updated>2016-09-12T20:04:06Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* About the Rahtz Prize */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About the Rahtz Prize==&lt;br /&gt;
&lt;br /&gt;
The TEI Consortium has created the Rahtz Prize for TEI Ingenuity in memory of [https://en.wikipedia.org/wiki/Sebastian_Rahtz Sebastian Rahtz] (13 February 1955 – 15 March 2016). The  award&lt;br /&gt;
is intended to honour Sebastian’s major technical and philosophical contributions to the TEI, and to encourage TEI innovation by the TEI community.&lt;br /&gt;
&lt;br /&gt;
Sebastian was responsible for the design and implementation of a great deal of the TEI's technical infrastructure. Inside the TEI community he was most well-known for the creation and maintenance of the XSLT Stylesheets that underlie much TEI conversion work, customization, and schema generation. As a member of both the TEI's Technical Council and its Board he helped shape the direction of the Consortium.&lt;br /&gt;
&lt;br /&gt;
The Rahtz Prize for TEI Ingenuity is awarded to an individual or team judged to have made a significant contribution to the [http://www.tei-c.org/About/mission.xml TEI-C's mission] in particular by&lt;br /&gt;
means of technical innovation.  Many members of the TEI Community are engaged in exploring new&lt;br /&gt;
ways of implementing and expanding the coverage of the TEI system. It is hoped that this Prize will not only recognize excellent work already completed, but also encourage new projects and fresh approaches.&lt;br /&gt;
&lt;br /&gt;
==Important Info and Dates ==&lt;br /&gt;
&lt;br /&gt;
* $1,000 USD will be awarded to one individual or team per year&lt;br /&gt;
* 1 August: Submissions Due&lt;br /&gt;
* 15 September: Winner Selected&lt;br /&gt;
* Annual Business Meeting: Winner Announced &lt;br /&gt;
&lt;br /&gt;
==Submission Rules and Guidelines==&lt;br /&gt;
&lt;br /&gt;
Applications for the Rahtz Prize for TEI Ingenuity may be [https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 submitted online] ([https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2 https://goo.gl/forms/ZX4NKQ3cPHnBvSxK2]) at any time but must be submitted by midnight in Hawaii on 1 August in order to be considered for awarding at that year's TEI members' meeting.  &lt;br /&gt;
&lt;br /&gt;
Along with contact information, applicants will be asked to submit a 500-1,500 summary describing the project/initiative.  This summary should reflect the [http://www.tei-c.org/About/mission.xml TEI-C's mission] and the criteria as outlined below.  &lt;br /&gt;
&lt;br /&gt;
===Eligibility===&lt;br /&gt;
* Individuals or teams are eligible to apply.  Membership to the TEI-Consortium is not a requirement.  &lt;br /&gt;
* If awarded, the individuals/teams are eligible to submit another application three (3) years after the granted award.&lt;br /&gt;
&lt;br /&gt;
==Review Process and Criteria==&lt;br /&gt;
&lt;br /&gt;
The submissions will be reviewed by a panel of three judges:  the Chair of the TEI-C Board of Directors, the Chair of the TEI-C Technical Council, and an invited, long-time and active member from the TEI Community.  A new panel of judges may change as frequently as every year, but the same jury member should not serve more than 3 consecutive years.  The Community judge will be identified and agreed upon jointly by the Board and the Council by 1 July.&lt;br /&gt;
&lt;br /&gt;
Contributions should reflect: &lt;br /&gt;
&lt;br /&gt;
* innovative development of the TEI-C Guidelines&lt;br /&gt;
* the creation of TEI-aware tools and technologies that further dissemination, adoption, and engaged use of the TEI-C Guidelines&lt;br /&gt;
* expansive and inclusive training and outreach opportunities&lt;br /&gt;
* the cultivation of particular TEI-C researcher and practitioner communities&lt;br /&gt;
&lt;br /&gt;
==Terms==&lt;br /&gt;
The recipient(s) will receive a cash award of $1,000 USD, or a round number of about the same value in the currency in which the prize is to be awarded. The final selection is made by the panel of judges and announced as part of the Business Meeting, which occurs as part of the annual TEI-C Conference and Members' Meeting. The disbursement of the cash award is arranged through the TEI-C Treasurer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Board]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Editor_for_teaching_TEI_-_features&amp;diff=15037</id>
		<title>Editor for teaching TEI - features</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Editor_for_teaching_TEI_-_features&amp;diff=15037"/>
		<updated>2016-07-11T14:02:40Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Comments, justification, discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Editing tools]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This is an attempt at listing the minimal set of features that a TEI editor '''used for teaching purposes''' should have.&lt;br /&gt;
&lt;br /&gt;
=== 1. Basic required features ===&lt;br /&gt;
1.1. multiplatform&lt;br /&gt;
&amp;lt;br&amp;gt;1.2. validation with Relax NG&lt;br /&gt;
&amp;lt;br&amp;gt;1.3. continuous validation&lt;br /&gt;
&amp;lt;br&amp;gt;1.4. contextual suggestions (following the schema)&lt;br /&gt;
&amp;lt;br&amp;gt;1.5. XSLT 2 transformation (Saxon HE? that would offer XQuery as well)&lt;br /&gt;
&amp;lt;br&amp;gt;1.6. easy to use&lt;br /&gt;
&amp;lt;br&amp;gt;1.7. free for students (as in beer) &lt;br /&gt;
&amp;lt;br&amp;gt;1.8. syntax highlighting for XML (that naturally includes XSLT)&lt;br /&gt;
&amp;lt;br&amp;gt;1.9. XPath queries (2.0 only would be fine)&lt;br /&gt;
&amp;lt;br&amp;gt;1.10 Support for Oxygen project files enabling configuration of validation, transformation and templating; or an equivalent system for another editor.&lt;br /&gt;
&lt;br /&gt;
=== Comments, justification, discussion ===&lt;br /&gt;
(please use the hard-set numbers; note that discussion is still running at [[TEI-L]]; everyone is welcome to modify this page)&lt;br /&gt;
* Item 1.7. could imply a very moderate bulk licensing fee paid by the institution that provides training; we have to bear in mind that the entire discussion started because of a department refusing to pay regular licensing fees (deemed as too high) for a course that lasts a semester&lt;br /&gt;
* &amp;quot;I would move your 2.2 and 2.3 (xpath query and help pop ups) up to the essential category. These are features I use all the time when teaching.&amp;quot; (Lou Burnard)&lt;br /&gt;
** just noting that a pop-up is only one of the possibilities (one can imagine a side panel appearing due to a keystroke sequence), but the discussion started originally from how oXygen could be dumbed down; I try to make the lists and considerations here slightly more general ([[User:Piotr Banski|Piotr]])&lt;br /&gt;
** very true Piotr! Whatever the interface, I agree with Lou that it's an important feature. &lt;br /&gt;
* 2.5: &amp;quot;From a sustainability perspective, I would add &amp;quot;open-source&amp;quot; to the feature set, maybe in the &amp;quot;2. Ideally...&amp;quot; section. This may not be much pertinent from the short term opportunistic point of view of a student (or a teacher), but may help consolidate tools appropriateness to TEI for the long term, which is what TEI is all about.&amp;quot; (Serge Heiden)&lt;br /&gt;
* I have moved XPath queries from &amp;quot;Ideally&amp;quot; to &amp;quot;Basic features&amp;quot;. In my experience, that's an essential point for students (and people in general). (Marjorie) I've constrained this to XPath 2.0; I think this would be sufficient. (Martin Holmes)&lt;br /&gt;
* Could we preserve the possibility to use a third-party commercial tool, like Saxon PE, if the users need them and want to acquire them?&lt;br /&gt;
* I've added Oxygen project files, or an equivalent system in a competing editor (Martin Holmes).&lt;br /&gt;
* Another essential feature for me would be the ability to script a sequence of transformations etc. in the way that oXygen currently does when generating RNG and XHTML from an ODD file. It's currently done with an Ant script, but any scripting language will do. I routinely do an exercise which involves editing an ODD, generating a schema, using it to create a new file, et da capo. This is easy and seamless in oXyGen: doing it  via the oXGarage web interface would be cumbersome and confusing.   (Lou)&lt;br /&gt;
&lt;br /&gt;
=== 2. Ideally... ===&lt;br /&gt;
2.1. free (as in beer) &lt;br /&gt;
&amp;lt;br&amp;gt;2.2. Inline documentation (i.e. the little pop-ups with the definition of the element)&lt;br /&gt;
&amp;lt;br&amp;gt;2.3. pre-set templates (example?)&lt;br /&gt;
&amp;lt;br&amp;gt;2.4. syntax highlighting for XQuery&lt;br /&gt;
&amp;lt;br&amp;gt;2.5. open source&lt;br /&gt;
&amp;lt;br&amp;gt;2.6. validation with Relax NG '''based on the xml-model PI in the document'''&lt;br /&gt;
&amp;lt;br&amp;gt;2.7. possibility to auto-update the TEI schema at each new release&lt;br /&gt;
&lt;br /&gt;
=== 3. Features that can be eliminated from a &amp;quot;teaching editor&amp;quot; in order to decrease its cost ===&lt;br /&gt;
3.1. No XSLT 3 (as a consequence of the fact that no commercial tool such as Saxon PE/EE could be used in such an editor)&lt;br /&gt;
&amp;lt;br&amp;gt;3.2. No need for XSLT or XQuery debuggers&lt;br /&gt;
&amp;lt;br&amp;gt;3.3. no need for database connectivity&lt;br /&gt;
&amp;lt;br&amp;gt;3.4. no need for a built-in SVN (etc.) client&lt;br /&gt;
&amp;lt;br&amp;gt;3.5. no need for a Tree Editor such as the one offered by oXygen&lt;br /&gt;
&amp;lt;br&amp;gt;3.6. no need for Compare Files/Directories tools &lt;br /&gt;
&amp;lt;br&amp;gt;3.7. no need for big-file editor or big-file support in general&lt;br /&gt;
&amp;lt;br&amp;gt;3.8. no need for syntax highlighting and editing support for some file types which are not XML-based (JavaScript, CSS, JSON, etc.).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
The impetus for establishing the above came from a sub-thread on the [[TEI-L]] list bulleted by the following messages: [https://listserv.brown.edu/archives/cgi-bin/wa?A2=tei-l;fcdcab72.1607], [https://listserv.brown.edu/archives/cgi-bin/wa?A2=tei-l;af28895d.1607], [https://listserv.brown.edu/archives/cgi-bin/wa?A2=tei-l;83b06464.1607]. The idea is to see whether the community can agree on a single feature set that a dumbed-down commercial editor can implement is a &amp;quot;student version&amp;quot; with an appropriate license.&lt;br /&gt;
Or, as Martin Holmes puts it, we want to &amp;quot;arrive at something which would be utterly useless for the likes of me, and quite frustrating for serious users, but perfectly functional for teaching introductory XML encoding classes over a few months.&amp;quot;&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14706</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14706"/>
		<updated>2016-01-25T15:38:40Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Future plans: &amp;quot;Pure ODD&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
== Future plans: &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved in response to the needs of the TEI community, both as the core specification language for the TEI guidelines, and also as a generic customization language. Since 2004, much&lt;br /&gt;
effort has been put into making it less of a hybrid language, combining its own vocabulary with RelaxNG fragments and Schematron rules. Versions of TEI P5 later than 2.5 contain elements which can be used to express content models directly in the TEI ODD language, rather than in RELAXNG. This work is ongoing in the TEI Technical Council, the goal being to make ODD an entirely self-contained generic specification language, independent&lt;br /&gt;
of other existing grammars, and hence known as Pure ODD.  See further [https://github.com/TEIC/pureodd &amp;quot;Pure ODD&amp;quot;]. There is a mailing list for discussing Pure ODD called [https://lists.sourceforge.net/lists/listinfo/tei-odds tei-odds].&lt;br /&gt;
&lt;br /&gt;
The proposals for Pure ODD were finally included in the Guidelines during January 2016, for inclusion as part of the 3.0.0 release&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]]&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
*[http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
*[http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_Agenda_2015-03&amp;diff=14255</id>
		<title>Council Agenda 2015-03</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_Agenda_2015-03&amp;diff=14255"/>
		<updated>2015-03-27T10:32:48Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Teleconference 2015-02-27 13:30 GMT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Teleconference 2015-02-27 13:30 GMT ==&lt;br /&gt;
&lt;br /&gt;
* Review of action items from last telecon (see [[http://www.tei-c.org/Activities/Council/Meetings/tcm66.xml minutes]]).&lt;br /&gt;
* JTEI integration into P5, Stylesheets and Oxygen plugin (MH).&lt;br /&gt;
* Update on Pure ODD (LB)&lt;br /&gt;
* What's in/out of the upcoming release?&lt;br /&gt;
* other items?&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14253</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14253"/>
		<updated>2015-03-23T16:33:10Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Future plans: &amp;quot;Pure ODD&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
== Future plans: &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved in response to the needs of the TEI community, both as the core specification language for the TEI guidelines, and also as a generic customization language. Since 2004, much&lt;br /&gt;
effort has been put into making it less of a hybrid language, combining its own vocabulary with RelaxNG fragments and Schematron rules. Versions of TEI P5 later than 2.5 contain elements which can be used to express content models directly in the TEI ODD language, rather than in RELAXNG. This work is ongoing in the TEI Technical Council, the goal being to make ODD an entirely self-contained generic specification language, independent&lt;br /&gt;
of other existing grammars, and hence known as Pure ODD.  See further [https://github.com/TEIC/pureodd &amp;quot;Pure ODD&amp;quot;]. There is a mailing list for discussing Pure ODD called [https://lists.sourceforge.net/lists/listinfo/tei-odds tei-odds].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]]&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
*[http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
*[http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14252</id>
		<title>ODD</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=ODD&amp;diff=14252"/>
		<updated>2015-03-23T16:24:25Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''ODD''' stands for &amp;quot;One Document Does it all&amp;quot;. It is a TEI XML-conformant specification format that allows one to customize TEI P5 in a [[Wikipedia:literate programming|literate programming]] fashion. It uses elements from the new [http://www.tei-c.org/P5/Guidelines/TD.html Documentation Elements] module.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
The TEI Guidelines, its DTD, and its schema fragments, are all produced from a single XML resource containing:&lt;br /&gt;
&lt;br /&gt;
# Descriptive prose (lots of it)&lt;br /&gt;
# Examples of usage (plenty)&lt;br /&gt;
# Formal declarations for components of the TEI Abstract Model:&lt;br /&gt;
## elements and attributes&lt;br /&gt;
## modules&lt;br /&gt;
## classes and macros&lt;br /&gt;
&lt;br /&gt;
We call this resource an ODD (One Document Does it all), although the master source is instantiated as a gazillion XML mini-documents. &lt;br /&gt;
&lt;br /&gt;
A system of XSLT stylesheets called [[Roma]] has been created for the purpose of easy manipulation of ODD files.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The TEI scheme can only be used by customizing it. Customizations are also expressed in the ODD language. For example: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;schemaSpec ident=&amp;quot;myTEIlite&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;desc&amp;gt;This is TEI Lite with simplified heads&amp;lt;/desc&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;tei&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;textstructure&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;linking&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;core&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;moduleRef key=&amp;quot;header&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;elementSpec ident=&amp;quot;head&amp;quot; mode=&amp;quot;change&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;content&amp;gt;&amp;lt;textNode/&amp;gt;&amp;lt;/content&amp;gt;&lt;br /&gt;
  &amp;lt;/elementSpec&amp;gt;&lt;br /&gt;
&amp;lt;/schemaSpec&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a schema a bit like TEI Lite, with a slight change : the element &amp;amp;lt;head&amp;gt; now can contain only text nodes.&lt;br /&gt;
&lt;br /&gt;
== Uses besides the TEI Guidelines and various customizations ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.w3.org/TR/its/ Internationalization Tag Set (ITS)]&lt;br /&gt;
* various standards proposal designed within ISO committee TC 37 have been totally or partially written in TEI/ODD: MLIF, MAF, ISO 16642 rev., ISOTimeML&lt;br /&gt;
&lt;br /&gt;
== Future plans: &amp;quot;Pure ODD&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Over the years ODD has evolved progressively to reflect more and more needs of the TEI community, both as the core specification language for the TEI guidelines, but also as generic customization language for any TEI users. Still ODD remains a hybrid environment combining its own vacabulary with RelaxNG fragments and at times, validation vocabularies from external languages (e.g. Schematron). The Technical Council contemplates putting on its work program a revision of the ODD infrastructure, considering either to drop it altogether in favor of one existing schema language, or extend its capabilities to make it a self contained and generic specification language.  Some thoughts are included at [[ODD-dev]], and the effort to make it self-contained is now referred to as [https://github.com/TEIC/pureodd &amp;quot;Pure ODD&amp;quot;]. There is a mailing list for discussing Pure ODD called [https://lists.sourceforge.net/lists/listinfo/tei-odds tei-odds].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/ODD_%28Text_Encoding_Initiative%29 ODD (Text Encoding Initiative)] in Wikipedia&lt;br /&gt;
*[[ODD-dev]]&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
*[http://www.tei-c.org/Guidelines/Customization/odds.xml Getting Started with P5 ODDs]&lt;br /&gt;
*[http://www.w3.org/TR/xml-i18n-bp/#tei-modularization A fragment of W3C's Best Practices for XML Internationalization concerning ODD customization for the Internationalization Tag Set (ITS).]&lt;br /&gt;
=== Presentations ===&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2007-02-13-oucs/talk-odds.xml A talk about the ODD system], given on 13 Feb 2007 by Lou Burnard and Sebastian Rahtz at the OUCS ''Encoding Digital Texts'' workshop&lt;br /&gt;
*[http://tei.oucs.ox.ac.uk/Oxford/2006-09-methNet/Talks/RomaJourney.ppt A PowerPoint presentation on TEI/ODD] by Laurent Romary; OUCS, September 2006&lt;br /&gt;
*[http://www.balisage.net/Proceedings/vol7/html/Banski01/BalisageVol7-Banski01.html Literate serialization of linguistic metamodels] by Piotr Bański, Balisage-2011&lt;br /&gt;
&lt;br /&gt;
=== Articles ===&lt;br /&gt;
* [http://jtei.revues.org/842 Resolving the Durand Conundrum], by Lou Burnard&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Bauman01/EML2004Bauman01.html Odd Customizations], by Syd Bauman and Julia Flanders.&lt;br /&gt;
* [http://conferences.idealliance.org/extreme/html/2004/Burnard01/EML2004Burnard01.html RelaxNG with Son of ODD], by Lou Burnard and Sebastian Rahtz.&lt;br /&gt;
* [http://www.balisage.net/Proceedings/vol1/html/Bauman01/BalisageVol1-Bauman01.html Freedom to Constrain] by Syd Bauman&lt;br /&gt;
&lt;br /&gt;
[[Category:Customization|!]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Global_@resp_attribute&amp;diff=14109</id>
		<title>Global @resp attribute</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Global_@resp_attribute&amp;diff=14109"/>
		<updated>2014-12-05T15:01:57Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* PROSE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==IMPLEMENTATION PLAN==&lt;br /&gt;
&lt;br /&gt;
Council agreed to go ahead with this 2014-11-18. What follows is an implementation plan.&lt;br /&gt;
&lt;br /&gt;
===SPECS===&lt;br /&gt;
&lt;br /&gt;
# Rename (i.e. &amp;lt;code&amp;gt;svn rename&amp;lt;/code&amp;gt;) att.responsibility.xml to att.global.responsibility.xml, and remove its membership of att.source.&lt;br /&gt;
# Add the class to att.global.xml.&lt;br /&gt;
# Add a reference to PHHR to the spec (this is the excellent discussion of @resp/@cert vs &amp;amp;lt;respons&amp;amp;gt;/&amp;amp;lt;certainty&amp;amp;gt;).&lt;br /&gt;
# Replace att.responsibility everywhere it occurs with att.source (to preserve @source where it is now allowed).&lt;br /&gt;
# Change the definition of @cert in certainty.xml to mode=&amp;quot;change&amp;quot;.&lt;br /&gt;
# Change the definition of @resp in space.xml to mode=&amp;quot;change&amp;quot;.&lt;br /&gt;
# Add the following example to att.global.responsibility.xml:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;egXML xmlns=&amp;quot;http://www.tei-c.org/ns/Examples&amp;quot;&amp;amp;gt;&lt;br /&gt;
      &lt;br /&gt;
        &amp;amp;lt;!-- in the &amp;lt;text&amp;gt; ... --&amp;amp;gt;&lt;br /&gt;
      &lt;br /&gt;
      &amp;amp;lt;l&amp;amp;gt;Punkes, Panders, baſe extortionizing &lt;br /&gt;
        sla&amp;amp;lt;choice&amp;amp;gt;&amp;amp;lt;sic&amp;amp;gt;n&amp;amp;lt;/sic&amp;amp;gt;&amp;amp;lt;corr resp=&amp;quot;#JENS1_transcriber&amp;quot;&amp;amp;gt;u&amp;amp;lt;/corr&amp;amp;gt;&amp;amp;lt;/choice&amp;amp;gt;es,&amp;amp;lt;/l&amp;amp;gt;&lt;br /&gt;
      &lt;br /&gt;
        &amp;amp;lt;!-- in the header ... --&amp;amp;gt;&lt;br /&gt;
      &lt;br /&gt;
        &amp;amp;lt;respStmt xml:id=&amp;quot;JENS1_transcriber&amp;quot;&amp;amp;gt;&lt;br /&gt;
          &amp;amp;lt;resp when=&amp;quot;2014&amp;quot;&amp;amp;gt;Transcriber&amp;amp;lt;/resp&amp;amp;gt;&lt;br /&gt;
          &amp;amp;lt;name&amp;amp;gt;Janelle Jenstad&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;/respStmt&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/egXML&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SPEC REFERENCES===&lt;br /&gt;
&lt;br /&gt;
Change all instances of this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.global.responsibility&amp;quot; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and all instances of this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the ST chapter (containing all the spec XIncludes), change this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;include xmlns=&amp;quot;http://www.w3.org/2001/XInclude&amp;quot; href=&amp;quot;../../Specs/att.responsibility.xml&amp;quot;/&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;include xmlns=&amp;quot;http://www.w3.org/2001/XInclude&amp;quot; href=&amp;quot;../../Specs/att.global.responsibility.xml&amp;quot;/&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PROSE===&lt;br /&gt;
&lt;br /&gt;
1. In att.global.responsibility.xml, change the definition from this:&lt;br /&gt;
&lt;br /&gt;
      att.responsibility provides attributes indicating who is &lt;br /&gt;
      responsible for something asserted by the markup and the &lt;br /&gt;
      degree of certainty associated with it.&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      att.global.responsibility provides attributes indicating the agency &lt;br /&gt;
      responsible for some aspect of the text, the markup or &lt;br /&gt;
      something asserted by the markup, and the degree of certainty &lt;br /&gt;
      associated with it.&lt;br /&gt;
&lt;br /&gt;
and add a note to this effect:&lt;br /&gt;
&lt;br /&gt;
      Note that a simple @resp pointing to a person or &lt;br /&gt;
      organization is likely to be somewhat ambiguous with regard &lt;br /&gt;
      to the nature of the responsibility. For this reason, we &lt;br /&gt;
      recommend that @resp be used to point not to an agent &lt;br /&gt;
      (person or org) but to a respStmt, author, editor or similar &lt;br /&gt;
      element which clarifies the exact role played by the agent. &lt;br /&gt;
      Pointing to multiple respStmts allows the encoder to specify &lt;br /&gt;
      clearly each of the roles played in part of a TEI file (creating, &lt;br /&gt;
      transcribing, encoding, editing, proofing etc.).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In 3.4 (CO), update this paragraph:&lt;br /&gt;
&lt;br /&gt;
      For most of the elements discussed here, some encoders &lt;br /&gt;
      may wish to indicate both a responsibility, that is, a &lt;br /&gt;
      code indicating the person or agency responsible for &lt;br /&gt;
      making the editorial intervention in question, and also &lt;br /&gt;
      an indication of the degree of certainty which the encoder &lt;br /&gt;
      wishes to associate with the intervention. Because these &lt;br /&gt;
      requirements are common to many of the elements discussed &lt;br /&gt;
      in this section, they are provided by attribute classes, &lt;br /&gt;
      specifically att.editLike, which itself inherits &lt;br /&gt;
      attributes from three further classes called &lt;br /&gt;
      att.responsibility, att.source, and att.dimensions &lt;br /&gt;
      respectively. Any of the elements discussed here thus may &lt;br /&gt;
      potentially carry any of the following optional attributes:&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      For most of the elements discussed here, some encoders &lt;br /&gt;
      may wish to indicate both a responsibility, that is, a &lt;br /&gt;
      code indicating the person or agency responsible for &lt;br /&gt;
      making the editorial intervention in question, and also &lt;br /&gt;
      an indication of the degree of certainty which the encoder &lt;br /&gt;
      wishes to associate with the intervention. These &lt;br /&gt;
      requirements are served by the att.global.responsibility&lt;br /&gt;
      class, along with att.source and att.dimensions. Any of &lt;br /&gt;
      the elements discussed here thus may potentially carry &lt;br /&gt;
      any of the following optional attributes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. In 3.4.1 (CO), change this:&lt;br /&gt;
&lt;br /&gt;
      The &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute is available for &lt;br /&gt;
      all elements which are members of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt; &lt;br /&gt;
      class. The same class makes available a &amp;amp;lt;att&amp;amp;gt;cert&amp;amp;lt;/att&amp;amp;gt; &lt;br /&gt;
      attribute, which may be used...&lt;br /&gt;
      &lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      The &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute is available for &lt;br /&gt;
      all elements which are members of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt; &lt;br /&gt;
      class. The same class makes available a &amp;amp;lt;att&amp;amp;gt;cert&amp;amp;lt;/att&amp;amp;gt; &lt;br /&gt;
      attribute, which may be used...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. In 17.2 (AI), change this:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;p&amp;amp;gt;These elements are all members of the class &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.interpLike&amp;amp;lt;/ident&amp;amp;gt;, &lt;br /&gt;
      and thus share the following attributes:&lt;br /&gt;
      &amp;amp;lt;specList&amp;amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.interpLike&amp;quot; atts=&amp;quot;type inst&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; atts=&amp;quot;cert resp&amp;quot;/&amp;amp;gt;&amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;p&amp;amp;gt;These elements are all members of the class &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.interpLike&amp;amp;lt;/ident&amp;amp;gt;, &lt;br /&gt;
      and thus share the following attributes:&lt;br /&gt;
      &amp;amp;lt;specList&amp;amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.interpLike&amp;quot; atts=&amp;quot;type inst&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      They also inherit the following attributes from &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.global.responsibility&amp;quot; atts=&amp;quot;cert resp&amp;quot;/&amp;amp;gt;&amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. In 13.1.1 (ND), change this:&lt;br /&gt;
&lt;br /&gt;
      Some members of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.naming&amp;amp;lt;/ident&amp;amp;gt; class&lt;br /&gt;
      are also members of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt;&lt;br /&gt;
      class, from which they inherit the following attributes:&lt;br /&gt;
      &amp;amp;lt;specList&amp;amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; atts=&amp;quot;resp cert&amp;quot;/&amp;amp;gt;&amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
      This enables an encoder to record the agency responsible for a given&lt;br /&gt;
      assertion (for example, the name) and the confidence placed in that&lt;br /&gt;
      assertion by the encoder.&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      All members of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.naming&amp;amp;lt;/ident&amp;amp;gt; class also &lt;br /&gt;
      inherit the following attributes from the &lt;br /&gt;
      &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt; class:&lt;br /&gt;
      &amp;amp;lt;specList&amp;amp;gt;&amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; atts=&amp;quot;resp cert&amp;quot;/&amp;amp;gt;&amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
      This enables an encoder to record the agency responsible for a given&lt;br /&gt;
      assertion (for example, the name) and the confidence placed in that&lt;br /&gt;
      assertion by the encoder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. In 13.3.2 (ND), replace this:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;p&amp;amp;gt;The &amp;amp;lt;gi&amp;amp;gt;person&amp;amp;lt;/gi&amp;amp;gt; element carries several  attributes.&lt;br /&gt;
      First, as a member of &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.editLike&amp;amp;lt;/ident&amp;amp;gt;, which&lt;br /&gt;
      is a subclass of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt;&lt;br /&gt;
      class, it carries the usual attributes for providing&lt;br /&gt;
      details about the information  &lt;br /&gt;
      recorded for that person itself, such as its reliability or source: &amp;amp;lt;specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; atts=&amp;quot;cert resp&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.editLike&amp;quot; atts=&amp;quot;evidence&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.source&amp;quot; atts=&amp;quot;source&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;p&amp;amp;gt;The &amp;amp;lt;gi&amp;amp;gt;person&amp;amp;lt;/gi&amp;amp;gt; element carries several attributes.&lt;br /&gt;
      As a member of the classes &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt;,&lt;br /&gt;
      and &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.editLike&amp;amp;lt;/ident&amp;amp;gt;, which&lt;br /&gt;
      is a subclass of the &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.source&amp;amp;lt;/ident&amp;amp;gt;&lt;br /&gt;
      class, it carries the usual attributes for providing&lt;br /&gt;
      details about the information  &lt;br /&gt;
      recorded for that person, such as its reliability or source: &amp;amp;lt;specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.global.responsibility&amp;quot; atts=&amp;quot;cert resp&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.editLike&amp;quot; atts=&amp;quot;evidence&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.source&amp;quot; atts=&amp;quot;source&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. In 11.3.1.1 (PH), change this:&lt;br /&gt;
&lt;br /&gt;
      Several of these elements bear additional attributes &lt;br /&gt;
      for specifying who responsible for the interpretation &lt;br /&gt;
      represented by the markup, and the certainty associated &lt;br /&gt;
      with it.&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      All of these elements bear additional attributes &lt;br /&gt;
      for specifying who is responsible for the interpretation &lt;br /&gt;
      represented by the markup, and the associated certainty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. In 12.1.2 (TC), change this:&lt;br /&gt;
&lt;br /&gt;
      The &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.textCritical&amp;amp;lt;/ident&amp;amp;gt; class also &lt;br /&gt;
      inherits the following attributes from the &lt;br /&gt;
      &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt; class: &amp;amp;lt;specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.responsibility&amp;quot; atts=&amp;quot;resp cert&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      These elements also &lt;br /&gt;
      inherit the following attributes from the &lt;br /&gt;
      &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.global.responsibility&amp;amp;lt;/ident&amp;amp;gt; class: &amp;amp;lt;specList&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;specDesc key=&amp;quot;att.global.responsibility&amp;quot; atts=&amp;quot;resp cert&amp;quot;/&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/specList&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. DELETE from 21.3 (CE) the following paragraph:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;p&amp;amp;gt;Some elements bear specialized &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; or &amp;amp;lt;att&amp;amp;gt;agent&amp;amp;lt;/att&amp;amp;gt;&lt;br /&gt;
      attributes, which have specific meanings that vary from element to&lt;br /&gt;
      element; the &amp;amp;lt;gi&amp;amp;gt;respons&amp;amp;lt;/gi&amp;amp;gt; element should be reserved for the general&lt;br /&gt;
      aspects of responsibility common to all text transcription and&lt;br /&gt;
      markup, and should not be confused with the more specific attributes on&lt;br /&gt;
      individual elements.&amp;amp;lt;/p&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
10. In 3.4.1 (CO), change this part of an example:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;respStmt&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;resp&amp;amp;gt;editor&amp;amp;lt;/resp&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;name xml:id=&amp;quot;msm&amp;quot;&amp;amp;gt;C.M. Sperberg-McQueen&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/respStmt&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      &amp;amp;lt;respStmt xml:id=&amp;quot;msm&amp;quot;&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;resp&amp;amp;gt;editor&amp;amp;lt;/resp&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;name&amp;amp;gt;C.M. Sperberg-McQueen&amp;amp;lt;/name&amp;amp;gt;&lt;br /&gt;
      &amp;amp;lt;/respStmt&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to show the more robust recommended use of @resp to point to a respStmt rather than just a name. Then change the following comment from this:&lt;br /&gt;
&lt;br /&gt;
      Here the &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute&lt;br /&gt;
      has been used to indicate responsibility for the &lt;br /&gt;
      correction. Its value (&amp;amp;lt;val&amp;amp;gt;#msm&amp;amp;lt;/val&amp;amp;gt;) is an &lt;br /&gt;
      example of the &amp;amp;lt;term&amp;amp;gt;pointer&amp;amp;lt;/term&amp;amp;gt; values discussed&lt;br /&gt;
      in section &amp;amp;lt;ptr target=&amp;quot;#COXR&amp;quot;/&amp;amp;gt;; in this case, &lt;br /&gt;
      it points to a &amp;amp;lt;gi&amp;amp;gt;name&amp;amp;lt;/gi&amp;amp;gt; element within the TEI &lt;br /&gt;
      header, but any element might be indicated in this way, &lt;br /&gt;
      including for example a &amp;amp;lt;gi&amp;amp;gt;person&amp;amp;lt;/gi&amp;amp;gt; element (if the &lt;br /&gt;
      module described in &amp;amp;lt;ptr target=&amp;quot;#ND&amp;quot;/&amp;amp;gt; has been included), &lt;br /&gt;
      or one of the bibliographic elements described in &lt;br /&gt;
      &amp;amp;lt;ptr target=&amp;quot;#COBI&amp;quot;/&amp;amp;gt;, if the correction has been taken &lt;br /&gt;
      from some other source. The &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute is&lt;br /&gt;
      available for all elements which are members of the &lt;br /&gt;
      &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
      Here the &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute&lt;br /&gt;
      has been used to indicate responsibility for the &lt;br /&gt;
      correction. Its value (&amp;amp;lt;val&amp;amp;gt;#msm&amp;amp;lt;/val&amp;amp;gt;) is an &lt;br /&gt;
      example of the &amp;amp;lt;term&amp;amp;gt;pointer&amp;amp;lt;/term&amp;amp;gt; values discussed&lt;br /&gt;
      in section &amp;amp;lt;ptr target=&amp;quot;#COXR&amp;quot;/&amp;amp;gt;; in this case, &lt;br /&gt;
      it points to a &amp;amp;lt;gi&amp;amp;gt;respStmt&amp;amp;lt;/gi&amp;amp;gt; element within the TEI &lt;br /&gt;
      header, but any element might be indicated in this way, &lt;br /&gt;
      including for example a &amp;amp;lt;gi&amp;amp;gt;name&amp;amp;lt;/gi&amp;amp;gt; element, or (if the &lt;br /&gt;
      module described in &amp;amp;lt;ptr target=&amp;quot;#ND&amp;quot;/&amp;amp;gt; has been included) a &lt;br /&gt;
      &amp;amp;lt;gi&amp;amp;gt;person&amp;amp;lt;/gi&amp;amp;gt; element. &lt;br /&gt;
      The &amp;amp;lt;att&amp;amp;gt;resp&amp;amp;lt;/att&amp;amp;gt; attribute is&lt;br /&gt;
      available for all elements which are members of the &lt;br /&gt;
      &amp;amp;lt;ident type=&amp;quot;class&amp;quot;&amp;amp;gt;att.responsibility&amp;amp;lt;/ident&amp;amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
Note the removal of the section about a bibliographical source, which I believe should be addressed using @source; when the issue of a global @source is addressed, this section may be modified again.&lt;br /&gt;
&lt;br /&gt;
===SUPPORTED CUSTOMIZATIONS===&lt;br /&gt;
&lt;br /&gt;
1. In tei_tite.odd, change this:&lt;br /&gt;
&lt;br /&gt;
           &amp;amp;lt;classSpec ident=&amp;quot;att.responsibility&amp;quot; mode=&amp;quot;delete&amp;quot; module=&amp;quot;tei&amp;quot; type=&amp;quot;atts&amp;quot;/&amp;amp;gt;&lt;br /&gt;
           &amp;amp;lt;!-- removes @atLeast @cert @resp --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to this:&lt;br /&gt;
&lt;br /&gt;
           &amp;amp;lt;classSpec ident=&amp;quot;att.global.responsibility&amp;quot; mode=&amp;quot;delete&amp;quot; module=&amp;quot;tei&amp;quot; type=&amp;quot;atts&amp;quot;/&amp;amp;gt;&lt;br /&gt;
           &amp;amp;lt;!-- removes @cert @resp --&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
(I believe the mention of @atLeast in the comment to be erroneous.)&lt;br /&gt;
&lt;br /&gt;
===BUILD TESTS===&lt;br /&gt;
&lt;br /&gt;
Add to the build process a couple of tests for the use of @resp &lt;br /&gt;
and @cert in contexts where they were not previously allowed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
END OF IMPLEMENTATION PLAN&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==PREVIOUS CONTENT==&lt;br /&gt;
&lt;br /&gt;
===Proposal for a Global @resp attribute===&lt;br /&gt;
&lt;br /&gt;
This page summarizes the discussions of LB, HC and MH on [http://sourceforge.net/p/tei/feature-requests/443/Feature request 443].&lt;br /&gt;
&lt;br /&gt;
==THE PROBLEM PART 1: @resp==&lt;br /&gt;
&lt;br /&gt;
Many, many users want to use @resp all over the place; but the current meaning of @resp is already confusingly dependent on its context:&lt;br /&gt;
&lt;br /&gt;
 @resp: &amp;quot;(responsible party) indicates the agency responsible for the intervention or interpretation, for example an editor or transcriber.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the Glines, we have examples of @resp use to express responsibility for:&lt;br /&gt;
&lt;br /&gt;
*editorial interventions such as &amp;lt;corr&amp;gt;, &amp;lt;ex&amp;gt;, &amp;lt;supplied&amp;gt;&lt;br /&gt;
*specifying a &amp;lt;spanGrp&amp;gt; or &amp;lt;interpGrp&amp;gt;&lt;br /&gt;
*writing a &amp;lt;note&amp;gt;&lt;br /&gt;
*identifying a &amp;lt;persName&amp;gt; as such&lt;br /&gt;
*specifying the place and date of someone's birth (&amp;lt;event&amp;gt;)&lt;br /&gt;
*counting the populations of red and grey squirrels between specific dates (&amp;lt;population&amp;gt;)&lt;br /&gt;
*providing supplementary info about a witness (&amp;lt;witDetail&amp;gt;)&lt;br /&gt;
*writing an abstract (&amp;lt;abstract&amp;gt;)&lt;br /&gt;
*describing the origin of a MS (&amp;lt;origin&amp;gt;)&lt;br /&gt;
*the entire act of transcribing and encoding a passage (&amp;lt;respons&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
and many more things. Sometimes @resp refers to manipulating text in an editorial capacity; sometimes to making judgements and applying markup; and sometimes to providing information or explanation.&lt;br /&gt;
&lt;br /&gt;
There is clearly a need to allow people to use @resp globally. Since our own Glines show examples of it to describe the complete act of transcribing and encoding, it makes no sense to limit its context such that it could not be used for any of the component elements of an encoded text; and since we already have examples of its use in the header, there is no reason to exclude that either. Since there are examples of its use to specify responsibility for the selection and application of a TEI tag, there is no reason to prevent a user from assigning responsibility for the application of any TEI tag; ergo the attribute should be global.&lt;br /&gt;
&lt;br /&gt;
The problem of what @resp refers to in any specific context remains, but the examples from the &amp;lt;respons&amp;gt; spec provide a straightforward solution: rather than pointing directly to an agent, @resp should point to a &amp;lt;respStmt&amp;gt;, in which the nature of the responsibility is clear in the &amp;lt;resp&amp;gt;(s).&lt;br /&gt;
&lt;br /&gt;
==THE PROBLEM PART 2: @cert==&lt;br /&gt;
&lt;br /&gt;
att.responsibility also contains @cert. Should this also be global?&lt;br /&gt;
&lt;br /&gt;
Given that whenever we assign responsibility for something to an agent, there is always the possibility that we are not certain about it, then there is no context in which @resp could be used without the possible need for @cert. Therefore @cert should also be global.&lt;br /&gt;
&lt;br /&gt;
The solution:&lt;br /&gt;
&lt;br /&gt;
# Promote att.responsibility to att.global.responsibility, and make it a member of att.global.&lt;br /&gt;
# Add a note to @resp recommending that wherever possible it point not directly to an agent but to a &amp;lt;respStmt&amp;gt;.&lt;br /&gt;
# Add several examples to the att.responsibility specification showing a variety of uses of @resp pointing to &amp;lt;respStmt&amp;gt;.&lt;br /&gt;
# Update all references to att.responsibility in the Glines prose (e.g. in Names and Dates, we have &amp;quot;Some members of the att.naming class are also members of the att.responsibility class, from which they inherit the following attributes...&amp;quot;&lt;br /&gt;
# Look at all chapter sections which address the use of att.[global.]responsibility attributes and make any required changes, including suggesting that @resp point at &amp;lt;respStmt&amp;gt; where this is appropriate. This includes Chapters 3, 13, and 17.&lt;br /&gt;
# Expand 21.3 (http://www.tei-c.org/release/doc/tei-p5-doc/en/html/CE.html#CERESP), &amp;quot;Attribution of responsibility&amp;quot;, so that it also mentions the use of @resp as a simpler alternative to a full &amp;lt;respons&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
==PERIPHERAL ISSUE: @source==&lt;br /&gt;
&lt;br /&gt;
We have had some discussions about whether it makes sense for @source to be global along with @resp and @cert. This is based on the notion that, if you're assigning responsibility to someone for something, and expressing some uncertainty about it, you may well wish to say on what source you're basing the assertion. We disagree about the need for this. &lt;br /&gt;
&lt;br /&gt;
HC contends that in any place one might want to indicate an intellectual contribution by an editor/encoder of the document, one might equally well want to cite an external authority for that contribution. HC also feels @source has a stronger argument for universality than @cert.&lt;br /&gt;
&lt;br /&gt;
MH is also close to being convinced of this. Since it involves a different attribute class, though, we could deal with it in a separate ticket.&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14011</id>
		<title>Council agenda 2014-11</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14011"/>
		<updated>2014-11-16T18:27:39Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Tuesday 18 November 2014 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Draft Agenda for TEI Technical Council Meeting 2014-11-17 to 2014-11-19=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Monday 17 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* TEI Simple&lt;br /&gt;
* Pure ODD&lt;br /&gt;
    Apologies: discussion of contextual dependency issues not yet started.&lt;br /&gt;
    Do we need &amp;lt;textNode&amp;gt;? or &amp;lt;mixedContent&amp;gt;? Decision is holding up completion of [http://tei.it.ox.ac.uk/Oxford/2014-10-odds/pureODDtutorial.xml [introductory tutorial]].&lt;br /&gt;
* TEI DH2015 HackAThon&lt;br /&gt;
* Correspondence&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:00 - 14:30 &lt;br /&gt;
* Lunch &lt;br /&gt;
14:30 - 16:00 (15:30 - Tea Break)&lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
16:00 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00- Dinner at Josh Sosin's house. HC will pick up from the hotel at 18:15&lt;br /&gt;
&lt;br /&gt;
== Tuesday 18 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* JTEI Schema and authoring package: should the schema be adopted as an &amp;quot;official&amp;quot; customization, and should the authoring package be integrated into the oxygen-tei plugin? (MH)&lt;br /&gt;
* Global @resp and friends (MH, LB, HC)&lt;br /&gt;
* LOC date attrs (SB; see [http://loc.gov/standards/datetime/pre-submission.html LOC draft standard])&lt;br /&gt;
* ISO-TEI Workgroup on Speech Transcription (LB; see [http://bit.ly/1jyZC37 &amp;quot;final draft oct 2014&amp;quot;]) recommends one new element.&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Tickets&lt;br /&gt;
13:00 - 14:00 &lt;br /&gt;
* Lunch ?&lt;br /&gt;
14:00 - 17:00 &lt;br /&gt;
* Tickets Discussion&lt;br /&gt;
18:00-&lt;br /&gt;
* DInner @ 19:00? Possibilities include Dos Perros (http://dosperrosrestaurant.com/); Bull City Burger and Brewery (http://www.bullcityburgerandbrewery.com/Bull_City_Burger_and_Brewery/Home.html); many others&lt;br /&gt;
&lt;br /&gt;
== Wednesday 19 November 2014 == &lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* Presentation on how OxGarage works (JC)&lt;br /&gt;
* TEI Validation Service (PSt)&lt;br /&gt;
* Critical Apparatus proposal update (HC)&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:10 - 14:30 &lt;br /&gt;
* Lunch (?)&lt;br /&gt;
14:30 - 15:30 &lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
15:30&lt;br /&gt;
* tea break&lt;br /&gt;
15:30 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00 - &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14010</id>
		<title>Council agenda 2014-11</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14010"/>
		<updated>2014-11-16T18:15:33Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Monday 17 November 2014 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Draft Agenda for TEI Technical Council Meeting 2014-11-17 to 2014-11-19=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Monday 17 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* TEI Simple&lt;br /&gt;
* Pure ODD&lt;br /&gt;
    Apologies: discussion of contextual dependency issues not yet started.&lt;br /&gt;
    Do we need &amp;lt;textNode&amp;gt;? or &amp;lt;mixedContent&amp;gt;? Decision is holding up completion of [http://tei.it.ox.ac.uk/Oxford/2014-10-odds/pureODDtutorial.xml [introductory tutorial]].&lt;br /&gt;
* TEI DH2015 HackAThon&lt;br /&gt;
* Correspondence&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:00 - 14:30 &lt;br /&gt;
* Lunch &lt;br /&gt;
14:30 - 16:00 (15:30 - Tea Break)&lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
16:00 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00- Dinner at Josh Sosin's house. HC will pick up from the hotel at 18:15&lt;br /&gt;
&lt;br /&gt;
== Tuesday 18 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* JTEI Schema and authoring package: should the schema be adopted as an &amp;quot;official&amp;quot; customization, and should the authoring package be integrated into the oxygen-tei plugin? (MH)&lt;br /&gt;
* Global @resp and friends (MH, LB, HC)&lt;br /&gt;
* LOC date attrs (SB; see [http://loc.gov/standards/datetime/pre-submission.html LOC draft standard])&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Tickets&lt;br /&gt;
13:00 - 14:00 &lt;br /&gt;
* Lunch ?&lt;br /&gt;
14:00 - 17:00 &lt;br /&gt;
* Tickets Discussion&lt;br /&gt;
18:00-&lt;br /&gt;
* DInner @ 19:00? Possibilities include Dos Perros (http://dosperrosrestaurant.com/); Bull City Burger and Brewery (http://www.bullcityburgerandbrewery.com/Bull_City_Burger_and_Brewery/Home.html); many others&lt;br /&gt;
&lt;br /&gt;
== Wednesday 19 November 2014 == &lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* Presentation on how OxGarage works (JC)&lt;br /&gt;
* TEI Validation Service (PSt)&lt;br /&gt;
* Critical Apparatus proposal update (HC)&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:10 - 14:30 &lt;br /&gt;
* Lunch (?)&lt;br /&gt;
14:30 - 15:30 &lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
15:30&lt;br /&gt;
* tea break&lt;br /&gt;
15:30 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00 - &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14009</id>
		<title>Council agenda 2014-11</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_agenda_2014-11&amp;diff=14009"/>
		<updated>2014-11-16T18:10:34Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Monday 17 November 2014 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Draft Agenda for TEI Technical Council Meeting 2014-11-17 to 2014-11-19=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Monday 17 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* TEI Simple&lt;br /&gt;
* Pure ODD&lt;br /&gt;
   Do we need &amp;lt;textNode&amp;gt;? or &amp;lt;mixedContent&amp;gt;? Decision is holding up completion of [http://tei.it.ox.ac.uk/Oxford/2014-10-odds/pureODDtutorial.xml [introductory tutorial]].&lt;br /&gt;
* TEI DH2015 HackAThon&lt;br /&gt;
* Correspondence&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:00 - 14:30 &lt;br /&gt;
* Lunch &lt;br /&gt;
14:30 - 16:00 (15:30 - Tea Break)&lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
16:00 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00- Dinner at Josh Sosin's house. HC will pick up from the hotel at 18:15&lt;br /&gt;
&lt;br /&gt;
== Tuesday 18 November 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* JTEI Schema and authoring package: should the schema be adopted as an &amp;quot;official&amp;quot; customization, and should the authoring package be integrated into the oxygen-tei plugin? (MH)&lt;br /&gt;
* Global @resp and friends (MH, LB, HC)&lt;br /&gt;
* LOC date attrs (SB; see [http://loc.gov/standards/datetime/pre-submission.html LOC draft standard])&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Tickets&lt;br /&gt;
13:00 - 14:00 &lt;br /&gt;
* Lunch ?&lt;br /&gt;
14:00 - 17:00 &lt;br /&gt;
* Tickets Discussion&lt;br /&gt;
18:00-&lt;br /&gt;
* DInner @ 19:00? Possibilities include Dos Perros (http://dosperrosrestaurant.com/); Bull City Burger and Brewery (http://www.bullcityburgerandbrewery.com/Bull_City_Burger_and_Brewery/Home.html); many others&lt;br /&gt;
&lt;br /&gt;
== Wednesday 19 November 2014 == &lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* Presentation on how OxGarage works (JC)&lt;br /&gt;
* TEI Validation Service (PSt)&lt;br /&gt;
* Critical Apparatus proposal update (HC)&lt;br /&gt;
10:30 - 10:45&lt;br /&gt;
* Tea Break&lt;br /&gt;
10:45 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:10 - 14:30 &lt;br /&gt;
* Lunch (?)&lt;br /&gt;
14:30 - 15:30 &lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
15:30&lt;br /&gt;
* tea break&lt;br /&gt;
15:30 - 17:00 &lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00 - &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_agenda_2014-10&amp;diff=13828</id>
		<title>Council agenda 2014-10</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_agenda_2014-10&amp;diff=13828"/>
		<updated>2014-10-03T09:33:59Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Teleconference Agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Teleconference Agenda== &lt;br /&gt;
* TEI Conference, Members Meeting, and Elections (JC)&lt;br /&gt;
* TEI Simple (SR)&lt;br /&gt;
* Update on CorrespDesc (PWS)&lt;br /&gt;
* November Face to Face (HC)&lt;br /&gt;
* Outstanding issues in Pure ODD  (LB)&lt;br /&gt;
*  &lt;br /&gt;
*  your items here&lt;br /&gt;
* &lt;br /&gt;
*  &lt;br /&gt;
* AOB&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Council_agenda_2014-06&amp;diff=13511</id>
		<title>Council agenda 2014-06</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Council_agenda_2014-06&amp;diff=13511"/>
		<updated>2014-06-29T12:21:31Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Tuesday 1 July 2014 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Draft Agenda for TEI Technical Council Meeting 2014-06-30 to 2014-07-02.=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Monday 30 June 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* TEI Simple&lt;br /&gt;
* PureODD: Can Lou tell us where we're at and where we're going, and Sebastian talk about implementation (working, planned, and blue-sky)?&lt;br /&gt;
** whether it makes sense to have @allowText on sub elements of &amp;lt;content&amp;gt;&lt;br /&gt;
** what  a set of elementRef as direct  children of &amp;lt;content&amp;gt; means&lt;br /&gt;
** what the same thing means with @allowText&lt;br /&gt;
** when and how to convert Gidlines to Pure ODD&lt;br /&gt;
** testing testing testing&lt;br /&gt;
* TEI DH2014 HackAThon&lt;br /&gt;
15:00 - 17:00&lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00-&lt;br /&gt;
* Picnic in University Parks. (James will lead from Rewley House)&lt;br /&gt;
&lt;br /&gt;
== Tuesday 1 July 2014 ==&lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* Text directionality additions: final reading and approval &lt;br /&gt;
* Update on ISO Speech transcription proposal (http://bit.ly/1jyZC37)&lt;br /&gt;
* Update on TBX ODD &lt;br /&gt;
* Global Applicability of att.responsibility&lt;br /&gt;
* Autumn Face-to-Face meeting&lt;br /&gt;
10:30 - 13:00 &lt;br /&gt;
* Tickets&lt;br /&gt;
13:00 - 14:00 &lt;br /&gt;
* Lunch (Rewley Dining Room)&lt;br /&gt;
14:00 - 15:00 &lt;br /&gt;
* Tickets Recap or other discussion&lt;br /&gt;
15:00 - 17:00&lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00-&lt;br /&gt;
* Supper: Old Bookbinders Ale House http://oldbookbinders.co.uk/&lt;br /&gt;
&lt;br /&gt;
== Wednesday 2 July 2014 == &lt;br /&gt;
09:00 - 10:30&lt;br /&gt;
* MDH on Guidelines translation (with help from FC): Italian and German teams are not making much progress. Is there anything we can do?&lt;br /&gt;
* TEI Standoff and Linked Data representations&lt;br /&gt;
* TEI Future Developments (e.g. Roadmap to P6, Bluesky thinking, etc.)&lt;br /&gt;
10:30 - 13:00 &lt;br /&gt;
* Ticket Discussion and Assignment&lt;br /&gt;
13:00 - 14:30 &lt;br /&gt;
* Lunch (Pierre Victoire)&lt;br /&gt;
14:30 - 15:00 &lt;br /&gt;
* Tickets Recap and other discussion&lt;br /&gt;
15:00 - 17:00&lt;br /&gt;
* Ticket implementation or other TEI Work&lt;br /&gt;
18:00 - &lt;br /&gt;
* Supper: restaurant to be agreed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13356</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13356"/>
		<updated>2014-04-28T12:47:40Z</updated>

		<summary type="html">&lt;p&gt;Lou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]] is now (28 April 2014) in the process of being transferred to the TEI svn repository  where it will appear as a new section in file Source/Guidelines/en/WD-NonStandardCharacters.xml&lt;br /&gt;
&lt;br /&gt;
 '''Please do not make further changes here.'''&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
See the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to bottom within the line, with their lines sequenced from right to left. Although modern Japanese, Chinese, and Korean are often written horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed vertically and sometimes horizontally. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.] [If the encoder knows that the glyph or character concerned has a strongly ltr character then they should use the &amp;amp;lt;charProp&amp;gt; element to document this fact within the &amp;amp;lt;glyph&amp;gt; or &amp;amp;lt;char&amp;gt; definition, as per http://www.tei-c.org/release/doc/tei-p5-doc/en/html/WD.html#ucsprops. If they want a rendering agent to deal with the character properly, they are at liberty to put a strongly ltr character as content for the &amp;amp;lt;g&amp;gt; ]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13348</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13348"/>
		<updated>2014-04-26T15:20:19Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Horizontal directionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to bottom within the line, with their lines sequenced from right to left. Although modern Japanese, Chinese, and Korean are often written horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed vertically and sometimes horizontally. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.] [If the encoder knows that the glyph or character concerned has a strongly ltr character then they should use the &amp;amp;lt;charProp&amp;gt; element to document this fact within the &amp;amp;lt;glyph&amp;gt; or &amp;amp;lt;char&amp;gt; definition, as per http://www.tei-c.org/release/doc/tei-p5-doc/en/html/WD.html#ucsprops. If they want a rendering agent to deal with the character properly, they are at liberty to put a strongly ltr character as content for the &amp;amp;lt;g&amp;gt; ]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13347</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13347"/>
		<updated>2014-04-26T15:11:29Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Vertical text with embedded horizontal text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to bottom within the line, with their lines sequenced from right to left. Although modern Japanese, Chinese, and Korean are often written horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed vertically and sometimes horizontally. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13346</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13346"/>
		<updated>2014-04-26T14:58:42Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to bottom within the line, with their lines sequenced from right to left. Although modern Japanese, Chinese, and Korean are often written horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed vertically and sometimes horizontally. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13345</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13345"/>
		<updated>2014-04-26T14:55:03Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to bottom within the line, with their lines sequenced from right to left. Although modern Japanese, Chinese, and Korean are often written horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal orientation. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13344</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13344"/>
		<updated>2014-04-26T14:54:22Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions in which the same language may appear in different modes, for example either vertically or horizontally. East Asian scripts were traditionally written from top to&lt;br /&gt;
    bottom within the line, with their lines sequenced from right to&lt;br /&gt;
    left. Although modern Japanese, Chinese, and Korean are often written&lt;br /&gt;
    horizontally, the traditional vertical writing mode is still widely used. There are also comparatively rare cases of ancient scripts written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or scripts such as Ogham where the writing direction is from bottom to top around the edge of an inscribed object. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal orientation. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13328</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13328"/>
		<updated>2014-04-23T11:05:54Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Horizontal directionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is possible that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts; for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal orientation. The writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will usually imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. The order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardized way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem: first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script); and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: upright&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; specifies that &amp;quot;characters from horizontal-only scripts are rendered upright, i.e. in their standard horizontal orientation. Characters from vertical scripts are set with their intrinsic orientation and shaped normally&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
[Question MDH to LB: Why is this bit detached from the original horizontal text section above? Because he section above isn't specifically about horizontal texts only, though it uses one as an initial example]&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely] [(MDH) A &amp;lt;g&amp;gt; element would normally be used for a glyph which has no Unicode representation; therefore it has no directionality per the Unicode character database; therefore its effect would be potentially disruptive. Imagine a case where a rtl text run ends with a weak-directionality character such as a period, followed by a &amp;lt;g&amp;gt; for a glyph which the encoder knows should represent an rtl character, but which isn't in Unicode, followed by a strongly ltr character.]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI, which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13314</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13314"/>
		<updated>2014-04-21T17:08:52Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Caveats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
As with other parts of the CSS specification, the intended effect of CSS Transforms properties and values are defined with reference to a specific [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model]; the language is designed to describe how an HTML document should be formatted. This is not, of course, the case for the TEI which lacks any explicit processing or formatting model, and attempts to define objects as far as possible without consideration of their visual appearance. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not particularly problematic. CSS provides a useful and well-defined vocabulary to describe many aspects of the appearance of source texts, benefitting particularly from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13313</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13313"/>
		<updated>2014-04-21T16:59:46Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Boustrophedon */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΗΕΡΜΟΝΤΙΝA&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΕΝΟΣΥΕΝΕΑϜ&lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΡΕΤΑΙΑΣΟΝΑ &lt;br /&gt;
     &amp;lt;lb/&amp;gt;&amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &lt;br /&gt;
     &amp;lt;lb/&amp;gt;ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13312</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13312"/>
		<updated>2014-04-21T16:55:22Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Rotation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. This CSS module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13311</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13311"/>
		<updated>2014-04-21T16:53:00Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Horizontal directionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
   means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?] [how might a &amp;lt;g&amp;gt; element introduce ambiguity? only if the glyph or character concerned is vague about its directionality surely]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13310</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13310"/>
		<updated>2014-04-21T16:49:04Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Bottom-to-top writing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
Of the rather small number of scripts which appear to be written bottom-to-top, perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
[can't we find an Ogham example? ]&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13309</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13309"/>
		<updated>2014-04-21T16:47:02Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Vertical orientation in horizontal scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where no vertically-written script is involved. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode the third of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Cash Value&lt;br /&gt;
    &amp;lt;lb/&amp;gt;of&lt;br /&gt;
    &amp;lt;lb/&amp;gt;Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its lines are to be read from left to right (so the line containing &amp;quot;of&amp;quot; is to the right of that containing &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13308</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13308"/>
		<updated>2014-04-21T16:40:38Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Vertical text with embedded horizontal text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters, in particular for punctuation which needs to be positioned differently in vertical and in horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages which are normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
The text-orientation property allows us to indicate whether or not glyphs are rotated. In the following example, we have indicated that the list uses a vertical-rl writing mode, but that the orientation of individual glyphs may vary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). Since the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, this rule is not strictly required. However,  if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then an encoding like the following could be used to make this explicit:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot; style=&amp;quot;text-orientation:upright&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13307</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13307"/>
		<updated>2014-04-21T16:30:50Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Vertical writing modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of Japanese), or left-to-right (as in the case of Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity, we have not attempted to capture in this encoding such aspects as the indenting of lines in the first Japanese version, or the central alignment of the other two versions, nor any other renditional features such as font weight or size etc.  The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13306</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13306"/>
		<updated>2014-04-21T14:32:17Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
The CSS recommendations provides several properties which can be used to encode aspects of the &amp;quot;writing mode&amp;quot;. The most useful of these is the property &amp;quot;writing-mode&amp;quot; which may be used to specify a reading-order for both characters within a single line and lines within a single block of text.  The property &amp;quot;text-orientation&amp;quot; may also used to indicate the orientation of individual characters with respect to the line, and the property &amp;quot;direction&amp;quot; to determine the reading order of characters within a line only. We give some examples of each below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
The writing-mode property is particularly useful for languages which can be written in different writing modes, such as Chinese and Japanese. It has the following possible values:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each value has two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). &lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13305</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13305"/>
		<updated>2014-04-21T14:04:34Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (we use this term to refer to the orientation of individual glyphs within a line and the order in which they should be read), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
As we noted above, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusual examples running bottom-to-top). Another CSS property, called the writing mode, can be used to specify this:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property have two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). Both Chinese and Japanese can be written in different writing modes, and the ability to encode which has been used in a given document is therefore very useful.&lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13304</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13304"/>
		<updated>2014-04-21T13:56:56Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the way (or ways) that those glyphs are arranged on the writing surface. For the majority of modern languages, writing is arranged as a series of lines which are to be read from top to bottom. Within each line, individual characters are frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). Writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to Unicode character  U+FE11, the vertical mode comma. This ensures that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example when a language using Roman script is embedded within vertically organized Chinese text, it may sometimes be displayed in vertical and sometimes in horizontal writing mode. And the writing mode may also vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this] [if we cannot find substantial evidence to support this recommendation we should imho drop it. LB]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. T he order in which the Arabic characters appear when rendered would be the same, even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because Arabic glyphs are always displayed right to left, even when they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a strong left-to-right bidirectionality setting, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes). These additional codepoints can be used to signal to rendering software that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code for each. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section [ref to #STGAre here] ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this W3C module has the status of a candidate recommendation: see further http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties associated with writing modes, notably :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in [ref to #HD57-1 here]). Although the CSS specifications are mainly used to provide instructions for software when rendering a digital text, they also provide a useful means of describing the visual properties of a pre-existing document in a formal and standardised way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will probably include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
As we noted above, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusual examples running bottom-to-top). Another CSS property, called the writing mode, can be used to specify this:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property have two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). Both Chinese and Japanese can be written in different writing modes, and the ability to encode which has been used in a given document is therefore very useful.&lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13132</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13132"/>
		<updated>2014-04-01T19:55:47Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Text directionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. Even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the order in which the Arabic characters appear when rendered would be the same. This is because Arabic glyphs are always displayed right to left, even if they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), which are additional codepoints whose function is to signal to a user-agent that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section ?? ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this module has the status of a candidate recommendation: see http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties listed here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in section ??). Although the CSS specifications are written primarily to provide instructions for the use of software when rendering a digital text, it is also a useful as a means of describing the visual properties of a pre-existing document in a formal way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will also include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;direction: rtl; unicode-bidi: embed&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to record the observed directionality of the text is unambiguous, even though it is (as we noted above) superfluous. &amp;lt;ref&amp;gt;The use of the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property here may require some explanation. By default this property has the value &amp;quot;normal&amp;quot;, the effect of which in this context would be to ignore any value supplied for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property. The CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mixed directionality is very common in languages such as Arabic and Hebrew, particularly when numbers (which are always given LTR) or phrases from other LTR languages are embedded, and it is quite unusual though not impossible for ambiguities to arise.  &lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
As we noted above, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusual examples running bottom-to-top). Another CSS property, called the writing mode, can be used to specify this:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property have two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence are arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). Both Chinese and Japanese can be written in different writing modes, and the ability to encode which has been used in a given document is therefore very useful.&lt;br /&gt;
&lt;br /&gt;
The following example shows three versions of the same poem, first in Japanese, written top to bottom; next in  Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
We might encode this as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13131</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13131"/>
		<updated>2014-04-01T18:57:04Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. Even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the order in which the Arabic characters appear when rendered would be the same. This is because Arabic glyphs are always displayed right to left, even if they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), which are additional codepoints whose function is to signal to a user-agent that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the rightmost end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code. In situations where this approach may result in ambiguity or lack of precision, or if the encoder wishes to record directional information explicitly in their encoding, we recommend using the global @style attribute to supply detail about the writing mode applicable to the content of any element. The @style attribute (discussed in section ?? ) permits use of any formatting language; for these purposes however, we recommend use of CSS, which now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this module has the status of a candidate recommendation: see http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties listed here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). Rather than specify it on every element, it will often be more efficient, to express sets of commonly-used styling rules as &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and then point to them using the global @rendition attribute (see further the discussion in section ??). Although the CSS specifications are written primarily to provide instructions for the use of software when rendering a digital text, it is also a useful as a means of describing the visual properties of a pre-existing document in a formal way. &lt;br /&gt;
&lt;br /&gt;
In the next section, we present some examples of how CSS can be used to describe a variety of writing modes. A full description of the appearance of a document will also include many other properties of course.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13124</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13124"/>
		<updated>2014-03-31T13:02:43Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language normally uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. Even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the order in which the Arabic characters appear when rendered would be the same. This is because Arabic glyphs are always displayed right to left, even if they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks such as the period or comma for example) have weak or neutral settings because they may appear in several contexts. &lt;br /&gt;
&lt;br /&gt;
The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render sequences of characters which have differing directionality properties in a predictable and reliable way, using only those properties. &amp;lt;ref&amp;gt;Because this algorithm may not always give the desired result, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), which are additional codepoints whose function is to signal to a user-agent that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available.&amp;quot; (http://www.w3.org/International/questions/qa-bidi-controls)&amp;lt;/ref&amp;gt;. It should be remembered however that individual sequences of characters are always stored in a file in the order in which they should be read, irrespective of the order in which the characters making up a sequence should be displayed or rendered. For example, in a RTL language such as Hebrew, the first character in a file will be that which is displayed at the end of the first line of text.&lt;br /&gt;
&lt;br /&gt;
An encoder wishing to document or to control the order in which sequences of characters in a TEI document are displayed will usually do so by segmenting the text into sequences presented in the desired order and specifying an appropriate language code. In situations where this approach may result in ambiguity or lack of precision, we recommend using the @style attribute to supply more precise directionality information. The @style attribute (discussed in section ?? of the Guidelines) permits use of any formatting language; for these purposes however, we recommend use of CSS, since this now includes a Writing Modes module &amp;lt;ref&amp;gt;At the time of writing, this module has the status of a candidate recommendation: see http://dev.w3.org/csswg/css-writing-modes/ &amp;lt;/ref&amp;gt; which permits direct specification of a number of useful properties :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The global TEI @style attribute applies to the element on which it is specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13067</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13067"/>
		<updated>2014-03-27T17:56:04Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. Even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the order in which the Arabic characters appear will be the same. This is because Arabic glyphs are to be read left to right, even if they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks, for example) have weak or neutral settings because they may appear in several contexts. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render these bidirectional texts with predictable and reliable results, using only the bidirectionality class values of their glyphs. Because this algorithm is not always infallible, Unicode also provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), which are additional codepoints whose function is to signal to a user-agent that a specific directionality setting should be turned on or off. However, in the case of documents encoded in XML, there is no need to use such characters, and in fact the W3C explicitly advises against it. &amp;lt;ref&amp;gt;&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
. We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13066</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13066"/>
		<updated>2014-03-27T17:32:00Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different languages are combined, it is probable that different writing modes will be needed: for example, in Hebrew text, running right to left, sequences of Latin digits still run left to right. When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A correct TEI encoding might read as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;s xml:lang=&amp;quot;en&amp;quot; &amp;gt;The Arabic term &lt;br /&gt;
  &amp;lt;term xml:lang=&amp;quot;ar&amp;quot; &amp;gt;قلم رصاص&amp;lt;/term&amp;gt;  &lt;br /&gt;
  means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We might assume that it is the presence of the xml:lang attribute with value &amp;quot;ar&amp;quot; that causes processing software to display the Arabic from right to left, but in fact, this is not the case. Even if the markup were not present:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;s&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/s&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the order in which the Arabic characters appear will be the same. This is because Arabic glyphs are to be read left to right, even if they appear within a left-to-right English sentence. Like most other codepoints in the Unicode standard, they have a specific directionality setting which helps any rendering software determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right, as do the digits 0 to 9; the Hebrew א (alef) is strongly right-to-left. Of course, some glyphs (common punctuation marks, for example) have weak or neutral settings because they may appear in several contexts. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) defines a number of rules enabling software to render these bidirectional texts with predictable and reliable results, using only the bidirectionality class values of their glyphs.&lt;br /&gt;
&lt;br /&gt;
In some mixed-mode texts, though, the Bidirectional Algorithm may not give the desired results. To deal with this, Unicode provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), also called &amp;quot;bidi formatting code characters&amp;quot;, which are additional codepoints whose only function is to signal to a user-agent that a specific directionality setting should be turned on or off. These can be inserted into a text to influence the outcome of the bidirectional algorithm. However, in the case of documents encoded in XML, the W3C explicitly advises that markup rather than directional formatting characters should be used (&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls). We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13065</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13065"/>
		<updated>2014-03-27T16:03:58Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, just as it may vary in response to the size and shape of the carrier in the case of a monumental inscription. &lt;br /&gt;
&lt;br /&gt;
For many, perhaps most, TEI documents there may be no need to encode the writing mode explicitly, even in so-called &amp;quot;mixed mode&amp;quot; texts containing passages written in languages which use different writing modes. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; while Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom.  In a TEI document, language and script are explicitly stated in the markup using the attribute xml:lang (reference); this indication will imply a particular default writing mode.  Even where this attribute is not used, passages in different scripts will use different Unicode characters, and will thus imply a particular default writing mode. Nevertheless, the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). &lt;br /&gt;
&lt;br /&gt;
Consider the case of an English text containing a few Arabic words--what is termed a &amp;quot;bidirectional&amp;quot; text:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Arabic is always written from right to left, we can assume that the Arabic glyphs are to be read in that direction, even if they are in the context of a left-to-right English sentence. In fact, most codepoints in the Unicode standard have a specific directionality setting which helps any rendering engine to determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right; the Hebrew א (alef) is strongly right-to-left. Other glyphs have weak or neutral settings because of the contexts in which they may appear. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) provides a complex series of rules enabling user agents to render most mixed-mode texts with predictable and reliable results, based on the bidirectionality class values of their glyphs.&lt;br /&gt;
&lt;br /&gt;
In some mixed-mode texts, though, the Bidirectional Algorithm may not give the desired results. To deal with this, Unicode provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), also called &amp;quot;bidi formatting code characters&amp;quot;, which are additional codepoints whose only function is to signal to a user-agent that a specific directionality setting should be turned on or off. These can be inserted into a text to influence the outcome of the bidirectional algorithm. However, in the case of documents encoded in XML, the W3C explicitly advises that markup rather than directional formatting characters should be used (&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls). We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13064</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13064"/>
		<updated>2014-03-27T15:36:18Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Writing Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same ''writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, or by the size and shape of a monument. &lt;br /&gt;
&lt;br /&gt;
The directionality features of scripts, and the consequences arising out of them, are generally referred to as &amp;quot;writing modes&amp;quot;. For many documents encoded in TEI, there may be no need to encode any information relating to writing mode, because it will be obvious. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom. It may appear that directionality can be reliably deduced from the language and script settings, and these are probably already encoded using the @xml:lang attribute in TEI documents (although the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). Even in the case of many &amp;quot;mixed mode&amp;quot; documents (documents in which languages or scripts with different writing modes are mixed together), it may not be necessary to be explicit about directionality. Consider the case of an English text containing a few Arabic words--what is termed a &amp;quot;bidirectional&amp;quot; text:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Arabic is always written from right to left, we can assume that the Arabic glyphs are to be read in that direction, even if they are in the context of a left-to-right English sentence. In fact, most codepoints in the Unicode standard have a specific directionality setting which helps any rendering engine to determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right; the Hebrew א (alef) is strongly right-to-left. Other glyphs have weak or neutral settings because of the contexts in which they may appear. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) provides a complex series of rules enabling user agents to render most mixed-mode texts with predictable and reliable results, based on the bidirectionality class values of their glyphs.&lt;br /&gt;
&lt;br /&gt;
In some mixed-mode texts, though, the Bidirectional Algorithm may not give the desired results. To deal with this, Unicode provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), also called &amp;quot;bidi formatting code characters&amp;quot;, which are additional codepoints whose only function is to signal to a user-agent that a specific directionality setting should be turned on or off. These can be inserted into a text to influence the outcome of the bidirectional algorithm. However, in the case of documents encoded in XML, the W3C explicitly advises that markup rather than directional formatting characters should be used (&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls). We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13063</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13063"/>
		<updated>2014-03-27T15:35:52Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Writing Modes===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same ' writing mode'' (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the same language may appear in different modes, for example either vertically or horizontally. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top. &lt;br /&gt;
&lt;br /&gt;
When different writing modes are available for the same language, it may be that different glyphs will be preferred when the script is used in different modes. For example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used in preference to the vertical mode glyph, U+FE11, to ensure that the comma appears in the correct position relative to the surrounding glyphs. Even for scripts which are usually written in exactly the same way, different writing modes may be encountered in particular contexts, for example English embedded within vertically organized Chinese text. Similarly, the default writing mode may vary in response to layout constraints such as those imposed by a complex table, where column or row labels may be written vertically or diagonally to make the most effective use of available space, or by the size and shape of a monument. &lt;br /&gt;
&lt;br /&gt;
The directionality features of scripts, and the consequences arising out of them, are generally referred to as &amp;quot;writing modes&amp;quot;. For many documents encoded in TEI, there may be no need to encode any information relating to writing mode, because it will be obvious. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom. It may appear that directionality can be reliably deduced from the language and script settings, and these are probably already encoded using the @xml:lang attribute in TEI documents (although the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). Even in the case of many &amp;quot;mixed mode&amp;quot; documents (documents in which languages or scripts with different writing modes are mixed together), it may not be necessary to be explicit about directionality. Consider the case of an English text containing a few Arabic words--what is termed a &amp;quot;bidirectional&amp;quot; text:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Arabic is always written from right to left, we can assume that the Arabic glyphs are to be read in that direction, even if they are in the context of a left-to-right English sentence. In fact, most codepoints in the Unicode standard have a specific directionality setting which helps any rendering engine to determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right; the Hebrew א (alef) is strongly right-to-left. Other glyphs have weak or neutral settings because of the contexts in which they may appear. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) provides a complex series of rules enabling user agents to render most mixed-mode texts with predictable and reliable results, based on the bidirectionality class values of their glyphs.&lt;br /&gt;
&lt;br /&gt;
In some mixed-mode texts, though, the Bidirectional Algorithm may not give the desired results. To deal with this, Unicode provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), also called &amp;quot;bidi formatting code characters&amp;quot;, which are additional codepoints whose only function is to signal to a user-agent that a specific directionality setting should be turned on or off. These can be inserted into a text to influence the outcome of the bidirectional algorithm. However, in the case of documents encoded in XML, the W3C explicitly advises that markup rather than directional formatting characters should be used (&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls). We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13061</id>
		<title>Text Directionality Draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft&amp;diff=13061"/>
		<updated>2014-03-27T14:20:08Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a preliminary draft of proposed sections for the TEI Guidelines, created by the [[Text Directionality Workgroup]]. Please see the associated [[Text Directionality Draft Questions]] document for some issues to think about before and after reading this draft, and feel free to respond there and to add new questions. There is also a [[Talk:Text_Directionality_Draft|talk page]] for more informal discussion.&lt;br /&gt;
&lt;br /&gt;
==Text directionality and transformation==&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
The scripts used for writing human languages vary not only in the glyphs they use, but also in the conventions governing the disposition of those glyphs on the writing surface. For the majority of modern languages, writing is presented as a series of lines which are to be read from top to bottom. Within each line, individual characters are most frequently presented from left to right (English, Russian, Greek), but there are also several widely-used scripts which run right-to-left (Arabic, Hebrew). However, writing in which the lines of glyphs are presented vertically and read from right to left is also often encountered, notably in older East Asian scripts (Sinitic characters, Japanese Kana, Korean Hangul, Vietnamese chữ nôm). In many cases, a language always uses the same writing mode (that is, the orientation of individual glyphs within a line and reading order of the lines), but there are exceptions, such as Japanese or modern Chinese, in which the language may appear indifferently in different modes. There are also comparatively rare cases of ancient scripts which are characteristically written with lines running left to right, each line being read top to bottom (Ancient Uighur, classical Mongolian and Manchu), or even (in the case of Ogham) from bottom to top.   &lt;br /&gt;
&lt;br /&gt;
There are also instances of writing which changes direction on alternate lines (boustrophedon, discussed in detail below). &lt;br /&gt;
&lt;br /&gt;
When a language or script can be arranged in two or more different directions, there are often other consequences arising out of the choice; for example, when Japanese is written horizontally, the Unicode character U+3001, the &amp;quot;ideographic comma&amp;quot;, is used, whereas in vertical writing an alternative glyph, U+FE11, may be used to ensure that the comma appears in the correct position relative to the surrounding glyphs. In addition, scripts which normally have a single directionality (such as English) may be written in a different direction in the context of another language (English words inserted into vertical Chinese text, for example), or in response to layout constraints such as those imposed by a complex table, in which column or row labels may be written vertically to make the most effective use of available space.&lt;br /&gt;
&lt;br /&gt;
The directionality features of scripts, and the consequences arising out of them, are generally referred to as &amp;quot;writing modes&amp;quot;. For many documents encoded in TEI, there may be no need to encode any information relating to writing mode, because it will be obvious. Modern printed texts in most European languages, for instance, may be expected to use left-to-right/top-to-bottom directionality; Arabic or Hebrew texts are expected to run right-to-left/top-to-bottom. It may appear that directionality can be reliably deduced from the language and script settings, and these are probably already encoded using the @xml:lang attribute in TEI documents (although the W3C i18n Working Group recommends against reliance on language tags for encoding directionality information [per Richard Ishida, W3C; I need to find a formal reference for this]). Even in the case of many &amp;quot;mixed mode&amp;quot; documents (documents in which languages or scripts with different writing modes are mixed together), it may not be necessary to be explicit about directionality. Consider the case of an English text containing a few Arabic words--what is termed a &amp;quot;bidirectional&amp;quot; text:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Arabic is always written from right to left, we can assume that the Arabic glyphs are to be read in that direction, even if they are in the context of a left-to-right English sentence. In fact, most codepoints in the Unicode standard have a specific directionality setting which helps any rendering engine to determine how they should be ordered. The Latin glyph &amp;quot;a&amp;quot; has a bidirectionality setting of strong left-to-right; the Hebrew א (alef) is strongly right-to-left. Other glyphs have weak or neutral settings because of the contexts in which they may appear. The Unicode Bidirectional Algorithm (http://www.unicode.org/reports/tr9/) provides a complex series of rules enabling user agents to render most mixed-mode texts with predictable and reliable results, based on the bidirectionality class values of their glyphs.&lt;br /&gt;
&lt;br /&gt;
In some mixed-mode texts, though, the Bidirectional Algorithm may not give the desired results. To deal with this, Unicode provides a set of &amp;quot;directional formatting characters&amp;quot; (http://www.unicode.org/reports/tr9/#Directional_Formatting_Codes), also called &amp;quot;bidi formatting code characters&amp;quot;, which are additional codepoints whose only function is to signal to a user-agent that a specific directionality setting should be turned on or off. These can be inserted into a text to influence the outcome of the bidirectional algorithm. However, in the case of documents encoded in XML, the W3C explicitly advises that markup rather than directional formatting characters should be used (&amp;quot;In (X)HTML and XML do not use the paired Unicode bidi formatting code characters where equivalent markup is available,&amp;quot; http://www.w3.org/International/questions/qa-bidi-controls). We concur with this recommendation, and the remainder of this section and the next provide a set of encoding strategies for handling text directionality without the use of directional formatting characters. The approach we recommend is based on two external specifications, in line with our normal practice of incorporating existing standards where they are available and appropriate. Those specifications are the CSS Writing Modes module (http://dev.w3.org/csswg/css-writing-modes/) and the CSS Transforms module (http://www.w3.org/TR/css3-transforms/). Since (at the time of writing) neither of these modules has yet reached the stage of a Recommendation, the advice offered below should be regarded as provisional, and you should check your usage of the properties concerned against the current version of each specification where possible. &lt;br /&gt;
&lt;br /&gt;
The following sections will present a few simple examples of phenomena relating to text directionality and transformation, along with some suggested encoding strategies based on the following CSS properties from CSS Writing Modes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   direction: ltr | rtl&amp;lt;br/&amp;gt;&lt;br /&gt;
   writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;br/&amp;gt;&lt;br /&gt;
   text-orientation: mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation&amp;lt;ref&amp;gt;The value &amp;quot;use-glyph-orientation&amp;quot; may be dropped from the CSS Writing Modes specification.&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
   unicode-bidi: normal | embed | isolate | bidi-override | isolate-override | plaintext&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
along with the &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property from CSS Transforms.&lt;br /&gt;
&lt;br /&gt;
In the following examples, CSS rules are encoded in the global TEI @style attribute, which applies them directly to the element on which they are specified (and in most cases, its descendants). It is also appropriate, and will often be more efficient, to express the rules in TEI &amp;lt;rendition&amp;gt; elements in the &amp;lt;teiHeader&amp;gt; and point to them using @rendition attributes. It should also be remembered that the CSS specifications are written primarily to guide users providing instructions for the rendering of digital texts, and implementers creating user-agents which will act on these instructions. However, our usage in the context of a TEI document is primarily ''descriptive'' rather than ''prescriptive''; we are typically describing the features of a text we are encoding, rather than providing instructions for rendering it. Our purpose below is not to enumerate an exhaustive set of strategies for encoding any writing mode feature you may encounter; rather we will show some simple examples which serve as an introduction to the topic.&lt;br /&gt;
&lt;br /&gt;
===Text directionality===&lt;br /&gt;
&lt;br /&gt;
====Horizontal directionality====&lt;br /&gt;
&lt;br /&gt;
Returning to our previous simple example&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;The Arabic term قلم رصاص means &amp;quot;pencil&amp;quot;.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we could use the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property to make directionality explicit:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;direction: ltr | rtl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;The Arabic term &amp;lt;/seg&amp;gt;&lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;ar&amp;quot; style=&amp;quot;unicode-bidi: embed; direction: rtl&amp;quot;&amp;gt;قلم رصاص&amp;lt;/seg&amp;gt;  &lt;br /&gt;
  &amp;lt;seg xml:lang=&amp;quot;en&amp;quot; style=&amp;quot;direction: ltr&amp;quot;&amp;gt;means &amp;quot;pencil&amp;quot;.&amp;lt;/seg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is straightforward, but the &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; property requires some explanation. These three segments are all inline; they form part of a single sentence, although they happen to be encoded on separate lines in this example. The default value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; is &amp;quot;normal&amp;quot;, and the CSS Writing Modes specification stipulates that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property &amp;quot;has no effect on bidi reordering when specified on inline elements whose unicode-bidi property’s value is normal, because the element does not open an additional level of embedding with respect to the bidirectional algorithm.&amp;quot; In other words, if we want to make it clear that the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property is effective here, we must include a value for &amp;lt;code&amp;gt;unicode-bidi&amp;lt;/code&amp;gt; which will make it so.&lt;br /&gt;
&lt;br /&gt;
However, as mentioned above, all of the directional encoding in this example is superfluous; ambiguity does not arise in this particular case. Moreover, &amp;quot;ltr&amp;quot; is the default value for the &amp;lt;code&amp;gt;direction&amp;lt;/code&amp;gt; property, so we do not need to specify it for the English segments. However, consider the following example, contributed by Efraim Feinstein, in which Hebrew and English text are mixed. (This example is presented in the form of graphics, because we cannot rely on user agents that may be rendering or displaying these Guidelines to provide a consistent output.)&lt;br /&gt;
&lt;br /&gt;
[[File:En he embedding.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here, an English period appears in between two runs of Hebrew text. Should that period be interpreted as part of a single run of right-to-left text, or should it be deemed to terminate the first run and precede the second? For the Unicode Bidi Algorithm, punctuation is not strongly directional; it inherits directionality from the surrounding characters. Without further clues, therefore, it would interpret the example as a sequence of three runs (English, Hebrew, English), and arrive at an incorrect interpretation. A clear and correct interpretation requires that not only that the glyphs themselves be transcribed in the correct logical order, but that the encoding eliminate potential ambiguity by delimiting the two Hebrew runs separately, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;&lt;br /&gt;
     Here's a sentence that begins in English&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ויש מלים בעברית והפסק&amp;lt;/seg&amp;gt;.&lt;br /&gt;
       &amp;lt;seg xml:lang=&amp;quot;he&amp;quot; style=&amp;quot;unicode-bidi: isolate; direction: rtl&amp;quot;&amp;gt;ועוד מלים בעברית&amp;lt;/seg&amp;gt;&lt;br /&gt;
     and it continues in English.&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the English is unmarked for directionality, but the period is clearly not included in either of the RTL runs, so the ambiguity inherent in the plain text is avoided. Once again, we might argue that the &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; attribute should provide enough information; the important component here is the explicit delimitation of two distinct RTL runs. But additional clarity in the encoding certainly does no harm.&lt;br /&gt;
&lt;br /&gt;
[Would it be helpful to have another example presenting ambiguity arising out of the use of a g element at the end of a text run?]&lt;br /&gt;
&lt;br /&gt;
====Vertical writing modes====&lt;br /&gt;
&lt;br /&gt;
So far, we have looked only at left-to-right and right-to-left text running horizontally, using the &amp;lt;code&amp;gt;direction: ltr|rtl&amp;lt;/code&amp;gt; property. However, there are many scripts and languages which are written vertically (mostly top-to-bottom, but with a few unusal examples running bottom-to-top, as we shall see below). Handling vertical directionality requires the use of another CSS property, the writing mode:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;writing-mode: horizontal-tb | vertical-rl | vertical-lr&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values for this property include two components: &amp;quot;horizontal&amp;quot; or &amp;quot;vertical&amp;quot; specifies the inline writing direction, while the second component specifies the direction in which lines in a block, and blocks in a sequence may be arranged: from top to bottom (as in most European languages, in which lines and paragraphs are arranged from top to bottom on a page), from right to left (as in the case of some East Asian languages such as Japanese, which we will see below), or left-to-right (e.g. Mongolian). This example shows a Japanese haiku poem transcribed first in Japanese, then in Romaji (Japanese in Latin script), and finally in an English translation. &lt;br /&gt;
&lt;br /&gt;
[[File:Basho_furu_ike_ya.png|thumb|left|alt=Basho poem|Taken from p.42 of ''Haiku: Japanese Art and Poetry''. Judith Patt, Michiko Warkentyne (calligraphy) and Barry Till. 2010. Used with permission.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja&amp;quot; style=&amp;quot;writing-mode: vertical-rl&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_jp&amp;quot; corresp=&amp;quot;#furu-ike-ya_romaji #furu-ike-ya_en&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;古池や&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;蛙&amp;lt;/l&amp;gt;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;飛び込む&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;水の音&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;ja-Latn&amp;quot; style=&amp;quot;writing-mode: horizontal-tb&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_romaji&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_en&amp;quot;&amp;gt; &lt;br /&gt;
    &amp;lt;l&amp;gt;furu ike ya&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;kawazu tobikomu&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;mizu no oto&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;lg xml:lang=&amp;quot;en&amp;quot; &lt;br /&gt;
      xml:id=&amp;quot;furu-ike-ya_en&amp;quot; corresp=&amp;quot;#furu-ike-ya_jp #furu-ike-ya_romaji&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;Old pond,&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;and a frog dives in—&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;&amp;quot;Splash&amp;quot;!&amp;lt;/l&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;bibl&amp;gt;—Bashō (1644–1694)&amp;lt;/bibl&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: for the sake of simplicity, the indenting of lines in the vertical Japanese and the central alignment of the other components have been ignored in this encoding, since this section focuses on language and writing mode issues. The Japanese transcription has &amp;lt;code&amp;gt;writing-mode: vertical-rl&amp;lt;/code&amp;gt;, which is required because Japanese may be written either in this mode or horizontally. The transcription in Romaji has &amp;lt;code&amp;gt;@xml:lang=&amp;quot;ja-Latn&amp;quot;&amp;lt;/code&amp;gt; (Japanese written in Latin script) and has a horizontal writing mode; this may seem superfluous, but vertically-written romaji is not unknown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical text with embedded horizontal text====&lt;br /&gt;
&lt;br /&gt;
When Japanese is written vertically, the glyph orientation remains the same as when it is written horizontally. In other words, glyphs are not rotated (although as noted above some different glyphs may be used for some characters the two orientations; punctuation for instance needs to be positioned differently in vertical versus horizontal text). However, it is very common for languages written vertically to have embedded runs of text from languages normally written horizontally. This raises the issue of the orientation of the glyphs from the horizontal language. Are they written upright, as they would normally appear in horizontal text runs, or are they rotated? Consider this fragment from a Japanese article about the Indonesian language, which takes the form of a glossary list:&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag sm.jpg|thumb|left|alt=Glossary list|Taken from p.62 of &amp;quot;インドネシア語&amp;quot;. 崎山理. 1985. ''外国語との対照II''. 講座日本語学 11.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;list type=&amp;quot;gloss&amp;quot; xml:lang=&amp;quot;ja&amp;quot; &lt;br /&gt;
      style=&amp;quot;writing-mode: vertical-rl; text-orientation: mixed&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;hampir&amp;lt;/label&amp;gt; 　&lt;br /&gt;
   &amp;lt;item&amp;gt;「近い、ほとんど」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;label xml:lang=&amp;quot;id&amp;quot;&amp;gt;baru&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;「新しい、ばかい」&amp;lt;/item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
&amp;lt;/list&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The rule &amp;lt;code&amp;gt;text-orientation: mixed&amp;lt;/code&amp;gt; gives the expected orientation: &amp;quot;In vertical writing modes, characters from horizontal-only scripts are set sideways, i.e. 90° clockwise from their standard orientation in horizontal text. Characters from vertical scripts are set with their intrinsic orientation&amp;quot; ([http://www.w3.org/TR/2013/WD-css-writing-modes-3-20131024/#text-orientation CSS Writing Modes]). In actual fact, the default value for &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; is &amp;quot;mixed&amp;quot;, so this rule is not strictly required, but if the Indonesian glyphs (which are roman characters) had been set vertically, like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Ja vertical indonesian frag rotated sm.jpg|50px|thumb|left|alt=Glossary list|Fragment of previous image with Indonesian glyphs upright.]]&lt;br /&gt;
&lt;br /&gt;
then the encoding would have to be explicit, and we could capture the orientation with &amp;lt;code&amp;gt;text-orientation: upright&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Vertical orientation in horizontal scripts====&lt;br /&gt;
&lt;br /&gt;
It is not unusual to see text from horizontal languages written vertically even where it is not embedded in a text run from a vertically-written script. This example is a fragment from a table of information about agricultural development on Vancouver Island, written in 1855:&lt;br /&gt;
&lt;br /&gt;
[[File:bcgenesis co 305 06 00131v table extract.jpg|thumb|center|600px|alt=Agricultural report table|Enclosure with 10048, CO 305/6, p. 109 http://bcgenesis.uvic.ca/getDoc.htm?id=V55116.scx]]&lt;br /&gt;
&lt;br /&gt;
Four subheading cells in this fragment contain English text, written vertically, bottom-to-top, to conserve space on the page. This is not a &amp;quot;native orientation&amp;quot; for English; readers would not find it easy to read this text, and might be inclined to rotate the page in order to read it in a more natural way. To describe this sort of phenomenon, we can use the text-orientation property again:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;code&amp;gt;text-orientation: mixed|upright|sideways-right|sideways-left|sideways|use-glyph-orientation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For full details on this property, we refer the reader to the CSS Writing Modes specification. For the present example, we will make use only of the &amp;quot;sideways-left&amp;quot; value, which &amp;quot;causes text to be set as if in a horizontal layout, but rotated 90° counter-clockwise.&amp;quot; We might encode one of the four cells containing vertical text like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;cell style=&amp;quot;writing-mode: vertical-lr; text-orientation: sideways-left&amp;quot;&amp;gt;&lt;br /&gt;
    Cash Value&amp;lt;lb/&amp;gt;&lt;br /&gt;
    of&amp;lt;lb/&amp;gt;&lt;br /&gt;
    Farms&lt;br /&gt;
  &amp;lt;/cell&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;writing-mode&amp;lt;/code&amp;gt; captures the fact that the script is written vertically, and its line/block flow is from left to right (so &amp;quot;of&amp;quot; is to the right of &amp;quot;Cash value&amp;quot;), while the &amp;lt;code&amp;gt;text-orientation&amp;lt;/code&amp;gt; value encodes the orientation (rotated 90° counter-clockwise). We might also add &amp;lt;code&amp;gt;text-align: center&amp;lt;/code&amp;gt; to the style, to express the fact that the text is centrally-aligned; alignment properties are mapped relative to the line flow, so the word &amp;quot;of&amp;quot; is visibly centred relative to the physical top and bottom of the box, which are the left and right from the point of view of the line flow.&lt;br /&gt;
&lt;br /&gt;
====Bottom-to-top writing====&lt;br /&gt;
&lt;br /&gt;
There are a very small number of scripts which appear to be written bottom-to-top; perhaps the most well-known is Ogham, an alphabet used mainly to write Archaic Irish. The CSS Writing Modes specification does not explicitly provide for the distinction between top-to-bottom and bottom-to-top in vertically-written scripts; it is argued that all instances of bottom-to-top scripts are actually left-to-right horizontal scripts, oriented vertically because of the constraints of the medium on which they are inscribed (as in the case of Ogham inscriptions on tombstones). In other words, the case of scripts like this is analogous to the vertical English text-runs in the table cells in the example above, and can be handled in exactly the same manner (&amp;lt;code&amp;gt;writing-mode: vertical-lr; text-orientation: sideways-left&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
====Summary====&lt;br /&gt;
&lt;br /&gt;
In this section, we have presented one approach to encoding text directionality features in TEI files, using the properties and values from the CSS Writing Modes module, encoded in the global TEI @style attribute (or in the TEI &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;&amp;lt;/code&amp;gt; element and linked with the @rendition attribute). For most texts, it will not be necessary to encode any information about text directionality, either because it follows unambiguously from &amp;lt;code&amp;gt;@xml:lang&amp;lt;/code&amp;gt; values, or because it can be expected to be handled unequivocally by the Unicode Bidi Algorithm. Where it is important to encode text directionality, we believe that most phenomena can be well described through the use of the CSS Writing Modes features; of those which cannot, other approaches based on the CSS Transforms module are presented below.&lt;br /&gt;
&lt;br /&gt;
===Text transformation===&lt;br /&gt;
&lt;br /&gt;
====Rotation====&lt;br /&gt;
&lt;br /&gt;
In what follows, we examine a range of textual phenomena which in some ways appear very similar to those examined above, and even overlap with them. We can categorize these as text transformation features, and suggest some strategies for encoding them based on the properties detailed in the [http://www.w3.org/TR/css3-transforms/ CSS Transforms] specification. The CSS Transforms module provides a complex array of properties, values and functions which can be used to rotate, skew, translate and otherwise transform textual and graphical objects. We can borrow this vocabulary in order to describe textual phenomena in a precise manner.&lt;br /&gt;
&lt;br /&gt;
We begin with a simple example of a rotational transform:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_z_axis.png|frame‎]]&lt;br /&gt;
&lt;br /&gt;
Here a block of text has been rotated around its z-axis. This is clearly not a &amp;quot;writing mode&amp;quot;; the writing mode for this text is horizontal, left to right. Furthermore, even if we wished to treat this as a writing mode, we could not do so, because there is no way to use writing modes properties to describe an text orientation which is angled at 45 degrees; no human languages are consistently written in this orientation. It is more appropriate to treat this as a rotational transformation. We can do this using two properties: &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt;. (Both of these properties have quite complex value sets, and we will not look at all of them here. See the [http://www.w3.org/TR/css3-transforms/ specification] for full details.)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;transform&amp;lt;/code&amp;gt; property takes as its value one or more of the transform functions, one of which is the function &amp;lt;code&amp;gt;rotateZ&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateZ(-45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any rotation must take place clockwise around an axis positioned relative to the element being rotated, and the &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; property can be used to specify the pivot point. By default, the value of &amp;lt;code&amp;gt;transform-origin&amp;lt;/code&amp;gt; is &amp;quot;50% 50%&amp;quot;, the point at the centre of the element, but these values can be changed to reflect rotation around a different origin point. (The TEI [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-zone.html zone element] also bears an attribute @rotate which can specify rotation in degrees around the z-axis, but it is not available for any other element.)&lt;br /&gt;
&lt;br /&gt;
An element may also be rotated about either of its other axes. For example, this shows rotation around the Y (vertical) axis:&lt;br /&gt;
&lt;br /&gt;
[[File:Rotation_on_y_axis.png|frame‎‎]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;ab style=&amp;quot;transform:rotateY(45deg)&amp;quot;&amp;gt;TEI-C.ORG&amp;lt;/ab&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are obviously trivial examples, but similar features do appear in historical texts. George Herbert's ''The Temple'' includes two stanzas headed &amp;quot;Easter Wings&amp;quot; which are both normally printed in a rotated form so that they represent a pair of wings:&lt;br /&gt;
&lt;br /&gt;
[[File:Herbert church p35 sm.jpg|thumb|left|300px|Page 35 of Herbert's ''The Temple'', second stanza of Easter Wings (or second poem so named). Used with permission of the Folger Library.]]&lt;br /&gt;
&lt;br /&gt;
This could be encoded thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;lg style=&amp;quot;transform:rotateZ(90deg)&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;My tender age in ſorrow did beginne:&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;l&amp;gt;And ſtill with ſickneſſes and ſhame&amp;lt;/l&amp;gt;&lt;br /&gt;
    &amp;lt;!-- ... --&amp;gt;&lt;br /&gt;
  &amp;lt;/lg&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
but we might also argue that this is in fact a vertical writing mode, and express it with &amp;lt;code&amp;gt;writing-mode: vertical-rl; text-orientation: sideways-right&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Boustrophedon====&lt;br /&gt;
&lt;br /&gt;
We may also use rotation as a method of handling a true writing mode which is not covered by the CSS Writing Modes: boustrophedon. This is a writing mode common in inscriptions in Latin, Greek and other languages, in which alternate lines run from left to right and from right to left; its name derives from the path of an ox pulling a plough. Right-to-left lines in boustrophedon have another unexpected feature: their glyphs are reversed, so that these lines appear as &amp;quot;mirror writing&amp;quot;. This example shows a transcription of a Greek inscription at Dodona:&lt;br /&gt;
&lt;br /&gt;
[[File:Boustrophedon small J.NW.Epeiros.13.p03.jpg|thumb|left|300px|Drawing of a leaden plaque bearing an inquiry by Hermon from the oracular precinct at Dodona. Image and transcription from http://poinikastas.csad.ox.ac.uk, used with permission.]]&lt;br /&gt;
&lt;br /&gt;
This might be transcribed as follows (ignoring word boundaries for the moment):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;ab&amp;gt;&lt;br /&gt;
    ΗΕΡΜΟΝΤΙΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΚΑΘΕΟΝΠΟΤΘΕΜ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΕΝΟΣΥΕΝΕΑϜ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΟΙΥΕΝΟΙΤΙΕΚΚ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΡΕΤΑΙΑΣΟΝΑ &amp;lt;lb/&amp;gt;&lt;br /&gt;
    &amp;lt;seg style=&amp;quot;rotateY(180deg)&amp;quot;&amp;gt;ΣΙΜΟΣΟΤΤΑΙΕ&amp;lt;/seg&amp;gt; &amp;lt;lb/&amp;gt;&lt;br /&gt;
    ΑΣΣΑΙ&lt;br /&gt;
  &amp;lt;/ab&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 180-degree rotation around the Y (vertical) axis here gives us exactly the effect of the RTL line in boustrophedon; the order of glyphs is reversed, and so is their individual orientation (in fact, we see them &amp;quot;from the back&amp;quot;, as it were). &amp;lt;code&amp;gt;&amp;lt;seg&amp;gt;&amp;lt;/code&amp;gt; elements have been used here because these are clearly not &amp;quot;lines&amp;quot; in the sense of poetic lines; the text is continuous prose, and linebreaks are incidental.&lt;br /&gt;
&lt;br /&gt;
There are obviously some unsatisfactory aspects of this manner of encoding boustrophedon. In the inscription above, some words run across linebreaks, so if we wished to tag both words and the right-to-left phenomena, one hierarchy would have to be privileged over the other. By using a transform function rather than a writing mode property, we are apparently suggesting that boustrophedon is not in fact a writing mode, whereas it clearly is. But the CSS Writing Modes specification does not provide support for boustrophedon, because it is a rather obscure historical phenomenon; using a rotational transform is one practical alternative.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;amp;#160;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Caveats====&lt;br /&gt;
&lt;br /&gt;
The effect and behaviour of CSS Transforms properties and values according to the specification are highly dependent on the computed [http://www.w3.org/TR/CSS2/visuren.html Visual formatting model] of an HTML document. TEI currently does not have an explicit processing or formatting model. That is, it is by no means clear whether any given TEI element should be interpreted, for instance, as a block-level or inline-level element; for many elements we may think we can assume block-level (&amp;lt;code&amp;gt;&amp;lt;ab&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;anonymous block&amp;quot;) or inline-level (&amp;lt;code&amp;gt;&amp;lt;w&amp;gt;&amp;lt;/code&amp;gt;, &amp;quot;word&amp;quot;) from the semantics, but even this is risky. As long as the properties and values from the CSS Transforms module are used as a convenient, well-specified descriptive language to capture features of a text, without any expectation of using them directly and reliably for rendering, this is not problematic; we are simply borrowing a useful vocabulary from an external source, and benefiting from the clarity of definition provided by the specification. However, if there is any expectation of using this information to render a text in a predictable and accurate way, it will be essential to provide enough styling information throughout the document hierarchy to resolve all ambiguities with regard to size, positioning, block status, etc. before any element undergoes a transform operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft_Questions&amp;diff=13060</id>
		<title>Text Directionality Draft Questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft_Questions&amp;diff=13060"/>
		<updated>2014-03-27T13:25:54Z</updated>

		<summary type="html">&lt;p&gt;Lou: /* Where does this section belong in the Guidelines? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are some questions for readers of the [[Text Directionality Draft]] document (members of Council and of the [[Text Directionality Workgroup]]). Feel free to add comments and new questions.&lt;br /&gt;
&lt;br /&gt;
'''Note that comments are also being made on the [[Talk:Text_Directionality_Draft|draft's talk page]].'''&lt;br /&gt;
&lt;br /&gt;
===Is the draft written at the appropriate level of detail?===&lt;br /&gt;
&lt;br /&gt;
There may be way too much or way too little detail here. &lt;br /&gt;
&lt;br /&gt;
At the simplest level, we could say &amp;quot;CSS Writing Modes and CSS Transforms provide properties and values for encoding text directionality and transformation. You may wish to use them in the TEI &amp;lt;code&amp;gt;@style&amp;lt;/code&amp;gt; attribute, or in &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;/@rendition&amp;lt;/code&amp;gt;,&amp;quot; and stop there. I think that would be unhelpful and unkind, since the CSS specifications are not really human-friendly, and there are some aspects of our suggested usage which is orthogonal to the way the specifications are addressed, since we're using the CSS properties descriptively rather than prescriptively. &lt;br /&gt;
&lt;br /&gt;
On the other hand, you may feel that even more detail is required, with more and better examples. The examples for transforms, for example, are rudimentary and scarcely hint at the actual complexity of the CSS specification. &lt;br /&gt;
&lt;br /&gt;
===Where does this section belong in the Guidelines?===&lt;br /&gt;
&lt;br /&gt;
NOTE: At the Council meeting in Oxford in November, it was decided that this new section should be incorporated into a rewritten Chapter 5 (currently named &amp;quot;Languages and Character Sets&amp;quot;), along with section 10.6.6 from Chapter 10 (&amp;quot;Languages and Writing Systems&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color: #d0d0d0;&amp;quot;&amp;gt;Originally, I thought it should be added to the end of the &amp;quot;Languages and Character Sets&amp;quot; front matter section, but I no longer think so; the draft contains examples of TEI encoding which wouldn't make sense to someone who has not yet actually read the body of the Guidelines. Other possible locations would be [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/MS.html#mslangs 10.6.6 Languages and writing systems], or [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/WD.html Chapter 5: Non-standard Characters and Glyphs] (which would obviously have to be retitled). The draft may even not belong in the Guidelines at all; it could be a peripheral document on the TEI website or on the wiki.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further discussion between me and Martin suggests that in fact 10.6.1 should stay where it is (this is the section of the msDescription chapter that talks about documenting the languages used in a text, irrespective of their transcription) but that it would also be desirable to have a single place where all aspects of the use of languages, characters, scripts, glyphs, writing modes would be encompassed, which might be referred to from several places. The directionality draft material could go into this, but it's not clear where such a unified chapter belongs. The existing chapter [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/WD.html Chapter 5: Non-standard Characters and Glyphs] is separate from the existing introductory chapter &lt;br /&gt;
[http://www.tei-c.org/release/doc/tei-p5-doc/en/html/CH.html vi  Languages and Character Sets] because the former describes specific elements whereas the latter introduces general principles. It might make better logical sense to revise the latter to include at least some of the new material on directionality.    [[User: Lou]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=User:Lou&amp;diff=13059</id>
		<title>User:Lou</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=User:Lou&amp;diff=13059"/>
		<updated>2014-03-27T13:15:03Z</updated>

		<summary type="html">&lt;p&gt;Lou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lou Burnard has several online identies. The latest is http://about.me/louburnard&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=User:Lou&amp;diff=13058</id>
		<title>User:Lou</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=User:Lou&amp;diff=13058"/>
		<updated>2014-03-27T13:10:37Z</updated>

		<summary type="html">&lt;p&gt;Lou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lou Burnard&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft_Questions&amp;diff=13057</id>
		<title>Text Directionality Draft Questions</title>
		<link rel="alternate" type="text/html" href="https://wiki.tei-c.org/index.php?title=Text_Directionality_Draft_Questions&amp;diff=13057"/>
		<updated>2014-03-27T13:09:57Z</updated>

		<summary type="html">&lt;p&gt;Lou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are some questions for readers of the [[Text Directionality Draft]] document (members of Council and of the [[Text Directionality Workgroup]]). Feel free to add comments and new questions.&lt;br /&gt;
&lt;br /&gt;
'''Note that comments are also being made on the [[Talk:Text_Directionality_Draft|draft's talk page]].'''&lt;br /&gt;
&lt;br /&gt;
===Is the draft written at the appropriate level of detail?===&lt;br /&gt;
&lt;br /&gt;
There may be way too much or way too little detail here. &lt;br /&gt;
&lt;br /&gt;
At the simplest level, we could say &amp;quot;CSS Writing Modes and CSS Transforms provide properties and values for encoding text directionality and transformation. You may wish to use them in the TEI &amp;lt;code&amp;gt;@style&amp;lt;/code&amp;gt; attribute, or in &amp;lt;code&amp;gt;&amp;lt;rendition&amp;gt;/@rendition&amp;lt;/code&amp;gt;,&amp;quot; and stop there. I think that would be unhelpful and unkind, since the CSS specifications are not really human-friendly, and there are some aspects of our suggested usage which is orthogonal to the way the specifications are addressed, since we're using the CSS properties descriptively rather than prescriptively. &lt;br /&gt;
&lt;br /&gt;
On the other hand, you may feel that even more detail is required, with more and better examples. The examples for transforms, for example, are rudimentary and scarcely hint at the actual complexity of the CSS specification. &lt;br /&gt;
&lt;br /&gt;
===Where does this section belong in the Guidelines?===&lt;br /&gt;
&lt;br /&gt;
NOTE: At the Council meeting in Oxford in November, it was decided that this new section should be incorporated into a rewritten Chapter 5 (currently named &amp;quot;Languages and Character Sets&amp;quot;), along with section 10.6.6 from Chapter 10 (&amp;quot;Languages and Writing Systems&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color: #d0d0d0;&amp;quot;&amp;gt;Originally, I thought it should be added to the end of the &amp;quot;Languages and Character Sets&amp;quot; front matter section, but I no longer think so; the draft contains examples of TEI encoding which wouldn't make sense to someone who has not yet actually read the body of the Guidelines. Other possible locations would be [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/MS.html#mslangs 10.6.6 Languages and writing systems], or [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/WD.html Chapter 5: Non-standard Characters and Glyphs] (which would obviously have to be retitled). The draft may even not belong in the Guidelines at all; it could be a peripheral document on the TEI website or on the wiki.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Further discussion between me and Martin suggests that in fact 10.6.1 should stay where it is (this is the section of the msDescription chapter that talks about documenting the languages used in a text, irrespective of their transcription) but that it would also be desirable to have a single place where all aspects of the use of languages, characters, scripts, glyphs, writing modes would be encompassed. The directionality draft material would go into this, but it's not clear where such a unified chapter belongs. [[User: Lou]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Council]]&lt;/div&gt;</summary>
		<author><name>Lou</name></author>
		
	</entry>
</feed>