Bug 94547 - Include a default set of fill patterns + MSO patterns for interoperability
Summary: Include a default set of fill patterns + MSO patterns for interoperability
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: target:5.3.0 target:5.2.2
Keywords:
Depends on:
Blocks: Object-Fill
  Show dependency treegraph
 
Reported: 2015-09-27 11:16 UTC by Yousuf Philips (jay)
Modified: 2016-09-06 19:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
MSO pattern preset preview images (10.74 KB, application/zip)
2015-09-27 11:16 UTC, Yousuf Philips (jay)
Details
pattern images (26.30 KB, application/zip)
2016-08-26 15:17 UTC, Yousuf Philips (jay)
Details
OOXML patterns incorrectly imported as hatches (32.94 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-09-04 16:45 UTC, Luke
Details
binary patterns correctly imported (59.00 KB, application/msword)
2016-09-04 16:46 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) 2015-09-27 11:16:16 UTC
Created attachment 119068 [details]
MSO pattern preset preview images

LibreOffice provides a default set of fill colors, gradients, hatchings and images, but no patterns. Having a default set of fill patterns will make it easy for users who wish to use patterns to easily apply a pattern, rather than first having to create one.

This will also improve interoperability with MSO formats, which has a predefined set of 54 default patterns but only displays 48 of them to users. Included in the attched zip file.

https://boardgamegeek.com/camo/268de3613348284f151982f3e37cad7e4f733ae2/687474703a2f2f7777772e656d746563682e6e65742f7475746f7269616c732f776562706167652f7061747465726e2e676966

