2007年2月14日星期三

Text Grid Enhancement

It is my pleasure to announce a new enhancement feature (Text Grid) in writer document. Currently I am work on this feature.

* Create a new page in openoffice wiki to ask for input. Here is the link : http://wiki.services.openoffice.org/wiki/Text_grid

* Below is the two kinds of text grid layout.







Figure1, Squared page mode


Figure2, Rectangle page mode

1) "Squared paper mode". It is used by ODF.
For this kind of grid layout, the page is divided in a fixed numbers of lines (lines per page). The lines are divided into squared cells (characters per line). The number of lines per page depends on the line height ( i.e., the sum of grid base and ruby height), and the characters per line also depends on the line height.

In "Squared paper mode", the “Characters per line” setting has the most high priority, it will determine the height of line, then the “Lines per page” setting has the second priority, it will determine the height of type area.

This kind of grid layout "Squared paper mode" is used to simulate “squared paper”, which is a kind of specific paper used 20 years ago(before personal computer is widely used in text processing). But now, “squared paper” is only used in very limited case, and most CJK users won't use it anymore.

2) "Rectangle paper mode". It is used by OpenXML, UOF (Chinese Office File Format) and other CJK office suites (i.e., EIOFFICE, WPS).
For this kind of grid layout, the page is divided in a fixed numbers of lines (lines per page). While the lines are divided into rectangle cells (characters per line). Ruby grid is not specified in this paper mode. So the line height is grid base height and the characters per line depends on the grid base width, not grid base height.

In "Rectangle paper mode", type area has the most high priority, it will determine the height of line; the “Lines per page” setting has the second priority, and “Characters per line” setting can only determine the width of characters, and can't influence line height in anyway.

This kind of grid layout "Rectangle paper mode" is wildly used in CJK users.

* Snap to characters

We add a “snap to characters” attributes to specify whether the Asian character is centered in the grid cell or not when the grid type is set as “Grid(lines and characters)”. The default value “snap to characters” is “true”.

This additional attribute also improve the compatibility with MS word. Below is the map of grid type between MS Word 2003 and OpenOffice

Word 2003
OpenOffice.org 2.1.0
1. No grid
A. No grid
2. Specify line grid only (Default)
B. Grid (lines only) (Default)
3. Specify line and character grid 
C. Grid (lines and characters), “snap-to-characters” is false.
4. Text snaps to character grid  
D. Grid (lines and characters), “snap-to-characters” is true.


Figure 3. No grid

Figure 4 . Grid (lines only)


Figure 5. Grid (lines and characters), “snap-to-characters” is false


Figure 6. Grid (lines and characters), “snap-to-characters” is true

As shown in Figure 5, when "snap-to-chars" is false, the Asian characters are not centered in the cell, while the Western character ("OpenOffice.Org) are also centered in the cell. This is not accurate. It is work in progress now.

没有评论: