Character orientation in Asian and Mongolian read-direction (vertical text lines)
unmei <[email protected]> Sat, 13 Aug 2005 20:36:40 +0200
| Newsgroups | gmane.comp.multimedia.usf.devel |
|---|---|
| Message-ID | <[email protected]> |
<please excuse if this is a double post, but i think the original gots=20
swallowed on the way to the newsgroup>
I would like to get some feedback on how we should handle glyphs=20
("letter pictures") when the read-direction attribute is set to Asian or=20
Mongolian.
In this case glyphs in the "native" script are usually rendered upright,=20
but words in other scripts, namely in latin alphabet are sometimes=20
rotated by 90=C2=B0 clockwise (tilt your head to the right to read). Now,=
in=20
unicode there is a "asian-width" property assigned to each symbol=20
("letter") this property in some way relates to our orientation problem=20
in that you have narrow, wide, half-width and full-width versions of=20
US-ASCII characters. And all CJK letters tagged as wide or full-width=20
are always upright. But the problem is that you cannot say, ok then we=20
rotate all tagged as narrow or half-width. For one, there are CJK=20
characters tagged as one of those as well. Then you have Mongolian (any=20
maybe other Scripts to be upright) that are tagged as narrow but they=20
need to be upright. Also there are a lot of narrow or ambiguous tagged=20
misc symbols, punctuation that may have to be upright or rotated or even=20
depending on context. And finally you would want to write a western word=20
in upright manner that contains letter that have no wide/full-width=20
tagged representation (for example containing an umlaut or accent).
For this reason i think for a solution where decision on orientation is=20
made from the character code (any maybe its neighbour characters) it is=20
very difficult to define a satisfactory set of rules (let alone a=20
complete and final solution).
Therefore i now think the "best" approach is to introduce an attribute=20
that defines the orientation of glyphs. This should be a fontstyle=20
attribute in order to allow adjusting the representation of a single=20
word within a longer run in a subtitle text by using the attribute in a=20
<font> tag, or refer to a style defining the orientation by specifying=20
that style also in a <font> tag around the word in question.
It is probably safe to ignore that attribute when the read-direction is=20
Western or Arabic. However if it is not ignored you could create funny=20
things here, especially if that tag is interpreted to turn the character=20
90=C2=B0 counter-clockwise instead of clockwise. Or the attributes could=20
allow values "+90", "0", "-90" and maybe more instead of a simple=20
boolean flag such as "upright"|"rotated".
The attribute should not be required, therefore it should default to the=20
most used setting. I think this is "upright" (else you have to specify=20
it on all text in CJK/Mongolian when using Asian/Mongolian read-direction=
!).
If the attribute is to be an amount of rotation rather than a boolean=20
flag, the default should be "0"(=C2=B0) and is interpreted as upright in=20
Asian/Mongolian read-direction. For simplicity, i think the attribute=20
values in this case should (at least for a start) be restricted to=20
multiples of 90=C2=B0. Intermediate values allow for fancy effects, but=20
proper positioning of such glyphs may pose a problem because the=20
"effective" bounding box had to non-orthogonal to the text baseline.
In conclusion i propose the the introduction of a fontstyle attribute=20
"glyph-rot" with positive or negative values representing glyph rotation=20
given in counter-clockwise degrees without unit (without "=C2=B0"). The=20
default value is "0". Mandatory support for non-animated values "-90",=20
"0", "90", "180" and optional (possibly mandatory in the future? -=20
rather not..) support of any real number and animation.
Comments are welcome.
If no-one replies, i assume it is ok to include this in a next proposal,=20
implement it in pixifier and drop the recently introduced automatic=20
rotation of characters with code below 128 (that is, US-ASCII type letter=
s).
[examples]
assuming the read-direction is Asian or Mongolian and the default style=20
does not set the glyph-rot attribute.
<text>=E3=81=A6=E3=80=81<font glyph-rot=3D"-90">GraphEdit</font>=E3=81=AE=
CPU=E3=82=92=E7=B5=9E<br/>=E3=81=A3=E3=81=A6=E3=81=8A=E3=81=84=E3=81=A6=20
=E3=81=8B=E3=82=89=E3=80=81=E3=83=86=E3=82=B9=E3=83=88=E3=81=99=E3=82=8B=E3=
=81=A8=E3=80=81</text>
Here the word "GraphEdit" is rotated to look like in western script if=20
you tilt your head to the right (as if left side were bottom). The also=20
western script word "CPU" is rendered like all the japanese letters,=20
upright letters and one "per western line" like this:
C
P
U
<style name=3D"tilt">
<fontstyle glyph-rot=3D"-90">
</style>
<text>=E3=81=A6=E3=80=81<font style=3D"tilt">GraphEdit</font>=E3=81=AECPU=
=E3=82=92=E7=B5=9E<br/>=E3=81=A3=E3=81=A6=E3=81=8A=E3=81=84=E3=81=A6=E3=81=
=8B=20
=E3=82=89=E3=80=81=E3=83=86=E3=82=B9=E3=83=88=E3=81=99=E3=82=8B=E3=81=A8=E3=
=80=81</text>
This second example uses a style to rotate the glyphs, but the output=20
looks the same as that of the first example.
regards, unmei
http://usf.corecodec.org