It would be good to separate these pattern presets from the bitmap tab and also move the pattern editor from the bitmap tab.
Comment 1 MM 2015-09-27 19:51:39 UTC
Duplicate of bug 70384 and maybe even sideways bug 44552 ???
Comment 2 Yousuf Philips (jay) 2015-09-28 11:05:57 UTC
(In reply to MM from comment #1)
> Duplicate of bug 70384 and maybe even sideways bug 44552 ???

Both are fill pattern related, but each has it own focus.

Bug 70384 is about using a pattern fill as a cell background, which is something currently not supported in the UI, similar to it also not being able to have a gradient or hatching fill. The bug does linked to ( http://www.cs.arizona.edu/icon/docs/images/gipd7.gif ), which had the scales pattern that isnt available in MSO.

Bug 44552 is about fill patterns import support in the libvisio, which would likely benefit from fixing this bug, as it could reuse the patterns and similar code, but libvisio is an independent library.
Comment 3 Yousuf Philips (jay) 2015-09-28 11:13:21 UTC
Looking at attachment 55255 [details] from bug 44552, it seems Visio has a number of patterns that arent included in MSO, like 16 and 23.
Comment 4 Fridrich Strba 2016-01-15 11:48:37 UTC
I implemented to a certain level all Visio fill patterns. They will be in LO 5.1.0. They are not perfect, but they fix this bug more then royally.
Comment 5 Yousuf Philips (jay) 2016-02-02 14:47:30 UTC
@Fridrich: Looking at your patches, they are for import support of patterns, but not on having a default set of patterns for use, which this bug is intending to do.
Comment 6 Heiko Tietze 2016-05-21 14:56:06 UTC
We need to name (or better tag) every pattern. And I believe that 51 different patterns is way to much for those random geometrics. 

I wonder if there are standardized patterns, like those used in geographics. Stuart, any idea?
Comment 7 Yousuf Philips (jay) 2016-05-24 18:04:50 UTC
Microsoft has named all of these patterns and as stated in the description, they are all needed to improve compatibility so we need to have them all, but we can also have our own set to extend these.
Comment 8 Heiko Tietze 2016-05-24 19:03:35 UTC
(In reply to Yousuf (Jay) Philips from comment #7)
> Microsoft has named all of these patterns and as stated in the description,
> they are all needed to improve compatibility so we need to have them all,
> but we can also have our own set to extend these.

Microsoft saves the pattern by name? And we spam our freshly baked dialog with more than 50 ugly patterns just for maximizing compatibility? So my suggestion is to use <20 of them.
Comment 9 Yousuf Philips (jay) 2016-05-25 06:19:52 UTC
(In reply to Heiko Tietze from comment #8)
> Microsoft saves the pattern by name?

I believe they are saved as number reference, as that is what has been implemented in libvisio - https://cgit.freedesktop.org/libreoffice/libvisio/commit/?id=8ce3cd43bfb1190574296b7fad873fe3fa16007d

> And we spam our freshly baked dialog with more than 50 ugly patterns just for maximizing compatibility?

Patterns in general wont be highly used, as people prefer gradients and bitmaps to fill with, but the their set of patterns are quite nice and usable.

> So my suggestion is to use <20 of them.

Here is how its shown in MSO.
http://pjnicholson.com/compappmyp_part2/patternfill_rool.gif
Comment 10 Yousuf Philips (jay) 2016-06-18 21:30:06 UTC
Exploring a docx file, fill pattern are not saved in the document as 8x8 gifs, but instead as reference IDs like "diagBrick". LO has the list of references IDs at < http://opengrok.libreoffice.org/xref/core/writerfilter/source/ooxml/model.xml#1748 >.
Comment 11 Heiko Tietze 2016-06-19 07:28:26 UTC
In order to retrieve all settings when a preset is loaded we need a way to set the pattern bits from either the image or some new format.
Comment 12 Luke 2016-06-26 17:24:21 UTC
I agree we don’t need to spam all 50 MSO patterns to our users. However, currently we don't offer any detailed patterns, we do not import background colors (Bug 95168), and we convert all fill pattern to hatches. So properly supporting fill patterns internally would be a huge win to our users. And, offering ~20 of the best brick, stripe, spot, and checkerboard patterns would also be a nice UI improvement. 

As far as the 8x8 LO vs 32x32 MSO pattern issue, couldn’t we increase our internal pattern size? We already support tiling any size bitmap. When loading old ODF documents we could easily scale the old 8x8 patterns to 32x32. Is there a major technical reason this could not be done?
Comment 13 Yousuf Philips (jay) 2016-08-26 15:17:16 UTC
Created attachment 127036 [details]
pattern images

Attached the 8x8 pattern presets and named them according to their reference id from the model.xml file and organized them according MSO's dialogs arrangement.

Patch for master - https://gerrit.libreoffice.org/28409
Patch for 5.2 - https://gerrit.libreoffice.org/28410
Comment 14 Commit Notification 2016-08-29 12:44:46 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

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

tdf#94547 Default set of pattern presets

It will be available in 5.3.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 15 Heiko Tietze 2016-08-29 20:49:36 UTC
54 patterns, all black and white, looking like from the last century. But it works.

If we do not aim for interoperability I would keep 5,25,50,75 percent, the medium diagonal, vertical and horizontal lines, confetti, zigzags, waves, bricks, dotted grid, small and large grid, and shingles.
Comment 16 Luke 2016-09-04 16:45:57 UTC
Created attachment 127145 [details]
OOXML patterns incorrectly imported as hatches

In the description, you wrote:
"This will also improve interoperability with MSO formats", but we still do not import OOXML patterns as bitmaps like we do with the old binary formats. Do you want to track that issue here or is it tracked in another report?
Comment 17 Luke 2016-09-04 16:46:38 UTC
Created attachment 127146 [details]
binary patterns correctly imported
Comment 18 Luke 2016-09-04 16:51:01 UTC
Sorry, I see Jay answered my question already in Bug 94773. We're tracking the OOXML issue there.
Comment 19 Commit Notification 2016-09-06 19:48:09 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3cba0fd0a45b7eeb7497457822c071cc79f8ce3b&h=libreoffice-5-2

tdf#94547 Default set of pattern presets

It will be available in 5.2.2.

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.