Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text with offset #58

Closed
steff517 opened this issue Dec 16, 2020 · 6 comments
Closed

Text with offset #58

steff517 opened this issue Dec 16, 2020 · 6 comments

Comments

@steff517
Copy link

In some circumstances the text is not always in the correct position or size. It affects ~20% of the texts in my book.
Note that I added the black boxes later after taking a screenshot.

Original
image

Converted
image

Source
https://pastebin.com/XEM0Qqqi

Conversion log
https://pastebin.com/fHDtG6mz
The screenshot above is page 10.

@steff517
Copy link
Author

I just noticed that the background seems to be differently scaled or aligned, too.

@AnEnglishmanInNorway
Copy link
Collaborator

AnEnglishmanInNorway commented Dec 16, 2020

My compliments on a nice set of test evidence!
What we are really seeing here is the difference between a commercial project and a casually developed program;-) No spec, no formal requirements or tests, each new user functions as a tester, using whatever features he is used to, and when the user is happy then we're done!
My first question was whether the "Function" font which I see in the page source is correctly set up. It seems to me that the look of the font in the pdf is very slightly different to the original. But perhaps that's an illusion caused by the different sizes of the pictures; I see you must have added Function to additionalfonts.txt, because it has been registered ok in the log.
One thing I'm very curious about in your HTML are the margin values for the table tag, namely
margin-top:44px; margin-bottom:30px; margin-left:30px; margin-right:30px;
When I put in a text box with the album editor here, I get 5 px margins
margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;
I think this might be the problem area, because I'm fairly sure that the cewe2pdf code does not look at those. Do you have any idea which setting in the editor causes these to change? On my test I had no decoration (eg edge, shadow) on the text box, and I can't see any in your pictures either.
Update: I see it now, it's the internal distance given in the text adjustment area of the UI. And there is no doubt whatsoever that the value is not being used by cewe2pdf, so this is a clear bug which we should fix.
BTW, I agree about the look of your background in these pictures. But I wonder if you could make that into a separate issue? It is unlikely to be related to the text spacing issue.

@steff517
Copy link
Author

After more research I found out the following:
The relevant setting for the issue is the margin setting right here:
image
In this example, by setting it to 25mm, Cewe automatically inflates the textbox.

IN the source, this has the following effect on IndentMargin and VertialIndentMargin
image
I'm not really sure why those values are different, since I set only one value in Cewe.

THe output looks like this
image

This reveals two things:

  • Cewe2Pdf doesn't corretly process the IndentMargin and VertialIndentMargin because the text still has no margin left and right.
  • There is an issue with text box alignment which offsets the text in this case

Here is my stripped-down book attached for testing.
Testbuch.zip

AnEnglishmanInNorway added a commit to AnEnglishmanInNorway/cewe2pdf that referenced this issue Dec 17, 2020
…ditor (close to the buttons which choose left/right/centre justification) There is still some kind of mismatch in the text output which means that the frame height may not be enough (often because of an unexpected line wrap with respect to what we see in the editor, thus producing an extra line in the pdf). I simply can't find this bug, but I don't think the current version is any worse than the previous version with respect to existing texts. Issue bash0#58
@AnEnglishmanInNorway
Copy link
Collaborator

I've spent a few hours looking at this, and have introduced handling of the margins (padding) defined for the inside of a text box, in pull request #57.
The original code had what can only be described as a frustrated hack to increase the height of a text box (frame) when the text did not fit vertically in the frame. That hack remains in place, I am just as frustrated about why it is necessary. There is something about the text processing in cewe2pdf which means we do not get exactly the same output as the CEWE editor does, in particular our texts seem to be very very slightly wider (in some cases?). That means we can get an extra word wrap in a tightly fitting frame, which can introduce a new line and thereby increase the height.

@AnEnglishmanInNorway
Copy link
Collaborator

@bash0 How about merging in pull request #57 and closing issues 56 and 58? I also wonder if it might be possible to open up for others to help with the administration if you're not particularly active? I'd like to be able to assign issues to myself, at least, so people know I've picked them up.

@bash0 bash0 closed this as completed Dec 18, 2020
@steff517
Copy link
Author

I con confirm that it works now! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants