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

PDF: Add new vertical layout #226

Open
15 of 24 tasks
Intelligent2013 opened this issue Oct 18, 2024 · 26 comments
Open
15 of 24 tasks

PDF: Add new vertical layout #226

Intelligent2013 opened this issue Oct 18, 2024 · 26 comments
Assignees
Labels
enhancement New feature or request

Comments

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Oct 18, 2024

In continue of metanorma/mn-native-pdf#713.

As titled, based on the new JIS layout JIS_Template_traditional_blue_v2_traditional.pdf.

To do (draft list):

  • add new parameters :presentation-metadata-color-cover-page-background-1:, :presentation-metadata-color-cover-page-background-2: for vertical stripes (with opacity) on the cover page no need, it's part of user-provided cover page
  • add new parameters :presentation-metadata-color-cover-page-background-opacity-1:, :presentation-metadata-color-cover-page-background-opacity-2: vertical stripes opacities no need, it's part of user-provided cover page
  • integrate two new logos JIS and JSA into SVG. no need, it's part of user-provided cover page
  • add new parameter :presentation-metadata-color-header-footer-background: (blue bar in the reference PDF)
  • use font Noto Sans JP Thin, Noto Serif JP ExtraLight and Source Sans Noto Serif JP Medium in the XSLT, and add into processor.rb metanorma-jis (Jis new layout fonts #230)
  • use Japanese numerals in
  • add parameter :coverpage-image: (see https://www.metanorma.org/author/bsi/ref/document-attributes/) - image location, for image to be included on the PDF cover page. Image location is relative to the source document.
  • add parameter :backpage-image: - same, for image to be included on the PDF back page. (Add document attributes for cover and back page image #227)
  • put cover page image into the back cover page, if back cover page doesn't set
  • add last section (see page 4 in the reference PDF)
  • don't rotate letters in web links (http;// https:// www.), no need special actions, the English text doesn't rotate by default
  • some English text should not be rotated, markup with something like this span:dontrotate[text]

Known issues:

@Intelligent2013 Intelligent2013 added the enhancement New feature or request label Oct 18, 2024
@Intelligent2013 Intelligent2013 self-assigned this Oct 18, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Oct 18, 2024
@ronaldtse
Copy link

Here's an updated file for reference:

use font NotoSansJP-Thin, NotoSerifJP-ExtraLight and Source Sans in the XSLT

I've used "Noto Serif JP" "Medium" to replace the Italic text, so we don't need Source Sans.

put cover page image into the back cover page

It's a mirrored front-back image of the front cover page. If possible allow using a separate front/back cover page.

Thanks!

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 19, 2024
@Intelligent2013
Copy link
Contributor Author

add new parameters :presentation-metadata-color-cover-page-background-1:, :presentation-metadata-color-cover-page-background-2: for vertical stripes (with opacity) on the cover page

The parameter :presentation-metadata-color-cover-page-background-1: for
image

The parameter :presentation-metadata-color-cover-page-background-2: for
image

Also we need two parameters for opacities:

  • :presentation-metadata-color-cover-page-background-opacity-1: 0.58
  • :presentation-metadata-color-cover-page-background-opacity-2: 0.75

@Intelligent2013 Intelligent2013 moved this from 🆕 New to 🏗 In progress in Metanorma Oct 19, 2024
Intelligent2013 added a commit that referenced this issue Oct 20, 2024
Intelligent2013 added a commit that referenced this issue Oct 20, 2024
@Intelligent2013
Copy link
Contributor Author

Intelligent2013 commented Oct 20, 2024

The footer contains the last on page clause title. First depth clause:

image

@Intelligent2013
Copy link
Contributor Author

@ronaldtse there are question about numbers in header/footer:

  • the number in header means :edition:?
  • the number in footer means the page number? Just mistakenly all page number are 2?
  • both numbers in header/footer ToC page should be in parenthesis?

Examples:

  • ToC page

    • header - number 1 in parenthesis
      image
    • footer - number 2 in parenthesis
      image
  • first document page

    • header - number 1
      image
    • footer - number 2
      image
  • last document page - same

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 20, 2024
@Intelligent2013
Copy link
Contributor Author

@ronaldtse could you check the fonts which are used on the cover page in the source Adobe Illustrator file.
Adobe Acrobat shows Noto Serif Extra Light for all texts:
image

but the rendered fonts looks so:
image

I've tried to use Noto Serif JP Medium, but it looks different than in the source PDF(generated from AI):
image

Also, Adobe Acrobat in the document properties shows 7 fonts Noto Serif Extra Light:
image

Thanks.

@ronaldtse
Copy link

@Intelligent2013 I think this is because I’m using Noto Sans JP “Variable” that can realize all weights. It’s not Extra Light.

@Intelligent2013
Copy link
Contributor Author

Actually the fonts Noto Serif JP Medium, Noto Serif JP Bold and Noto Serif Black are using on the cover page text.

@Intelligent2013
Copy link
Contributor Author

Issue java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 occurs due the attribute role="artifact" in

<fo:static-content flow-name="left-region" role="artifact">
...
<fo:retrieve-marker retrieve-class-name="section_title"

fo:retrieve-marker and role="artifact" in one element occurs this error. Looks like it's a bug in Apache FOP. I'll add the ticket on Apache tracker.

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 27, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 27, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 27, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Oct 27, 2024
@ronaldtse
Copy link

ronaldtse commented Nov 5, 2024

This is the latest example from @Intelligent2013
20241106 vertical jis example.pdf

Metanorma issues:

  • clause numbers in Japanese
  • Japanese numbering of autonumbering items
  • distinction encoding syntax for horizontal vs horizontal in vertical
  • subfigures now in Japanese but mislabeled

What is to be done in FOP:

  • clause numbers rotation
  • punctuation rotation (see docs/110)
  • table cell text rotation
  • rotation of text in examples
  • image/figure/formula rotation
  • vertical line overflow for English

@Intelligent2013
Copy link
Contributor Author

Metanorma issues:

  • clause numbers in Japanese

@opoudjis does the current version of metanorma-jis support the clause numbers in Japanese?

@opoudjis
Copy link
Contributor

Yes, with :presentation-metadata-autonumbering-style: japanese

metanorma/metanorma.org@b905b87

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 10, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 10, 2024
@Intelligent2013
Copy link
Contributor Author

@opoudjis thanks!

@Intelligent2013
Copy link
Contributor Author

This is the latest PDF with clause numbers in Japanese: 20241110.vertical.jis.example.pdf

Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 11, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 11, 2024
@Intelligent2013
Copy link
Contributor Author

  • rotation of text in examples
  • vertical line overflow for English

Fixed.

  • image/figure rotation

I've added the rotation for the image, but now the image breaks the page:

image

I'll try to find the workaround solution.

The latest PDF: 20241111.vertical.jis.example.pdf

@Intelligent2013
Copy link
Contributor Author

For the image rotation need:

  • add reference-orientation="90" for the block-container
  • add attributes width/height in mm for the block-container

Note: fox:transform="rotate(90)" (https://xmlgraphics.apache.org/fop/2.10/extensions.html#transform) is working for fo:block-container with position="absolute" only.

Intelligent2013 added a commit to metanorma/mn2pdf that referenced this issue Nov 13, 2024
Intelligent2013 added a commit to metanorma/mn2pdf that referenced this issue Nov 13, 2024
Intelligent2013 added a commit to metanorma/mn2pdf that referenced this issue Nov 13, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 13, 2024
Intelligent2013 added a commit to metanorma/mn-native-pdf that referenced this issue Nov 13, 2024
@Intelligent2013
Copy link
Contributor Author

  • image/figure rotation

the image breaks the page:

The issue with page breaks fixed, but there are two issues with:

  • sub-figures
    image
  • big height images
    image

I'll need to fix it.

Latest PDF: 20241113.vertical.jis.example.pdf

@Intelligent2013
Copy link
Contributor Author

Image scaling issue in the vertical layout fixed.

Next issue - each reference sub-section starts in a new page:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🏗 In progress
Development

No branches or pull requests

3 participants