Git Product home page Git Product logo

Comments (11)

pgundlach avatar pgundlach commented on August 16, 2024 1

Also I would like to confirm an unexpected behavior

...

It would help me organzing stuff if this is opened in a different issue. That said, this is "expected", although not well documented: https://doc.speedata.de/publisher/en/basics/fileorganization/#ch-fileorganization

dupicate entries should give a better warning.

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024 1

A workaround (until I provide a fix) is to say html="off" with Paragraph:

    <Paragraph html="off">

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024 1

This should be fixed in version 4.15.20 (now online). Thank you very much for your bug report and your patience!

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024

Thank you very much!

For me: here is a layout that crashes

<Layout xmlns="urn:speedata.de:2009/publisher/en"
    xmlns:sd="urn:speedata:2009/publisher/functions/en">

    <Record element="data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <Value>&#8203; text</Value>
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

(4.15.19, sp --dummy)

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024

@LdBeth I am not sure that I am able to fix the error without more help from you.

  1. do you use harfbuzz mode when loading the fonts (a global switch in the configuration file or mode="harfbuzz" with <LoadFont...>?
  2. could you provide a small layout file that shows the problem?

I have a fix for a problem I have constructed above, but I am not sure (different error message) that this will also fix your error.

from publisher.

LdBeth avatar LdBeth commented on August 16, 2024

do you use harfbuzz mode when loading the fonts (a global switch in the configuration file or mode="harfbuzz" with <LoadFont...>?

No, it is a different issue from the problem here but It seems harfbuzz mode cannot be use together with font fallback. While in the layout file I used when I discover this issue I relied on font fallback to handle English text mixed with Japanese.

  <LoadFontfile name="Sans" filename="IBMPlexSerif-Regular.ttf">
    <Fallback filename="KleeOne-Regular.ttf" />
  </LoadFontfile>

Actually, the problem cannot be reproduced with harfbuzz mode on.

<Layout
    xmlns="urn:speedata.de:2009/publisher/en"
    xmlns:db='http://docbook.org/ns/docbook'
    xmlns:sd="urn:speedata:2009/publisher/functions/en">
  <Options mainlanguage="en"/>
  <LoadFontfile name="Sans" filename="KleeOne-Regular.ttf"/> <!-- with mode="harfbuzz" the crash won't happen -->
  <DefineFontfamily name="sans" fontsize="9" leading="11">
    <Regular fontface="Sans"/>
  </DefineFontfamily>
  <Hyphenation>Gun-dam</Hyphenation>
  <Hyphenation>as–sas–sin</Hyphenation>
  <DefineTextformat name="title" break-below="no"
                    alignment="leftaligned"/>
  <DefineTextformat name="yr" break-below="no"
                    alignment="rightaligned"/>
  <DefineTextformat name="desc" alignment="leftaligned"
                    indentation="0.2cm"/>
  <Pagetype name="page" test="true()">
    <Margin left="1cm" right="1cm" top="1cm" bottom="1cm"/>
    <AtPageCreation>
      <PlaceObject column="1" row="1">
        <Textblock><Copy-of select="$header"/></Textblock>
      </PlaceObject>
      <PlaceObject column="10" row="1">
        <Textblock>
          <Paragraph>
            <Value>Page: </Value>
            <Value select="sd:current-page()"/>
          </Paragraph>
        </Textblock>
      </PlaceObject>
    </AtPageCreation>
    <PositioningArea name="text">
      <PositioningFrame
          width="9"
          height="{(sd:number-of-rows() div 2) - 2}"
          row="2"
          column="1"/>
      <PositioningFrame
          width="9"
          height="{(sd:number-of-rows() div 2) - 2}"
          row="2"
          column="11"/>
      <PositioningFrame
          width="9"
          height="{(sd:number-of-rows() div 2) - 1}"
          row="{(sd:number-of-rows() div 2) + 2}"
          column="1"/>
      <PositioningFrame
          width="9"
          height="{(sd:number-of-rows() div 2) - 1}"
          row="{(sd:number-of-rows() div 2) + 1}"
          column="11"/>
    </PositioningArea>
  </Pagetype>

  <Record element="document">
    <SetVariable variable="header">
      <Paragraph><Value select="header"/></Paragraph>
    </SetVariable>
    <ProcessNode select="*"/>
  </Record>

  <Record element="entry">
    <Output area="text">
      <Text>
        <Paragraph language="--"
                   fontfamily="sans"
                   textformat="title"><Value select="title"/></Paragraph>
        <Paragraph textformat="yr"><Value>(</Value>
        <Value select="year"/><Value>)</Value></Paragraph>
      </Text>
    </Output>
  </Record>

</Layout>

and

data.xml

<document>
   <entry>
      <title>Chainsaw&#8203; Man</title>
      <year>2022</year>
   </entry>
</document>

Also the font file seems unrelated to the problem so you can replace them with the files available on your system.

from publisher.

LdBeth avatar LdBeth commented on August 16, 2024

Thank you very much!

For me: here is a layout that crashes

<Layout xmlns="urn:speedata.de:2009/publisher/en"
    xmlns:sd="urn:speedata:2009/publisher/functions/en">

    <Record element="data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <Value>&#8203; text</Value>
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

(4.15.19, sp --dummy)

I cannot reproduce the program crash with this example on 4.15.19, however I found the issue to be using sp --dummy and following layout file, the program exits without indication of error, but the output pdf only contains the "text" after ZWSP, the "my a" before are missing.

<Layout xmlns="urn:speedata.de:2009/publisher/en"
    xmlns:sd="urn:speedata:2009/publisher/functions/en">
  <Options mainlanguage="en"/>
  
  <Record element="data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <Value>my a&#8203;text</Value>
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

from publisher.

LdBeth avatar LdBeth commented on August 16, 2024

Also I would like to confirm an unexpected behavior, when the file directory is like

layout.xml
data.xml
foo/data.xml

The file foo/data.xml is loaded instead of data.xml. Which I believe is an edge case not handled in the code.

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024

do you use harfbuzz mode when loading the fonts (a global switch in the configuration file or mode="harfbuzz" with <LoadFont...>?

No, it is a different issue from the problem here but It seems harfbuzz mode cannot be use together with font fallback.

... thank you very much, I can reproduce the problem and I will provide a fix.

from publisher.

pgundlach avatar pgundlach commented on August 16, 2024

Minimal layout:

<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <Record element="data">
    <PlaceObject>
      <Textblock>
        <Paragraph>
          <Value select="title" />
        </Paragraph>
      </Textblock>
    </PlaceObject>
  </Record>
</Layout>

data:

<data>
    <title>a&#8203; b</title>
</data>

from publisher.

LdBeth avatar LdBeth commented on August 16, 2024

Yes, I can confirm the minimal layout reproduces the same problem I have.

from publisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.