2007年3月22日星期四
User scenarios of text grid
1. When user creates a text document, the default paper mode of text grid is read from user preference settings. User can switch the default paper mode of text grid in text document options tab page. (Tools --> Options --> Text Document --> General) by clicking the check box "Use squared paper mode for text grid".
2. When import a Ms Word 97/2000 file (.doc), the default paper mode is treated as "standard paper mode".
3. When import a text document of the previous version of OO.org (.odt, .sxw), the default paper mode is treated as "squared paper mode"
4. When user is editing a text document with text grid.
if he switchs the paper mode from "squared" to "standard", the following behavior is used:
* line height = Max base text size + Max ruby text size
* lines per page = type area height / line height
* Max ruby text size = 0
if he switch the paper mode from "standard" to "squared", the following behavior is used:
* line height = type area height / lines per page
* Max base text size = line height * 2 / 3
* Max ruby text size = line height / 3
2007年3月20日星期二
Two kinds of text grid layout
Per the text grid prososal approved by ODF TC, the style:layout-grid-standard-mode property is added to specified which kind of text grid is used for the document.
In order to ensure that either “sqaured mode” or “standard mode “is used for the whole document, the style:layout-grid-standard-mode property can only be set for the default style of the “page-layout”. When the style:layout-grid-standard-mode attribute appears inside a style:page-layout definition, then the attribute MUST be ignored.
Global setting entry for selection of which kind of text grid layout is used for the whole document. (Tools-->Options-->OpenOffice.Org Writer-->General)

When the "Use squared page mode for text grid" is checked, the original tab page of text grid is used.

When the "Use squared page mode for text grid" is unchecked, the following tab page of text grid is used.
2007年3月13日星期二
Text grid in Ms Word 97 binary file format
In Ms Word 97 binary file format, there are three SPRMs to deal with grid. They are:
| Name | sprm | Property | size | Description |
| sprmSDxtCharSpace | 0x7030 | Sep.dxtCharSpace | long | Specifies the grid width |
| sprmSDyaLinePitch | 0x9031 | Sep.dyaLinePitch | long | Specifies the grid height |
| sprmSClm | 0x5032 | Sep.clm | long | Specifies the grid type |
sprmSClm has four values, which corresponds to four types of grid.
| Name | value | Grid type |
| sprmSClm | 0 | No grid |
| 1 | Specify line and character grid | |
| 2 | Specify line grid only | |
| 3 | Text snaps to character grid |
2007年3月12日星期一
Text grid enhancement in MS Office 2007
Today, I downloaded and installed a Chinese trial version of MS Office 2007. I was surprised that “Square page mode” is also supported in MS word 2007, which is not supported in previous version.
Below illustrates the menu entry for “square mode” setting. ( Maybe this function is disabled in none_CJK version in default).
Setting tab page:
Squared page (20 ×20):
If the “square page mode” is enabled, the page setting menu is disabled. “standard page mode” setting is not allowed, which avoids mixed page mode in a document.
2007年2月26日星期一
Text doesn't snap to grid
For East Asian text, not more than one Asian character is displayed within a signle cell. The space between two Asian characters is (grid width - font height)
For Western text, The space between two Western characters is (grid width - font height)/2.
The following diagram illustrates this algorithm in brief.

Certainly, it just specifies what happens if grid width is greater than font height.
2007年2月16日星期五
Some knowledge about text grid
- linesAndChars (Line and Character Grid): Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the docGrid element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line. When this value is set, the input specified via the user interface may be allowed in exact number of line/character pitch units.
- snapToChars (Character Grid Only) : Specifies that the parent section shall have both the additional line pitch and character pitch added to each line and character within it (as specified on the docGrid element (§2.6.5)) in order to maintain a specific number of lines per page and characters per line.When this value is set, the input specified via the user interface may be restricted to the number of lines per page and characters per line, with the consumer or producer translating this information based on the current font data to get the resulting line and character pitch values
It seems that the author of the specification doen't know the essential difference between these two types of text grid. :-)
Currently, I am investigating the Document Grid specified in CSS3 mensioned by Florian.
http://www.w3.org/TR/2003/CR-css3-text-20030514/#document-grid
2007年2月15日星期四
* If the grid type is grid(line and characters) and the "snap-to-characters" attribute is ture, the Asian character is centered in the single cell, while the non Asian text is centered within as many cells as required.
* If the grid type is grid(line and characters) and the "snap-to-characters" attribute is false, the Asian character is not centered in the single cell, but what is the behavior for the non Asian text?
Below is the screenshot from MS Word

Figure 1,Text snaps to character grid

Figure 2, Specify line and character grid
It seems that there is a special behavior for non Asian text when the text doesn't snap to the character grid.
Where can I get some clues?


