https://bugs.documentfoundation.org/show_bug.cgi?id=36709

--- Comment #33 from Jonathan Clark <[email protected]> ---
This bug is a fairly large task, so I wanted to briefly review the current
state as I understand it. Comments are appreciated.

1. The Ch unit

For the purposes of CJK typesetting, we want a variable-length unit equal to
the advance measure of a Han ideograph in the current font. In CSS, this unit
is called 'ic'. In Microsoft Word, this unit is called 'Ch'. From what I've
seen, Ch is set as the default length unit when an Office CJK language pack is
installed, so Word documents that use Ch as a unit are likely very common.

A unit called Ch was added to LibreOffice in 2010. Unlike the previous
examples, this unit is hard-coded as equal to 210 twips. That hard-coded value
is used unconditionally, regardless of font, style, or context, including if
text grid is enabled. I suspect this was originally intended as a short-term
fix to ease importing Word documents that use Ch units along with a specific
default font/size. I wasn't able to locate any discussion or non-source
artifacts concerning this design, so unfortunately I can only speculate.

Regarding standards: For length units, the ODF 1.3 specification only refers to
a list of recommended units in §5.9.13 of the XSL 1.0 specification. The Ch
unit is not mentioned at all, so we seem free to redefine Ch as we need. The
standard does not seem to prohibit us from persisting or consuming Ch as a
unit.

Regarding impact: A change to Ch would have no impact on existing Writer
documents. Writer does not persist the Ch unit. Writer reports an error when
parsing a document that contains the Ch unit. Currently, the Ch unit is an
artifact of the user interface only. (Note that the example attachment above
does not contain Ch units. They were automatically converted to cm.)

In the interest of compatibility with other programs, I recommend changing Ch
from a fixed unit to a relative unit, formalized as equivalent to CSS 'ic'. I
also recommend that we do not implement a compatibility flag, as such a flag
will have no effect.


2. Relative units in Writer

Per ODF 1.3 §20.225, fo:text-indent only requires support for a single
relative-length unit: percent. The standard neither prescribes nor proscribes
support for other relative-length units, but does seem to recommend em
(transitively via XSL 1.0 §5.9.13).

Currently, Writer supports percent in fo:text-indent. Writer does not support
em, or any other relative-length unit. Percent may be used in the paragraph
style editor, but it is ignored in the paragraph properties dialog.

This code change could end up being quite large, especially considering that
once we start changing unit support for some attributes, we will likely want to
keep it consistent across all of them. In order to manage the complexity for
this code change, I recommend the following general breakdown:

- Start with a separate task(s) to add *em* support to fo:text-indent, as em is
already recommended by the standard.
- Build relative Ch support on top of that change.
- File separate bugs against the remaining attributes, so they can be tackled
one-by-one.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to