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

Missing SVG fonts substitution #248

Open
1 of 2 tasks
Intelligent2013 opened this issue May 22, 2024 · 4 comments
Open
1 of 2 tasks

Missing SVG fonts substitution #248

Intelligent2013 opened this issue May 22, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented May 22, 2024

Source issue: metanorma/metanorma-plateau#2

From full Plateau PDF generation:

WARNING: Font 'YuGothicUI-Regular' (font name 'YuGothicUI-Regular', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font 'YuGothicUI-Regular' (font name 'YuGothicUI-Regular', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font 'YuGothicUI-Regular' (font name 'YuGothicUI-Regular', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font 'YuGothicUI-Regular' (font name 'YuGothicUI-Regular', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font 'YuGothicUI-Bold' (font name 'YuGothicUI-Bold', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font 'MS-PGothic' (font name 'MS-PGothic', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font 'MS-PGothic' (font name 'MS-PGothic', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font 'MS-PGothic' (font name 'MS-PGothic', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font 'MS-PGothic' (font name 'MS-PGothic', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font ''YuGothicUI-Regular'' (font name ''YuGothicUI-Regular'', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font ''YuGothicUI-Regular'' (font name ''YuGothicUI-Regular'', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font ''YuGothicUI-Regular'' (font name ''YuGothicUI-Regular'', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font ''YuGothicUI-Regular'' (font name ''YuGothicUI-Regular'', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font ''YuGothicUI-Bold'' (font name ''YuGothicUI-Bold'', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font ''MS-PGothic'' (font name ''MS-PGothic'', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font ''MS-PGothic'' (font name ''MS-PGothic'', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font ''MS-PGothic'' (font name ''MS-PGothic'', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font ''MS-PGothic'' (font name ''MS-PGothic'', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font ''Calibri'' (font name ''Calibri'', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font ''Calibri'' (font name ''Calibri'', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font ''Calibri'' (font name ''Calibri'', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font ''Calibri'' (font name ''Calibri'', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font ''Calibri-Bold'' (font name ''Calibri-Bold'', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\TestUser\.fontist\fonts\NotoSans-Bold.ttf'.

Font "YuGothicUI-Bold,normal,400" not found. Substituting with "any,normal,400".
Font "Calibri-BoldItalic,normal,400" not found. Substituting with "any,normal,400".
Font "Arial,normal,400" not found. Substituting with "any,normal,400".
Font "Calibri-Italic,normal,400" not found. Substituting with "any,normal,400".
Font "Meiryo-Bold,normal,400" not found. Substituting with "any,normal,400".
Font "Meiryo,normal,400" not found. Substituting with "any,normal,400".
Font "KozGoPr6N-Regular-90ms-RKSJ-H,normal,400" not found. Substituting with "any,normal,400".
Font "Meiryo-BoldItalic,normal,400" not found. Substituting with "any,normal,400".
Font "MeiryoUI,normal,400" not found. Substituting with "any,normal,400".
Font "MeiryoUI-Bold,normal,400" not found. Substituting with "any,normal,400".
Font "MeiryoUI-BoldItalic,normal,400" not found. Substituting with "any,normal,400".

Two issues:

  • fonts in double quotes don't recognize correctly, like ''MS-PGothic''
  • the fonts from the 2nd group don't replaced by NotoSans fonts via mn2pdf, it replaced by FOP default font any,normal,400. Therefore PDF don't PDF/UA compliant.
@Intelligent2013 Intelligent2013 added the bug Something isn't working label May 22, 2024
@Intelligent2013 Intelligent2013 self-assigned this May 22, 2024
@ronaldtse
Copy link
Contributor

I think we need an SVG cleaning process to preprocess the files otherwise it’s too prone to breakage. I’m sure there’s a compliance check somewhere right?

@ronaldtse
Copy link
Contributor

Fonts inside SVG have always been an issue we have to resolve, because it is not possible for us to have all fonts people specify in the SVG files.

@Intelligent2013
Copy link
Contributor Author

Regarding issue:

the fonts from the 2nd group don't replaced by NotoSans fonts

the styles determined in the element style:

<style type="text/css">
	.st0_inject_0 {opacity:0.5019608;fill-rule:evenodd;clip-rule:evenodd;fill:#969696;enable-background:new    ;}
	.st1_inject_0 {fill-rule:evenodd;clip-rule:evenodd;fill:#FFCCFF;}
	.st2_inject_0 {fill:none;stroke:#000000;stroke-width:1.5013124;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
	.st3_inject_0 {font-family:'Calibri';}
	.st4_inject_0 {font-size:9.7585306px;}
	.st5_inject_0 {font-family:'Calibri-Bold';}
	.st6_inject_0 {font-family:'Calibri-Italic';}
	.st7_inject_0 {font-family:'Calibri-BoldItalic';}
	.st8_inject_0 {fill-rule:evenodd;clip-rule:evenodd;fill:#F0F0F0;}
	.st9_inject_0 {fill:none;stroke:#D7D7D7;stroke-width:0.7506562;stroke-linecap:square;stroke-miterlimit:10;}
	.st10_inject_0 {fill-rule:evenodd;clip-rule:evenodd;fill:#CCFFCC;}
	.st11_inject_0 {fill:none;stroke:#000000;stroke-width:0.7506562;stroke-linecap:square;stroke-miterlimit:10;}
	.st12_inject_0 {enable-background:new    ;}
	.st13_inject_0 {fill:#003060;}
	.st14_inject_0 {font-family:'KozGoPr6N-Regular-90ms-RKSJ-H';}
	.st15_inject_0 {fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFCC;}
	.st16_inject_0 {font-family:'Meiryo-Bold';}
	.st17_inject_0 {font-size:12.010499px;}
	.st18_inject_0 {letter-spacing:-2.352941;}
	.st19_inject_0 {fill:none;stroke:#000000;stroke-width:1.5013124;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:10;}
	.st20_inject_0 {fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>

I need to add the parsing.

@Intelligent2013
Copy link
Contributor Author

The font names from <style type="text/css" now recognizes by mn2pdf and replaced by NotoSans:

WARNING: Font 'Calibri-Italic' (font name 'Calibri-Italic', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font 'Calibri-BoldItalic' (font name 'Calibri-BoldItalic', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font 'KozGoPr6N-Regular-90ms-RKSJ-H' (font name 'KozGoPr6N-Regular-90ms-RKSJ-H', font style 'normal', font weight 'normal') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-Regular.ttf'.
WARNING: Font 'KozGoPr6N-Regular-90ms-RKSJ-H' (font name 'KozGoPr6N-Regular-90ms-RKSJ-H', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-Bold.ttf'.
WARNING: Font 'KozGoPr6N-Regular-90ms-RKSJ-H' (font name 'KozGoPr6N-Regular-90ms-RKSJ-H', font style 'italic', font weight 'normal') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-Italic.ttf'.
WARNING: Font 'KozGoPr6N-Regular-90ms-RKSJ-H' (font name 'KozGoPr6N-Regular-90ms-RKSJ-H', font style 'italic', font weight 'bold') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-BoldItalic.ttf'.
WARNING: Font 'Meiryo-Bold' (font name 'Meiryo-Bold', font style 'normal', font weight 'bold') doesn't exist. Replaced by 'C:\Users\IntlUser\.fontist\fonts\NotoSans-Bold.ttf'.

but still there are messages from Apache FOP:

Font "Calibri-Italic,normal,400" not found. Substituting with "any,normal,400".
Font "Calibri-BoldItalic,normal,400" not found. Substituting with "any,normal,400".
Font "Arial,normal,400" not found. Substituting with "any,normal,400".
Font "Meiryo-Bold,normal,400" not found. Substituting with "any,normal,400".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants