Scribus Forums

Scribus => General Discussion => Topic started by: PK on January 18, 2024, 01:58:48 PM

Title: Strange style behavior
Post by: PK on January 18, 2024, 01:58:48 PM
Hi,

I post it, before opening a ticket in the bug tracker... I'd like to be sure that the problem does not come from me :(

I have isolated the problem with a test doc, attached from this message.

I have a style for the first paragraph (for having a Lettrine(= a drop initial capital) and a style for the others. All the other parameters should be the same, except that the indentation (no indent for lettrine one). I had two styles with no heritage for not having problems.

In fact, they come from the odt document, when I import it. I have to modify them by hands, because they are transformed from the original ones (for instance, I loose the lettrine property).

I have a strange behavior. The first lettrine paragraph seems like I want: no indentation. The second one has an indentation. I don't understand why. If I set up the automatic indent in the lettrine properties, so the second indentation is OK and the first other paragraph is full indent, as it exists an optical ruler on the left.

If I type by hands the text in the second paragraph, the problem disappears, as it was in the text itself.

I have compared all I could, but I have not seen anything that can explain this. The problem is that the original document has many paragraphs to modify for respecting what I want.

Help is welcome: thanks a lot...
Title: Re: Strange style behavior
Post by: PatJr on January 18, 2024, 03:24:28 PM
all I got was a bunch of font errors, missing, and a lot of blank pages
can you make a shorter sample file, 2 or 3 pages with an open source font so it's distributable with the font?

Title: Re: Strange style behavior
Post by: PK on January 18, 2024, 03:37:52 PM
I kept the skeleton of my doc if ever... The test inits at the page 11.

Here below the same test case with only 2 pages.

The real used font is free: Century Schoolbook L for my doc.
Title: Re: Strange style behavior
Post by: a.l.e on January 18, 2024, 05:12:24 PM
can you also attach a screenshot of what you see?

personally, with the fonts replaced with random ones on my computer, it does not really look good but i don't see either what is wrong with it.

personally, i mostly don't like the drop caps effects but if i needed to do it, i would turn off "auto-indent" and set an offset of 1mm
Title: Re: Strange style behavior
Post by: PK on January 18, 2024, 05:26:19 PM
Quote from: a.l.e on January 18, 2024, 05:12:24 PMcan you also attach a screenshot of what you see?

personally, with the fonts replaced with random ones on my computer, it does not really look good but i don't see either what is wrong with it.

personally, i mostly don't like the drop caps effects but if i needed to do it, i would turn off "auto-indent" and set an offset of 1mm

-08 is the form I want to get (1st paragraph without indent, the second one with indent)
-32 is my second page, with the same style and the error: the first paragraph is indented!
-07 is now the automatic indent property (for the two next images)
-24 is now still not indented for the first line, but all the next ones are indented!
-44 is the second page which is now OK

If it is not clear, tell me!





Title: Re: Strange style behavior
Post by: a.l.e on January 18, 2024, 05:46:51 PM
i wanted to check how exactly you defined your styles... but, indeed there are too many!

anyway, i tried to reproduce your sample with the C and i did not have any issue (if i got what you want to achieve...)

- drop caps
- 2 lines
- 1 mm of margin

lettrine.png
Title: Re: Strange style behavior
Post by: PK on January 18, 2024, 06:58:17 PM
Quote from: a.l.e on January 18, 2024, 05:46:51 PMi wanted to check how exactly you defined your styles... but, indeed there are too many!

anyway, i tried to reproduce your sample with the C and i did not have any issue (if i got what you want to achieve...)


I used only 'Chapitre', 'Premier paragaphe' and 'Paragraphe' styles in my document, then you need to check only them.

I'm able to correct my doc by hands, as I said. If I remove by hands the bad text by reintroducing a new one, the problem is gone. The problem is that I have many paragraphs such as it!

My case doc is targeted to be analyzed, to understand why it happened and eventually to have a trick for a general solution, because to correct all by hand is a little bit tricky... I suspect an import problem from LibreOffice format, but I can't prove it...
Title: Re: Strange style behavior
Post by: a.l.e on January 18, 2024, 07:35:03 PM
In order to further help you, i need to know, if what I have recreated is exactly what you need.

If it's not, please modify my .sla upload it, together with a screenshot of the result.

It's much easier to discuss about a simple example rather than 20 pages long document with dozens of styles and potential local formatting...
Title: Re: Strange style behavior
Post by: PK on January 18, 2024, 07:43:07 PM
Quote from: a.l.e on January 18, 2024, 07:35:03 PMIn order to further help you, i need to know, if what I have recreated is exactly what you need.

If it's not, please modify my .sla upload it, together with a screenshot of the result.

It's much easier to discuss about a simple example rather than 20 pages long document with dozens of styles and potential local formatting...

OK, I modified your .sla for having what I want. I have added a second style named Paragraphe, which is the second paragraph without lettrine *and* an indentation at the first line. 

Thanks for your help
Title: Re: Strange style behavior
Post by: PatJr on January 18, 2024, 10:36:48 PM
is this what you are looking for?

for the indents I have to type the numbers in the dialog box or it doesn't work properly
Title: Re: Strange style behavior
Post by: PK on January 18, 2024, 11:03:29 PM
Quote from: PatJr on January 18, 2024, 10:36:48 PMis this what you are looking for?

for the indents I have to type the numbers in the dialog box or it doesn't work properly


No, it isn't. What I'm looking for is what I have corrected in your last lettrine.sla.

Per chapter...
* first paragraph with lettrine and no indent for the first line
* other paragraphs without lettrine and indent for the first line
(this is a very classical typo in French)

The image bellow does not show the chapter title, but it is the idea  8)

