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

Extend FOP config for ja, ko, zh_CN & zh_TW #684

Closed
tomschr opened this issue Oct 7, 2022 · 2 comments
Closed

Extend FOP config for ja, ko, zh_CN & zh_TW #684

tomschr opened this issue Oct 7, 2022 · 2 comments

Comments

@tomschr
Copy link
Collaborator

tomschr commented Oct 7, 2022

Problem description

Our current PDFs contain some layout issues regarding for CJK languages. However, adding a font is not enough. FOP doesn't detect them correctly. We need to register all fonts manually.

Expected behavior

Our PDFs contains the correct fonts for CJK languages

Solution

  • Adapt the DAPS requirement and recommend the following packages:

    • google-noto-sans-jp-regular-fonts / google-noto-sans-jp-bold-fonts: Japanese
    • google-noto-sans-kr-regular-fonts / google-noto-sans-kr-bold-fonts: Korean
    • google-noto-sans-sc-regular-fonts / google-noto-sans-sc-bold-fonts : Simplified Chinese
    • google-noto-sans-tc-regular-fonts / google-noto-sans-tc-bold-fonts: Traditional Chinese
  • Add the following XML fragment to the FOP configuration fop-daps.xml (@fsundermeyer)

    Addition to FOP configuration for DAPS (click me)
       <!-- ja, ko -->
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKjp-Regular.otf" embedding-mode="subset">
        <font-triplet name="NotoSansJP" style="normal" weight="normal"/>
       </font>
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKjp-Bold.otf" embedding-mode="subset">
        <font-triplet name="NotoSansJP" style="normal" weight="700"/>
       </font>
       <!-- ko -->
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKkr-Regular.otf" embedding-mode="subset">
        <font-triplet name="NotoSansKO" style="normal" weight="normal"/>
       </font>
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKkr-Bold.otf" embedding-mode="subset">
        <font-triplet name="NotoSansKO" style="normal" weight="700"/>
       </font>
       <!-- zh-CN -->
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKsc-Regular.otf" embedding-mode="subset">
        <font-triplet name="NotoSansZH_CN" style="normal" weight="normal"/>
       </font>
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKsc-Bold.otf" embedding-mode="subset">
        <font-triplet name="NotoSansZH_CN" style="normal" weight="700"/>
       </font>
       <!-- zh-TW -->
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKtc-Regular.otf" embedding-mode="subset">
        <font-triplet name="NotoSansZH_TW" style="normal" weight="normal"/>
       </font>
       <font kerning="no" embed-url="/usr/share/fonts/truetype/NotoSansCJKtc-Bold.otf" embedding-mode="subset">
        <font-triplet name="NotoSansZH_TW" style="normal" weight="700"/>
       </font>
       </fonts>
  • Insert the defined names (NotoSansJP, NotoSansKO, NotoSansZH_CN, and NotoSansZH_TW) into the stylesheets, file fo/l10n.properties.xml. (@tomschr)

Related information

DOCTEAM-750

@fsundermeyer
Copy link
Member

@tomschr I suggest to add the fonts as recommended packages to the suse-xsl-stylesheets package spec-file rather than to DAPS.

@tomschr
Copy link
Collaborator Author

tomschr commented Nov 3, 2022

I think, for DAPS this issue can be closed. For the SUSE stylesheets parts, this is covered in issue openSUSE/suse-xsl#505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants