dita-ot / dita-ot

DITA Open Toolkit — the open-source publishing engine for content authored in the Darwin Information Typing Architecture.
https://www.dita-ot.org
Apache License 2.0
404 stars 196 forks source link

PDF Chinese title looks like ##### #4285

Open LiuAoran opened 1 year ago

LiuAoran commented 1 year ago

Expected Behavior

I need to create a Chinese document using Markdown and DITA, and style it according to the \dita-ot-4.1.1\docsrc\samples\themes\dita-ot-docs_A4.yaml.

Actual Behavior

All Chinese titles are displayed as "####" regardless of their level, whether they are first-level or second-level titles.

Possible Solution

I have tried not using a theme, and the Chinese titles display correctly. Therefore, I suspect there might be an issue with the Chinese styles within the theme.

Steps to Reproduce

  1. I created two DITA Markdown files and authored a map.
  2. I used the command dita -i .\git_map.dita -f pdf --theme dita-ot-docs-A4.yaml to convert the documents to PDF.

Copy of the error message, log file, or stack trace

none

Environment

Environment:jdk17

jelovirt commented 1 year ago

What happens if you explicitly set font-family for headers? Add the following to dita-ot-docs_A4.yaml

style:
  h1:
    font-family: $pdf2-font-sans
  h2:
    font-family: $pdf2-font-sans
  h3:
    font-family: $pdf2-font-sans
LiuAoran commented 1 year ago

What happens if you explicitly set font-family for headers? Add the following to dita-ot-docs_A4.yaml

style:
  h1:
    font-family: $pdf2-font-sans
  h2:
    font-family: $pdf2-font-sans
  h3:
    font-family: $pdf2-font-sans

Thank you for your reply. this is PDF image This is markdown source image

h1 looks fine, but h2 and italic text not well

jelovirt commented 1 year ago

Can you attach the Markdown source, not as an image, but as a file?

LiuAoran commented 1 year ago

Sorry.

I create two LwMarkdown: file1.md

# 中文标题 title1 

中文标题描述1 

_中文标题描述1 斜体_

description 1

## 中文内容1

中文内容描述1

description 1

file2.md

# 中文标题2

中文标题描述2

## 中文内容2

中文内容描述2

test_map.ditamap

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "test_map.dtd">
<map>
    <title>test</title>
    <topicref href="file1.md" format="mdita"/>
    <topicref href="file2.md" format="mdita"/>
</map>

my command: dita -i .\test_map.ditamap -f pdf --theme dita-ot-docs_A4.yaml

flyjay123 commented 12 months ago

I‘ve met the same problem, did you solve it?

LiuAoran commented 12 months ago

Can you attach the Markdown source, not as an image, but as a file?

hello, Are you still following up on this issue?

LiuAoran commented 12 months ago

I solved it by install and set a Chinese-supported font.