<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en"> | |
<HEAD> | |
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2012. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> | |
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> | |
<TITLE>Structured Text Overview</TITLE> | |
<link rel="stylesheet" type="text/css" HREF="../book.css"> | |
</HEAD> | |
<BODY BGCOLOR="#ffffff"> | |
<H2>Structured Text Overview</H2> | |
<p>Languages like Arabic and Hebrew are generally written from right to left, | |
but included numbers and phrases in English must be written from left to right. | |
This is the origin of the term "bidirectional" which qualifies these languages.</p> | |
<p>In most computer environments, the text is stored in <em>logical</em> order | |
(the order the text is read) but is reordered into <em>visual</em> order for | |
presentation. For plain text, the Unicode Bidirectional Algorithm | |
(<a href="http://www.unicode.org/reports/tr9/">UBA</a>) | |
generally specifies satisfactorily how to reorder bidirectional text for | |
display. This algorithm, or close to it, is implemented in the presentation | |
systems of a number of platforms, giving them a good handle on bidirectional | |
support.</p> | |
<p>However, all bidirectional text is not necessarily plain text. There are also | |
instances of text structured to follow a given syntax, which should be reflected | |
in the display order. The general algorithm, which has no awareness of these | |
special cases, often gives incorrect results when displaying such structured | |
text.</p> | |
<p>This document describes various examples of this issue, and proposes a | |
methodology to solve the related problems. The types of structured text treated | |
in this document are all excerpted from actual products, including Eclipse.</p> | |
<p>For a general introduction to bidirectional concepts, the reader is kindly | |
referred to the following technical article: "Bidirectional script support: a | |
primer" available at | |
<a href="http://www-128.ibm.com/developerworks/websphere/library/techarticles/bidi/bidigen.html"> | |
http://www-128.ibm.com/developerworks/websphere/library/techarticles/bidi/bidigen.html</a>.</p> | |
<h3>Working with Structured Text</h3> | |
<p>Eclipse provides support for correct presentation of structured text. The base | |
functionality can be found in the package <b>"org.eclipse.equinox.bidi"</b>. | |
The methods <code>process()</code> and <code>deprocess()</code> and their variants | |
in class STextProcessor will be a good starting point.</p> | |
<p>Consumers who would like to adjust Bidi environment settings, process bidi | |
text in portions, or directly manage directional formatting will find lower level | |
functionality available in the <b>"org.eclipse.equinox.bidi.advanced"</b> package.</p> | |
<p>Developers wishing to create handlers for types of structured text not | |
currently supported by Eclipse "out of the box" will create extensions for class STextTypeHandler | |
in package <b>"org.eclipse.equinox.bidi.advanced"</b>. Such new type handlers | |
should register with the <b>"org.eclipse.equinox.bidi.bidiTypes"</b> extension point.</p> | |
</BODY> | |
</HTML> |