This works perfectly with Scribus if I do it by hands. If I import a text from LO, it failed. First, the import of style does not work perfectly (i.e. the lettrine case does not work). But it is easy to correct by hands, by correcting the style.

At this point, it remains problems, as I have described in the thread. Some paragraphs with lettrine work nice (no indent) and some no. Without obvious reasons. I put a test case, for analyzing, showing a paragraph OK and an other KO. If you correct my test case by hands, it will work of course. I suppose there is "something" in the text of the first paragraph or something elsewhere that changes the indentation. I confess to not having disassembled the .sla to see what is wrong inside... 

My first question is to know if it is a bug (may be from the import process) or not. And the second point is - if we can understand what is wrong -  to have a trick for being able to correct easily all my doc  :D   

I hope to be clear  ;D
Title: Re: Strange style behavior
Post by: a.l.e on January 19, 2024, 12:08:46 PM
from what i can tell, all you need to do is to remove the "auto indent" from the "premier paragraph" style.
(well, as i wrote in a previous post, and as i did in my sla, you should probably also add a small margin between the drop cap and the start of the text... but that's up to you)

then it you should be fine.
Title: Re: Strange style behavior
Post by: PK on January 21, 2024, 05:31:48 PM
As I said, the problem is not how to do. I know and it works well. The problem is WHY it does not work with the example I put... It is easy to correct, but WHY this example does not look like it should be.

I guess that there is a bug and this is the reason why I propose an example...
Title: Re: Strange style behavior
Post by: a.l.e on January 21, 2024, 07:18:50 PM
as i wrote above: you need to remove the auto-indent from your "premier paragraph" style.

and for the second "relevant" page remove the first line indent or "re-apply" the "premier paragraph" style.

then, it will look like this:

premier-paragraph.png

... which, if i understood you correctly, is what you are looking for.

p.s.: theoretically, you should be able to reset all your text to the style defaults, but while writing this reply, i've hit this bug: https://bugs.scribus.net/view.php?id=17141
Title: Re: Strange style behavior
Post by: PK on January 22, 2024, 08:36:14 AM
Yes. It is what I do to correct the problem. But it is a mess, because there are more than the half of the chapters to do :(

My target is not to how to correct it (except eventually if there is a general way to prevent this 'behavior'), but to confirm the problem and to propose a test case in order that the Scribus dev team might analyze for correcting in the future ;-)

Title: Re: Strange style behavior
Post by: a.l.e on January 22, 2024, 12:17:18 PM
so scribus seems to correctly display the text, according to the styles you have defined.

it's harder to know if there is a problem with the odt importer, since you're not providing any odt file you're using.

from a quick test i did, i would say that the importer is behaving okayish and you will probably like the result better, if you would tell the importer not to prefix the style names with the name of the text frame.

the only thing i think could be improved, is that the importer seems to create all the styles that are in use in the odt, instead of creating the styles that are actually used by the imported content.
but it does not create styles that are clearly useless (if i have never had a heading2 in the odt, i don't get a heading2 created in the scribus file, either).
it's really not that bad.

personally, i think you should try to create small test odt and .sla files and incrementally add features until you see what you call the bug...
then, you can create a new sample file, with only that part in and -- if the bug is still there -- post it here.
with screenshots of what you get and what you would expect...
Title: Re: Strange style behavior
Post by: PK on January 24, 2024, 10:38:08 AM
OK, I will try to extract a test case like this.

Waiting for that, I begin to understand that Scribus has a general problem with styles when you edit an long book (may be due to the import process of LO, who knows?). From now, I used Scribus for short docs.

I note that Scribus may not apply the dedicated styles (as the text editor shows them) when you save the text in the editor. Some of the styles are not applied. Why? It is a mystery. My previous test case shows an evidence of this bad behavior.

I just finished the layout of my book and I have now to apply again the style all the paragraphs for being sure that their layout is good. It is a bad new, because it means that I have to finalize again the last 'by-hand' adjustments  :'(
Title: Re: Strange style behavior
Post by: PK on January 24, 2024, 01:34:25 PM
Quote from: PK on January 24, 2024, 10:38:08 AMI just finished the layout of my book and I have now to apply again the style all the paragraphs for being sure that their layout is good. It is a bad new, because it means that I have to finalize again the last 'by-hand' adjustments  :'(

An other strange issue. I thought to transform all my dedicated style (for instance, style1) by using the Edit -> Select menu of the text editor. I can select a style, then I select the style1 style and I ask to transform in style1 (what I do by hands in fact).

Then Scribus transforms all the style in style1  :o 
Title: Re: Strange style behavior
Post by: Nermander on January 24, 2024, 05:16:01 PM
I think the main issue is styles in imported text. If you define the styles and edit the text directly in Scribus I don't think there are any issues (because that would make Scribus almost unusable).
Title: Re: Strange style behavior
Post by: a.l.e on January 24, 2024, 06:43:00 PM
so, i finally created an odt and tried to do something similar as your doing.

much simpler, of course, since it's for checking a bug.

- i could import the .odt in a text frame.
- and in a second one, too.
- of course, since i was planning to import a set of document (in my case the same one) with the same styles applied, i did uncheck "prefix styles with item name".
- the number of styles is a bit too high, for the styles i've effectively used, but it's not that terrible.
- the drop caps i've defined in "First paragraph" was not recognized by scribus.
- i could easily add the drop caps, but when importing again the same .odt in the same .sla file the changes got overwritten by the style from the .odt (i guess this is a bug!)

so, what i suggest is to consider that there are three bugs:

- scribus should only create styles for the styles that are indeed used in the imported text
  0013766: ODT Importer creates extraneous styles
  https://bugs.scribus.net/view.php?id=13766
- scribus should recognize the drop caps (even if it does not support all the feature from libre office)
- scribus should not overwrite styles that already exist in the .sla when importing from .odt.

am i missing something?
Title: Re: Strange style behavior
Post by: PK on January 24, 2024, 07:49:31 PM
indeed, you do it faster :)

I do it on my side and I have similar bugs, and one more!

I set up two styles for paragraphs, para-begin for drop cap and para_normal for indent. Careful, I have added small cap after the drop cap (because it should be like this, for an easy reading)

I add a character style named SMC for theses small caps.

I have the same results like you, plus the loss of the SMS character style. The small caps are presents, but without the associated style (which is well imported).

My final sla has been corrected by hands (for the drop cap), except for the SMS style.
Title: Re: Strange style behavior
Post by: a.l.e on January 24, 2024, 08:09:04 PM
the SMC thing seems to already be reported:

0014795: ODT import filter seems to map character styles into direct formatting
https://bugs.scribus.net/view.php?id=14795
Title: Re: Strange style behavior
Post by: PK on January 24, 2024, 08:19:53 PM
OK, I have confirmed this bug in the bug tracker.