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

【rst2pdf do not support chinese fonts such as simsun】 #1075

Open
zjingwang opened this issue Aug 17, 2022 · 4 comments
Open

【rst2pdf do not support chinese fonts such as simsun】 #1075

zjingwang opened this issue Aug 17, 2022 · 4 comments

Comments

@zjingwang
Copy link

hi, everyone,
when i tried to use a customed stylesheet for chinese,i set embeddedFonts as simsun.ttc, and run the comman make pdf,i got this problem:

[WARNING] languages.py:41 Language 'zh' not supported by Docutils, using 'en' instead.
resolving references...
done
writing Zchain... 
[WARNING] languages.py:41 Language 'zh' not supported by Docutils, using 'en' instead.
[CRITICAL] styles.py:302 Error processing font simsun: __init__() missing 1 required positional argument: 'pfbFileName'
make: *** [Makefile:26:pdf] 错误 1

this is my conf.py in my project:

# -- Options for PDF output --------------------------------------------------

# Grouping the document tree into PDF files. List of tuples
# (source start file, target name, title, author, options).
#
# If there is more than one author, separate them with \\.
# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor'
#
# The options element is a dictionary that lets you override
# this config per-document. For example:
#
# ('index', 'MyProject', 'My Project', 'Author Name', {'pdf_compressed': True})
#
# would mean that specific document would be compressed
# regardless of the global 'pdf_compressed' setting.

pdf_documents = [
    ('show', 'Zchain', 'Zchain', 'zchain team'),
]

# A comma-separated list of custom stylesheets. Example:
pdf_stylesheets = ['a4','zh_CN']
pdf_style_path = ['.', '_styles']
pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/']
pdf_language = "zh_CN"
pdf_toc_depth = 9999
pdf_use_numbered_links = False
pdf_fit_background_mode = 'scale'
pdf_repeat_table_rows = True

and this is my rst2pdf stylesheet:

{
  "embeddedFonts": [
    "simsun.ttc",
    "simsun.ttc",
    "simsun.ttc",
    "simsun.ttc"
  ],
  "fontsAlias": {
    "stdFont": "simsun",
    "stdBold": "simsun",
    "stdItalic": "simsun",
    "stdBoldItalic": "simsun",
    "stdMono": "simsun",
    "stdMonoBold": "simsun",
    "stdMonoItalic": "simsun",
    "stdMonoBoldItalic": "simsun",
    "stdSans": "simsun",
    "stdSansBold": "simsun",
    "stdSansItalic": "simsun",
    "stdSansBoldItalic": "simsun"
  },
  "styles": [
    [
      "base",
      {
        "wordWrap": "CJK"
      }
    ],
    [
      "literal",
      {
        "wordWrap": "None"
      }
    ]
  ]
}

and this is my rst2pdf and python version:

python==3.6
rst2pdf==0.99

and i am using rst2pdf in centos

please help me with this problem , thank u all !!!

@lornajane
Copy link
Contributor

Hi! I'm sorry, this tool doesn't support non-latin fonts very well at all and we're not planning to add support since we're really just maintaining it. Patches are welcome but we would probably also need help testing the changes.

@zjingwang
Copy link
Author

Got it, thanks for your time.

@muellert
Copy link

I'm running into the same problem with Cyrillic.

@miaomiao1992
Copy link

so, any new progress?

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

4 participants