Mailinglist Archive: opensuse-features (396 mails)

< Previous Next >
[openFATE 308334] Distribute individual let ters across cell width and height (aka 均等割符)
  • From: fate_noreply@xxxxxxx
  • Date: Mon, 11 Jan 2010 19:25:20 +0100 (CET)
  • Message-id: <feature-308334-19@xxxxxxxxxxxxxx>
Feature changed by: Kohei Yoshida (kohei_yoshida)
Feature #308334, revision 19
Title: Distribute individual letters across cell width and height (aka 均
等割符)

Requested by: Kohei Yoshida (kohei_yoshida)

Description:
Distribute letters at equal intervals across cell's width such that the
first and last letters are aligned with the left and right edge of the
cell, respectively.  Also support similar distribution mechanism in a
vertical direction.
This functionality is also known as Kin-tou Wari-fu (均等割符) in Japanese,
and is very common operation among Japanese Excel users.

Relations:
- i#107467 - Excel import issue with cells with distributed content
(url: http://qa.openoffice.org/issues/show_bug.cgi?id=107467)
- i#107470 - Request for this feature in the upstream IZ (url:
http://qa.openoffice.org/issues/show_bug.cgi?id=107470)

Use Case:
Sentences in the Japanese language do not normally break at each word
unlike most Western languages.  The normal justification functionality
is therefore useless for the Japanese users.  Instead, they typically
justify sentences by adjusting spaces between letters, which is what
this requested functionality will provide.

Discussion:
#3: Kohei Yoshida (kohei_yoshida) (2010-01-05 14:22:02)
I've started looking into this.

#4: Kohei Yoshida (kohei_yoshida) (2010-01-05 17:36:46)
Here is the initial hurdle: Calc uses XSL-FO for all text formatting,
and fo:text-align specifies the alignment of a text (I assume for both
horizontal and vertical directions). The bad news is that, this
attribute does not allow a "distributed" alignment, but in order for us
to implement this feature, we need that to allow a distributed
alignment.
Reference: http://www.w3.org/TR/xsl/#text-align

#5: Kohei Yoshida (kohei_yoshida) (2010-01-05 17:45:10) (reply to #4)
Well, I guess I could use the "justify" alignment and additional flag
to specify how the content is justified. The spec allows user-agent-
specific justification algorithm, so it's doable without breaking the
standard.

#6: Kohei Yoshida (kohei_yoshida) (2010-01-05 17:49:15) (reply to #5)
And we could perhaps use the 'text-justify' attribute to specify the
justification algorithm. See below:
http://www.w3.org/TR/1999/WD-i18n-format-19990910/#a5

#7: Kohei Yoshida (kohei_yoshida) (2010-01-05 17:59:37) (reply to #6)
This one is the latest spec of the fore-cited:
http://www.w3.org/TR/i18n-format/#text-justify

#8: Kohei Yoshida (kohei_yoshida) (2010-01-08 12:39:43)
Ok. Here is how I've decided to store this in ODF.
For both normal justifiation and distributed justification, the style
attribute 'fo:text-align' is saved as 'justify'. Then, for the
distributed justification, an additional style attribute 'csstext3:text-
justify' gets stored with a value of 'distribute'. For the normal
justification, either this value is 'auto', or this attribute won't get
stored at all.
It took me a while to get to this point since OOo's handling of style
attributes and how they are exported to xml are very complex. But I
eventually got it to save and load correctly.

+ #9: Kohei Yoshida (kohei_yoshida) (2010-01-11 13:23:40)
+ For alignment in vertical direction, the current ODF uses style:
+ vertical-align attribute which can be either one of: automatic, bottom,
+ middle, top. First, we need to add a new alignment type 'justify' to
+ the style:vertical-align, and use another attribute to specify the
+ justification method. This would be similar to how the horizontal
+ justification is handled. The problem is that we can't reuse the same
+ 'text-justify' attribute name since that would clash with the
+ horizontal justification method attribute. We need a new attribute name
+ for this to avoid such naming clash.
+ The first name that comes to mind is style:vertical-justify , which
+ specifies the same set of values that the csstext3:text-justify
+ supports. Of course, this imlies that to finalize this feature we need
+ to get blessing from the ODF TC, which may not happen in a timely
+ manner. We need to come up with a "solution" for that as well.



--
openSUSE Feature:
https://features.opensuse.org/308334

< Previous Next >
This Thread
References