Grid display line

From Apache OpenOffice Wiki
Jump to: navigation, search


  • Last update: March 4, 2008 by tora


This sub-project aims at making grid lines for Grid (lines only) - covering Grid (lines and character spacing) - appropriate to meet Asian culture.

No grid Grid (lines only) Grid (lines and characters)
Grid display line 0001.png Grid display line 0002.png Grid display line 0003.png

The above pictures are taken with 2.3 plus accomplishments of this project running on Linux and then positions of characters are slightly - by a few dots - tweaked to make better, ideal layout.


The pictures below are taken with pure 2.3 running on Windows.

No grid Grid (lines only) Grid (lines and characters)
Grid display line 0011.png Grid display line 0012.png Grid display line 0013.png
  • Two grid lines are drawn for a single text line in the Grid (lines only) mode.
  • A ruby portion is wrongly positioned in the No grid mode. This problem will be discussed separately in an article Wrong_position_of_ruby_text.

Sample files


  • Height of line could be addition of base text height and ruby text height.
  • No distinguishing ruby text from base text is needed.
  • An entry 'Automatic' from the Text-to-text Alignments of Paragraph style could be treated as 'Middle' regardless of direction of writing.
    • Even though, the ODF specifications in the section of , says 'Automatic' is treated as 'Base line' for horizontal writing and 'Middle' for vertical writing, 'Automatic' could be always treated as 'Middle' for Grid (lines only).
  • Both horizontal writing and vertical writing are well supported, especially non-Asian letters should be treated appropriately.
  • Text-to-text Alignments of Paragraph should be treated as well, even though the similar application seems not to able to recognize this attribute in the grid mode.

Text-to-text Alignments

Alignment Example
Top Grid display line 0021.png
Grid display line 0022.png
Base line Grid display line 0023.png
Bottom Grid display line 0024.png

File format

No modification might be needed for the ODF file format.

A set of Text-to-text alignment is defined in the section "15.5.35 Vertical Alignment" of "Open Document Format for Office Applications (OpenDocument) v1.1" [1]

Is says that "auto - Automatically, which sets the vertical alignment to suit the text rotation. Text that is rotated 0 or 90 degrees is aligned to the baseline, while text that is rotated 270 degrees is aligned to the center of the line." It, however, does not mention about Grid layout.


No text has been added.


The following modules have been modified.

Module Modifications
  • SwPageFrm::PaintGrid() in sw/source/core/layout/paintfrm.cxx
  • SwTxtCrsr::AdjustBaseLine() in sw/source/core/text/itrtxt.cxx
  • SwTxtFormatter::CalcRealHeight in sw/source/core/text/itrform2.cxx
  • and more...

Online help

No text has been added to the online help.


Personal tools