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

Unwanted horizontal spacing in the diplomatic transcriptions #22

Open
gerritbruening opened this issue Nov 18, 2015 · 11 comments
Open

Unwanted horizontal spacing in the diplomatic transcriptions #22

gerritbruening opened this issue Nov 18, 2015 · 11 comments

Comments

@gerritbruening
Copy link
Contributor

gerritbruening commented Nov 18, 2015

DUPLICATE of faustedition/faust-gen#13

See
http://beta.faustedition.net/documentViewer.php?faustUri=faust://xml/document/faust/2.3/gsa_391347.xml&page=5&view=document
in comparison to
https://faustedition.uni-wuerzburg.de/new/document/faust/2.3/gsa_391347.xml#/5
In particular:

  • freu t (anchor)
  • Clytemnest en (anchor)
  • Auserwählte n (anchor)
@gerritbruening gerritbruening changed the title Unwanted spacing in the diplomatic transcriptions Unwanted spacing in the transcriptions (beta only, not in "new") Nov 19, 2015
@thvitt
Copy link
Member

thvitt commented Nov 23, 2015

It looks like the boxes (for, e.g., Clytemnest) is too large in the SVGs. I have not seen any CSS induced spacing for the affected boxes, so it seems to be a problem in the pre-rendered SVGs?

@thvitt
Copy link
Member

thvitt commented Mar 28, 2016

Those cases that I could identify were consequences of invalid web font definitions in the generation pages, leading to different fonts (with different metrics) being used for calculating the boxes in the SVGs and actually rendering the text snippets in the users' browsers.

I believe to have fixed this in dev, if I have missed something, please reopen and link & describe cases that are still wrong in dev.

@thvitt thvitt closed this as completed Mar 28, 2016
@thvitt thvitt changed the title Unwanted spacing in the transcriptions (beta only, not in "new") Unwanted horizontal spacing in the diplomatic transcriptions (beta only, not in "new") Mar 28, 2016
@thvitt thvitt changed the title Unwanted horizontal spacing in the diplomatic transcriptions (beta only, not in "new") Unwanted horizontal spacing in the diplomatic transcriptions Mar 28, 2016
@gerritbruening
Copy link
Contributor Author

@thvitt
Copy link
Member

thvitt commented Mar 29, 2016

Current version of the rendering uses the same CSS for both rendering (cf. the 🐛 icon in the document viewer) and display, and there are still spacing issues.

Current hypothesis is that the SVG content is scaled somewhere in the rendered page, this would also explain the unwanted vertical space.

@thvitt
Copy link
Member

thvitt commented Mar 29, 2016

Here is an example excerpt from 2 H S. 224.

(1) SVG as generated using PhantomJS:

<g class="text-wrapper" transform="matrix(1 0 0 1 0 0)">
  <rect class="bgBox hand-st material-t normal" height="23" width="336" x="0" y="-18"/>
  <text class="text hand-st material-t normal">Du kriegerzeugte, ſchlachterzogne, junge Brut</text>
</g>

(2) Debug HTML as generated using PhantomJS:

<g class="text-wrapper" transform="matrix(1 0 0 1 0 0)">
  <rect class="bgBox hand-st material-t normal" height="23" width="336" x="0" y="-18"></rect>
  <text class="text hand-st material-t normal">Du kriegerzeugte, ſchlachterzogne, junge Brut</text>
</g>

(3) The SVG from 1 copied into the documentViewer:

<g class="text-wrapper" transform="matrix(1 0 0 1 0 0)">
  <rect class="bgBox hand-st material-t normal" height="23" width="336" x="0" y="-18"></rect>
  <text class="text hand-st material-t normal" style="pointer-events: none;">Du kriegerzeugte, ſchlachterzogne, junge Brut</text>
</g>

(4) The excerpt as rendered in Firefox from debug.html:

<g class="text-wrapper" transform="matrix(1, 0, 0, 1, 0, 0)">
  <rect class="bgBox hand-st material-t normal" height="16.433332443237305" width="307.70001220703125" x="0" y="-13.600000381469727"></rect>
  <text class="text hand-st material-t normal">Du kriegerzeugte, ſchlachterzogne, junge Brut</text>
</g>

The XML samples have all been copied from the respective files (1+2) or from Firefox' debug window (3+4), and the XML has been canonicalized and indented in order to be comparable.

As can be seen, the stuff rendered by PhantomJS is never modified; it is just rendered with different, more appropriate coordinates in Firefox.

This may be the DPI issue 2.x versions of PhantomJS face (that are announced to be solved in 2.2), or it may be a general problem. Maybe try SlimerJS to confirm; and decide whether we can just wait for a fixed PhantomJS or switch to SlimerJS or whether we need to calibrate the generated SVGs to the users' browsers.

@thvitt
Copy link
Member

thvitt commented Nov 2, 2016

The problem still exists with SlimerJS (faustedition/faust-gen#13) 😠 so it's probably an inclusion thing, not a rendering issue. Cf., e.g., Clytemneſten here and compare with the version rendered in the current browser.

@thvitt
Copy link
Member

thvitt commented Nov 2, 2016

It is not an inclusion thing:

  • The dimensions of the pre-generated files are slightly larger than those of the version rendered in-browser, both for the whole svg (417×631.55 vs. 379.5666…×585.083…) and for the text box 'Und als…Clytemneſt' (Width: 230 pre-rendered vs. 205.13333 rendered in-browser)
  • The dimensions in the PDF and PNG screenshots that are taken during rendering are also wrong
  • The font sizes are correct in all cases

So the basic problem is that the rendering process renders correctly when run from an interactive browser, but wrong when run from SlimerJS or PhantomJS. But why‽

@wissenbach
Copy link
Member

wissenbach commented Nov 23, 2016

On my system with OS X 10.10.5 with PhantomJS 1.9.1, it renders correctly. The above example gives this, which has no visible gap when viewed in the browser

<g xmlns="http://www.w3.org/2000/svg" class="text-wrapper" transform="matrix(1 0 0 1 0 0)">
  <rect class="bgBox hand-st material-t normal" x="0" y="-14" height="17" width="313"/>
  <text class="text hand-st material-t normal">Du kriegerzeugte, ſchlachterzogne, junge Brut</text>
</g>

I'll see if I can test it with SlimerJS on OS X.

@wissenbach
Copy link
Member

In SlimerJS (with Firefox 38) on OS X the problem persists. Even when I view it with the same Firefox installation that is used by SlimerJS for rendering.

@wissenbach
Copy link
Member

I think this issue belongs to faust-gen. Moving issues in github does not seem to be trivial, however.

@thvitt
Copy link
Member

thvitt commented Jun 14, 2017

Re PhantomJS 1.9.x: Problem was that it doesn't support webfonts, at least on linux. I'm re-testing it, but at least the PDFs contain just plain vanilla default sans-serif fonts instead.

There is a PhantomJS 2.5.0-beta, I'll test that as well, maybe our problems magically go away …

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

No branches or pull requests

3 participants