Open Intelligent2013 opened 1 month ago
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!
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
The parameter :presentation-metadata-color-cover-page-background-2:
for
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
The footer contains the last on page clause title. First depth clause:
@ronaldtse there are question about numbers in header/footer:
:edition:
?2
?Examples:
ToC page
1
in parenthesis
2
in parenthesis
first document page
1
2
last document page - same
@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:
but the rendered fonts looks so:
I've tried to use Noto Serif JP Medium
, but it looks different than in the source PDF(generated from AI):
Also, Adobe Acrobat in the document properties shows 7 fonts Noto Serif Extra Light
:
Thanks.
@Intelligent2013 I think this is because I’m using Noto Sans JP “Variable” that can realize all weights. It’s not Extra Light.
Actually the fonts Noto Serif JP Medium
, Noto Serif JP Bold
and Noto Serif Black
are using on the cover page text.
Bad things found. Update in https://github.com/chunlinyao/fop has very limited vertical layout support! It doesn't support glyph rotation in the blocks inside fo:block-container
and fo:table
.
From right to left: block
, block-container
, table
.
The glyphs didn't rotated in 2 and 3 blue boxes.
XSL-FO:
<fo:block border="1pt solid blue" language="JA">
「天の人を生ずるは億兆皆同一轍にて、之に附与するに動かす可からざるの通義を以てす。即ち其通義とは人の自から生命を保し自由を求め幸福を祈るの類にて、他より之を如何ともす可らざるものなり。」
――『アメリカ独立宣言』
</fo:block>
<fo:block-container>
<fo:block border="1pt solid blue" language="JA">
「天の人を生ずるは億兆皆同一轍にて、之に附与するに動かす可からざるの通義を以てす。即ち其通義とは人の自から生命を保し自由を求め幸福を祈るの類にて、他より之を如何ともす可らざるものなり。」
――『アメリカ独立宣言』
</fo:block>
</fo:block-container>
<fo:table width="100%" table-layout="fixed">
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block border="1pt solid blue" language="JA">
「天の人を生ずるは億兆皆同一轍にて、之に附与するに動かす可からざるの通義を以てす。即ち其通義とは人の自から生命を保し自由を求め幸福を祈るの類にて、他より之を如何ともす可らざるものなり。」
――『アメリカ独立宣言』
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Another issue in the vertical layout - the glyphs don't rotate in ToC (XSL-FO element fo:page-number-citation
):
and in the footer (XSL-FO element fo:page-number
):
@ronaldtse question about last page (not back page).
Is this a fixed text or it should be read from XML? It's user defined section or hard-coded boilerplate in metanorma gem?
The error occurs on the full document:
Rendered page fontist/fontist#1.
Rendered page fontist/fontist#2.
Index: 2, Size: 2
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:659)
at java.util.ArrayList.get(ArrayList.java:435)
at org.apache.fop.render.intermediate.IFStructureTreeBuilder.replayEventsForPageSequence(IFStructureTreeBuilder.java:192)
at org.apache.fop.render.intermediate.IFSerializer.startPageSequence(IFSerializer.java:278)
at org.apache.fop.render.intermediate.IFRenderer.startPageSequence(IFRenderer.java:526)
at org.apache.fop.area.RenderPagesModel.checkPreparedPages(RenderPagesModel.java:172)
at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:146)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:316)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:243)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:147)
at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267)
at org.apache.fop.fo.DelegatingFOEventHandler.endPageSequence(DelegatingFOEventHandler.java:114)
at org.apache.fop.accessibility.fo.FO2StructureTreeConverter.endPageSequence(FO2StructureTreeConverter.java:184)
at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:140)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:390)
at org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:207)
at org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:204)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:203)
at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1149)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1784)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2969)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:113)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:867)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:796)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:142)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:519)
at org.metanorma.fop.PDFGenerator.generateFOPIntermediateFormat(PDFGenerator.java:860)
at org.metanorma.fop.PDFGenerator.runFOP(PDFGenerator.java:564)
at org.metanorma.fop.PDFGenerator.convertmn2pdf(PDFGenerator.java:512)
at org.metanorma.fop.PDFGenerator.process(PDFGenerator.java:326)
at org.metanorma.fop.mn2pdf.main(mn2pdf.java:350)
The error occurs due the block with mathml:
<UnitsML xmlns="https://schema.unitsml.org/unitsml/1.0">
<UnitSet>
...
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi mathvariant="normal">µF</mi>
</math>
mn2pdf
can't process it, because the element math
isn't in the text. I'll omit it in the preprocess phase.
No, without Unitsml there is the error...
The issue in fop-core\src\main\java\org\apache\fop\render\intermediate\IFStructureTreeBuilder.java
public void replayEventsForPageSequence(ContentHandler handler,
int pageSequenceIndex) throws SAXException {
pageSequenceEventRecorders.get(pageSequenceIndex).replay(handler);
}
The value pageSequenceIndex
is great than pageSequenceEventRecorders
size.
I've applied very rough workaround solution:
try {
pageSequenceEventRecorders.get(pageSequenceIndex).replay(handler);
} catch (IndexOutOfBoundsException ex) {
System.out.println("Error on pageSequenceIndex=" + pageSequenceIndex);
pageSequenceEventRecorders.get(pageSequenceEventRecorders.size() - 1).replay(handler);
}
and PDF generated.
@ronaldtse here is first PDF for JIZ Z 8301: document_vertical.presentation.zip
The PDF doesn't contain the clause numbers in Japanese, because still I'm not able to generate XML on my machine.
Known issues:
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
UPDATE 2024-10-27: fixedVertical layout introduced in https://github.com/chunlinyao/fop is non-production feature, and time consuming to finding workaround solution.
Removing support for Noto Fonts in JIS until Fontist is made to support them: https://github.com/fontist/formulas/issues/206
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.
This is the latest example from @Intelligent2013 20241106 vertical jis example.pdf
Metanorma issues:
What is to be done in FOP:
Metanorma issues:
- clause numbers in Japanese
@opoudjis does the current version of metanorma-jis
support the clause numbers in Japanese?
Yes, with :presentation-metadata-autonumbering-style: japanese
https://github.com/metanorma/metanorma.org/pull/832/commits/b905b8722205b74d5335444806dcd06e6ce1152d
@opoudjis thanks!
This is the latest PDF with clause numbers in Japanese: 20241110.vertical.jis.example.pdf
- 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:
I'll try to find the workaround solution.
The latest PDF: 20241111.vertical.jis.example.pdf
For the image rotation need:
reference-orientation="90"
for the block-containerNote: fox:transform="rotate(90)"
(https://xmlgraphics.apache.org/fop/2.10/extensions.html#transform) is working for fo:block-container
with position="absolute"
only.
image/figure rotation
the image breaks the page:
The issue with page breaks fixed, but there are two issues with:
I'll need to fix it.
Latest PDF: 20241113.vertical.jis.example.pdf
Image scaling issue in the vertical layout fixed.
Next issue - each reference sub-section starts in a new page:
Next issue - each reference sub-section starts in a new page:
Fixed.
Latest PDF: 20241120.vertical.jis.example.pdf
Next issues:
a)
b)
etc.)
In continue of https://github.com/metanorma/mn-native-pdf/issues/713.
As titled, based on the new JIS layout JIS_Template_traditional_blue_v2_traditional.pdf.
To do (draft list):
: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: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 pageJIS
andJSA
into SVG.~ no need, it's part of user-provided cover page:presentation-metadata-color-header-footer-background:
(blue bar in the reference PDF)Noto Sans JP Thin
,Noto Serif JP ExtraLight
and ~Source Sans
~Noto Serif JP Medium
in the XSLT, and add intoprocessor.rb
metanorma-jis
(https://github.com/metanorma/metanorma-jis/pull/230):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.metanorma-jis
(https://github.com/metanorma/metanorma-jis/issues/227):backpage-image:
- same, for image to be included on the PDF back page. (https://github.com/metanorma/metanorma-jis/issues/227)metanorma-jis
(https://github.com/metanorma/metanorma-jis/issues/227)http;//
https://
www.
), no need special actions, the English text doesn't rotate by defaultspan:dontrotate[text]
Known issues: