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

Fix line break behavior of inline code/literals in PDF #427

Open
ghost opened this issue Feb 9, 2021 · 7 comments
Open

Fix line break behavior of inline code/literals in PDF #427

ghost opened this issue Feb 9, 2021 · 7 comments
Assignees
Labels
cat-bug Malfunction, unexpected behavior format-pdf pdf support prio:low styles-2022 "suse2022-ns" styles topic-l10n Localization issues

Comments

@ghost
Copy link

ghost commented Feb 9, 2021

ptinley made us aware of the things they undertake to fix display of tables in the AY Guide (for 15 SP2), we should try to see what we can do to make this work less necessary, e.g. add zero-width spaces within literals in PDF.

(This is probably a dupe but I guess it bears repeating.)

@ghost ghost added cat-bug Malfunction, unexpected behavior format-pdf pdf support topic-l10n Localization issues styles-2013 "suse2013", "suse2013-ns", "daps2013", "daps2013-ns", "opensuse2013", "opensuse2013-ns" styles labels Feb 9, 2021
@janajaeger janajaeger added styles-2022 "suse2022-ns" styles cat-limbo Issues which should be investigated further labels Jul 20, 2022
@janajaeger
Copy link
Contributor

@jfaltenbacher Can you try to find out what Stefan meant by this? If we can't verify what's behind this report we'd have to close it.

@janajaeger
Copy link
Contributor

Also, as we want to handle PDF generating differently in the future, we might not want to touch legacy PDF stylesheets at all.

@jfaltenbacher
Copy link

jfaltenbacher commented Sep 26, 2022

I will ask Patrick directly, if he can explain.

Will ask Padraig first, if he has some conversation on this

@ptinley-vt
Copy link

Hi all,

  1. There are more complete details on this issue in Issue Avoid content of table cells overflowing into adjacent cells and margins  #325

Stefan was suggesting running a S&R routine on the XML to replace occurrences of "</literal>、<literal>" (notice Chinese comma and no space separation) with "</literal>、&#x200b;<literal>" (adding a zero-width-space character which will fix PDF rendering and at the same time not make presentation of the Chinese HTML worse by using a normal space, which would look wrong in Chinese). This will allow the lines to break automatically where they need to.

So, the following:
<para> 通过以下命令访问控制文件:<literal>autoyast=nfs://..</literal>、<literal>autoyast=ftp://..</literal>、<literal>autoyast=http://..</literal>、<literal>autoyast=https://..</literal>、<literal>autoyast=tftp://..</literal> 或 <literal>autoyast=cifs://..</literal>。需使用 linuxrc 中的引导选项定义网络访问。可以通过 DHCP 执行此操作:<command>netsetup=dhcp autoyast=http://<replaceable>163.122.3.5/autoyast.xml</replaceable></command> </para>
would become:
<para> 通过以下命令访问控制文件:<literal>autoyast=nfs://..</literal>、&#x200b;<literal>autoyast=ftp://..</literal>、&#x200b;<literal>autoyast=http://..</literal>、&#x200b;<literal>autoyast=https://..</literal>、&#x200b;<literal>autoyast=tftp://..</literal> 或 <literal>autoyast=cifs://..</literal>。需使用 linuxrc 中的引导选项定义网络访问。可以通过 DHCP 执行此操作:<command>netsetup=dhcp autoyast=http://<replaceable>163.122.3.5/autoyast.xml</replaceable></command> </para>
See current file, which was manually edited to make this work (line 431):
https://github.com/SUSE/doc-sle/blob/maintenance/SLE15SP4/l10n/sles/zh-cn/xml/ay_auto_installation.xml

  1. Chinese, and Japanese, which do not use spaces to break words, also produce long lines like:

    值:auto.master、ethers、group、hosts、netgrp、networks、passwd、protocols、rpc、services、shadow

I think we will have to rely on DTP QA to catch such occurrences, since these terms are not in <literal> elements.

  1. While Avoid content of table cells overflowing into adjacent cells and margins  #325 gives examples of tables, the title of this bug also mentions Code blocks.

An example of text overflow can also be seen in the AutoYaST book, English, page 160:
https://documentation.suse.com/sles/15-SP4/pdf/book-autoyast_color_en.pdf
This is a different issue. zero-width-spaces are not a solution here.
This particular example was an issue in the source English which then appears in the localised book.
Sometimes, I think with ZH_TW, which uses a percentage resize on the fonts, text in code blocks can get enlarged and the line-breaks need to be redone to make it work in the rendered PDF.

@janajaeger janajaeger removed styles-2013 "suse2013", "suse2013-ns", "daps2013", "daps2013-ns", "opensuse2013", "opensuse2013-ns" styles cat-limbo Issues which should be investigated further labels Nov 28, 2022
@tomschr
Copy link
Collaborator

tomschr commented Nov 28, 2022

It seems, for SLE15SP4 tables are replaced by lists. Lists don't have these problems that Patrick described above.

Need to investigate further.

@jfaltenbacher
Copy link

@ptinley-vt please check with current SLE 15 SP5 loc drop if the issue still occurs

@ptinley-vt
Copy link

@jfaltenbacher, in SLE 15 SP5 I have used the zero-width-space character (​) to improve layout of a number of issues in the SLES AutoYaST Guide and the SLES and SLED Security Guides by breaking lines. These issues were found by QAing the PDFs.
ay_auto_installation.xml
ay_erb_templates.xml
ay_nis_server.xml
ay_partitioning.xml
ay_rules_classes.xml
systemd.xml
x11_fonts.xml
apparmor_profiles.xml
audit_setup.xml
rmt_rmt-cli.xml
user_management.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat-bug Malfunction, unexpected behavior format-pdf pdf support prio:low styles-2022 "suse2022-ns" styles topic-l10n Localization issues
Projects
None yet
Development

No branches or pull requests

4 participants