Bug 107025 - FORMATTING: Characters are too close when snap to char is turn off
Summary: FORMATTING: Characters are too close when snap to char is turn off
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0
Keywords:
Depends on:
Blocks: Text-Grid
  Show dependency treegraph
 
Reported: 2017-04-08 01:40 UTC by Mark Hung
Modified: 2017-07-03 14:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample File (11.26 KB, application/vnd.oasis.opendocument.text)
2017-04-08 01:40 UTC, Mark Hung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hung 2017-04-08 01:40:02 UTC
Created attachment 132403 [details]
Sample File

1. Tools / Options / LibreOffice Writer / General / Use, uncheck "square page mode"
2. Select "Lines and Chars" in Text Grid tab in Page Style dialog.
3. Set Lines per page to 60, Max base text size to 12pt
4. Set Characters per line to 60, Characters width to 8pt
5. Enter some Chinese with text less than 10 pt. It even overlap when text size is 6pt.


According to ODF1.2, 20.301 style:layout-grid-mode Within a layout cell, no more than one Asian [UNICODE] character is displayed. An Asian character that does not fit into a single layout cell is displayed centered into as many layout cells as required. Non Asian text is centered within as many cells as required.

According to ODF1.2, 20.305 style:layout-grid-snap-to
The style:layout-grid-snap-to attribute specifies whether the text is snapped to the grid or not. It is evaluated only if the style:layout-grid-mode attribute has the value both and the style:layout-grid-standard-mode attribute has the value true.

Microsoft Word has similar feature, that it can select "Lines and Chars", except it specifies character distance and line distance instead of Max base text size and Character width. So characters are always layout in fix distance.
Comment 1 Xisco Faulí 2017-04-13 09:23:18 UTC
I trust you. Setting to NEW
Comment 2 Mark Hung 2017-04-15 12:22:22 UTC
Note for what I have found
1. It is not clear what it should be when "Snap to Char" is unchecked,
the actual formatting behavior is unspecified or ambiguous in ODF1.2, 20.305 of ODF 1.2.

2. Writer formats this way: it offset each Chinese character by ( grid width - font height of default style  ). It may be negative, that's why characters cluttered or overlapped.

3. Imitating what Microsoft Word do is preferred, but Writer ( or ODF1.2 ) lacks of the necessary attribute, character distance, but may be devise from number of characters per line.
Comment 3 Mark Hung 2017-04-15 12:57:44 UTC
Ok, it seems ( grid width - font height of default style  ) is what Microsoft Word does, except it do not use negative value.
Comment 4 Commit Notification 2017-04-17 09:28:48 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bdaf1708abeb1924f0cca21ec305638f4e0beb6c

tdf#107025 advance only if grid is wider than font.

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Xisco Faulí 2017-06-09 09:57:56 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?