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

border-bottom of text format #262

Closed
neolithos opened this issue Aug 17, 2020 · 5 comments
Closed

border-bottom of text format #262

neolithos opened this issue Aug 17, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@neolithos
Copy link

I try to underline a paragraph with the following method:

<DefineTextformat name="h" alignment="leftaligned" border-top="0.5pt" border-bottom="0.5pt" hyphenate="no" />
<Output>
  <Text>
    <Paragraph textformat="h">
      <Value select="title" />
    </Paragraph>
    <Paragraph>

But I do not get any line.

Why is there no margin-bottom, padding-bottom?

@pgundlach
Copy link
Member

Could you post a complete example? Works here with the latest version.

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

   <DefineTextformat name="h" alignment="leftaligned" border-top="0.5pt" border-bottom="0.5pt" hyphenate="no" />
   <Record element="data">
     <Output>
       <Text>
         <Paragraph textformat="h">
           <Value select="sd:dummytext()"></Value>
         </Paragraph>
       </Text>
     </Output>
   </Record>
</Layout>

There is no margin-bottom or padding-bottom because nobody has asked yet.

@neolithos
Copy link
Author

neolithos commented Aug 18, 2020

Version: 3.9.31

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

	<Trace grid="no" />

	<DefineTextformat name="h1" alignment="leftaligned" border-top="0.5pt" border-bottom="0.5pt" margin-bottom="6pt" hyphenate="no" />
	<DefineTextformat name="center" alignment="centered" hyphenate="no" border-top="0.5pt" border-bottom="0.5pt" />

	<Pageformat width="210mm" height="297mm" />
	<SetGrid width="10mm" height="10mm" />

	<Pagetype name="page" test="true()">
		<PositioningArea name="head">
			<PositioningFrame width="17" height="0.5" row="1.5" column="2" />
		</PositioningArea>

		<PositioningArea name="body">
			<PositioningFrame width="17" height="27" row="2" column="2" />
		</PositioningArea>

		<PositioningArea name="footer">
			<PositioningFrame width="17" height="1" row="28" column="2" />
		</PositioningArea>
	</Pagetype>

	<Record element="data">
		<!-- todo in AtPageCreation verschieben -->
		<PlaceObject area="footer" keepposition="yes" column="1">
			<Textblock textformat="center">
				<Paragraph>
					<Value select="document/title" />
				</Paragraph>
			</Textblock>
		</PlaceObject>

		<ProcessNode select="body" />
	</Record>

	<Record element="body">
		<Output area="body">
			<Text>
				<Paragraph textformat="h1">
					<Value>Test</Value>
				</Paragraph>
				<Paragraph>
					<Value select="." />
				</Paragraph>
			</Text>
		</Output>
	</Record>
</Layout>
<data>
	<document>
		<title>Änderungen</title>
	</document>
	<body>Inhalt</body>
</data>

publisher.pdf

With margin-bottom and padding-bottom want to insert a space after an paragraph.

@pgundlach
Copy link
Member

pgundlach commented Aug 18, 2020

Slightly shorter

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

	<DefineTextformat name="h1" border-bottom="0.5pt" margin-bottom="1pt"/>

	<Record element="data">
		<Output>
			<Text>
				<Paragraph textformat="h1">
					<Value>text</Value>
				</Paragraph>
			</Text>
		</Output>
	</Record>
</Layout>

The flexible rule width is not taken into account. Why?

└─VLIST 
  ╚═head:
    ├─WHATSIT subtype: pdf_literal, mode: 1, data: data
    ├─VLIST 
    └─VLIST 
      ╚═head:
        ├─GLUE width: 28.35pt
        └─HLIST width: 566.94pt, height: 13.5pt
          ╚═head:
            ├─GLUE width: 28.35pt
            └─VLIST width: 538.59pt, height: 13.5pt, attr: 98=27 
              ╚═head:
                ├─HLIST subtype: line, width: 538.59pt, depth: 3pt, height: 9pt, attr: 405=0 
                │ ╚═head:
                │   ├─RULE depth: 3pt, height: 9pt
                │   ├─GLYPH char: 't', width: 2.78pt, height: 6.68pt, depth: 0.07pt, attr: 1=1 
                │   ├─KERN kern: -0.15pt, attr: 1=1 
                │   ├─GLYPH char: 'e', width: 5.56pt, height: 5.39pt, depth: 0.15pt, attr: 1=1 
                │   ├─KERN kern: -0.25pt, attr: 1=1 
                │   ├─GLYPH char: 'x', width: 5pt, height: 5.24pt, attr: 1=1 
                │   ├─GLYPH char: 't', width: 2.78pt, height: 6.68pt, depth: 0.07pt, attr: 1=1 
                │   ├─PENALTY penalty: 10000, attr: 98=20 
                │   ├─GLUE subtype: parfillskip, stretch: +1fil
                │   └─GLUE subtype: rightskip
                └─VLIST height: 1.5pt, attr: 98=27 405=0 
                  ╚═head:
                    ├─RULE width: -16323pt, height: 0.5pt, attr: 400=6 405=-2147483647 
                    └─GLUE width: 1pt, attr: 402=1 405=0 

This is slightly more complicated than I thought. Disabling the margin-bottom makes the rule to re-appear.

Thank you for the report, I don't have an estimated time of fix though.

@neolithos
Copy link
Author

neolithos commented Aug 18, 2020

Do not rush, I am just playing a little bit with speedata.

How do you get this tree?

@pgundlach
Copy link
Member

@neolithos The tree is rendered with https://ctan.org/pkg/nodetree

@pgundlach pgundlach self-assigned this Aug 20, 2020
@pgundlach pgundlach added the Bug label Aug 20, 2020
@pgundlach pgundlach added this to the Version 4.2 milestone Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants