Unexpected change of font inside <pre>
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 54
- Joined: Mon Jun 27, 2011 10:51 pm
Unexpected change of font inside <pre>
Trying to display a ssh public key. This is my source:
Works as expected when converted to HTML. This is the HTML source:
But when the HTML is processed through Chemistry it results in an unexpected and unwanted font change. See the png attachment. The text "ssh-rsa" looks like helvetica or arial and isn't aligned with the other text.
Code: Select all
<codeblock outputclass="nobreak"><ph conref="variables.dita#variables/llPrompt"/> <userinput>cat ~/.ssh/authorized_keys</userinput>
ssh‑rsa AAAADAQABAAABAQDn2hZvQiXAAAAB3NzaC1yc2EDWNQ9AOF6JvcoMbDGUrh0C6WWTdDvQZA0vTwAbeIdjkAlcoRN1BU9BLQo19W8eXsl9PRB4bN2Mu1P0XIWCIjiAVxOSJsP8rhMVoQkGES2vA+uqyqqPincLDfF0u6DetIyW+1nC6uEwtS6Bc9s6FnALBVjcjil6yZveGzuLqAvj9C4zl3ZoA24DUkkH25lzK3NNKJDUSgrhnkm9ouirjsCmfGPLwnS7p9VzYVkFmwnnygJLGEZf3mXgwSYMH1BcuHdbhFVKkzZicrmR2vSkSimTp50riZ3xDX91qpQskV9I4aFS9DtcsumjvDYA87Xend3vf system@example.com
ssh‑rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNrBpwY54v4XDePpQlDOBNpQpyBuJnPY3ThAE3YPAtqlboKeiUNDDgHbYLVVdXV8CFpvShaJ1oFZj5CNjp4krD9Bx2aK3QpoRX3e3ZWSv2JxlbBs61J4fTiKnyDyeGcqx3Q2JjgRTww5AfE4c5GYZrpPTG5UkKfd6Jl8Pq1qyatHWXhCTpquOqPB1lTmS0f2gna8CMVyunV1CLVhmQVeNU2EgGQMh2wJpxO59ohNVD950HJM6lJiQVoAk7nAoJvvcHkCmrB7SSVN7xv2FIthYswVWnPU58BELwJazCu7qKcxKt0T6MdVhnZSiv64M56EBUJyXd7F3 admin@example.com</codeblock>
Code: Select all
<pre class="pre codeblock nobreak"><code><span class="ph">lastline@lastline-<span class="ph">manager</span>:~$</span> <kbd class="ph userinput">cat ~/.ssh/authorized_keys</kbd>
ssh‑rsa AAAADAQABAAABAQDn2hZvQiXAAAAB3NzaC1yc2EDWNQ9AOF6JvcoMbDGUrh0C6WWTdDvQZA0vTwAbeIdjkAlcoRN1BU9BLQo19W8eXsl9PRB4bN2Mu1P0XIWCIjiAVxOSJsP8rhMVoQkGES2vA+uqyqqPincLDfF0u6DetIyW+1nC6uEwtS6Bc9s6FnALBVjcjil6yZveGzuLqAvj9C4zl3ZoA24DUkkH25lzK3NNKJDUSgrhnkm9ouirjsCmfGPLwnS7p9VzYVkFmwnnygJLGEZf3mXgwSYMH1BcuHdbhFVKkzZicrmR2vSkSimTp50riZ3xDX91qpQskV9I4aFS9DtcsumjvDYA87Xend3vf system@example.com
ssh‑rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNrBpwY54v4XDePpQlDOBNpQpyBuJnPY3ThAE3YPAtqlboKeiUNDDgHbYLVVdXV8CFpvShaJ1oFZj5CNjp4krD9Bx2aK3QpoRX3e3ZWSv2JxlbBs61J4fTiKnyDyeGcqx3Q2JjgRTww5AfE4c5GYZrpPTG5UkKfd6Jl8Pq1qyatHWXhCTpquOqPB1lTmS0f2gna8CMVyunV1CLVhmQVeNU2EgGQMh2wJpxO59ohNVD950HJM6lJiQVoAk7nAoJvvcHkCmrB7SSVN7xv2FIthYswVWnPU58BELwJazCu7qKcxKt0T6MdVhnZSiv64M56EBUJyXd7F3 admin@example.com</code></pre>
But when the HTML is processed through Chemistry it results in an unexpected and unwanted font change. See the png attachment. The text "ssh-rsa" looks like helvetica or arial and isn't aligned with the other text.
fontchange.png
Have I tickled yet another bug?You do not have the required permissions to view the files attached to this post.
-
- Posts: 667
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unexpected change of font inside <pre>
Post by julien_lacour »
Hello,
Can you reproduce the problem without using any customization (or just using the outputclass="nobreak" rule from your CSS customization)?
Which version of Oxygen are you currently using? I tried on the last version from our website and the default transformation without reproducing the issue.
If you still reproduce the problem, please provide us your CSS customization at support@oxygenxml.com.
Regards,
Julien
Can you reproduce the problem without using any customization (or just using the outputclass="nobreak" rule from your CSS customization)?
Which version of Oxygen are you currently using? I tried on the last version from our website and the default transformation without reproducing the issue.
If you still reproduce the problem, please provide us your CSS customization at support@oxygenxml.com.
Regards,
Julien
-
- Posts: 54
- Joined: Mon Jun 27, 2011 10:51 pm
Re: Unexpected change of font inside <pre>
We're running oxygen-pdf-chemistry-22.0.
Here's the CSS:
Another issue is the hyphenation in the code block: How can I suppress that? It's supposed to represent the output from an ASCII terminal. I was expecting the lines to just break at the edge.
Here's the CSS:
Code: Select all
/*RSA kludge*/
.nobreak{
overflow-wrap: break-word;
}
-
- Posts: 54
- Joined: Mon Jun 27, 2011 10:51 pm
Re: Unexpected change of font inside <pre>
BTW: if I disable the .nobreak CSS, I still get the unexpected font change but the text just runs off the side of the page.
evenmorebroken.png
You do not have the required permissions to view the files attached to this post.
-
- Posts: 54
- Joined: Mon Jun 27, 2011 10:51 pm
Re: Unexpected change of font inside <pre>
Regarding hyphenation, I modified my CSS:
The "hyphens" directive is ignored by Chemistry.
Code: Select all
/*RSA kludge*/
.nobreak{
hyphens: none;
overflow-wrap: break-word;
}
-
- Posts: 667
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unexpected change of font inside <pre>
Post by julien_lacour »
Hello,
For the font issue, you should be able to resolve it by surrounding your words by a <ph>:
For the hyphenation issue, starting with Oxygen 22.1 (release is in a few weeks), you will be able to set the overflow-wrap property
You content will look like this:
Julien
For the font issue, you should be able to resolve it by surrounding your words by a <ph>:
Code: Select all
ssh‑rsa 
<ph>ssh-rsa </ph>
Code: Select all
.nobreak{
overflow-wrap: break-word;
}
overflow-wrap.png
Regards,Julien
You do not have the required permissions to view the files attached to this post.
-
- Posts: 54
- Joined: Mon Jun 27, 2011 10:51 pm
Re: Unexpected change of font inside <pre>
I tried both <ph> and the <codeph> to no effect. Either results with the san serif font on "ssh-rsa". <codeph> was worse as it also breaks the HTML rendering.
However, if I replace the non-breaking hyphen and the non-breaking space with normal characters, the font change doesn't occur. Unfortunately that breaks the desired effect in the HTML rendering, so it's not a solution.
However, if I replace the non-breaking hyphen and the non-breaking space with normal characters, the font change doesn't occur. Unfortunately that breaks the desired effect in the HTML rendering, so it's not a solution.
-
- Posts: 667
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unexpected change of font inside <pre>
Post by julien_lacour »
Hello,
I tried to reproduce the issue on <oXygen/> XML Editor 22.0, build 2020030607 but on my side the "ssh-rsa" looks normal (as on my previous picture).
Is it possible for you to send us a small sample (at support@oxygenxml.com)?
We just need the ditamap file and the topics involved in the codeblock.
Can you also confirm the scenario? Are you running the transformation inside Oxygen or in a separate command line?
Regards,
Julien
I tried to reproduce the issue on <oXygen/> XML Editor 22.0, build 2020030607 but on my side the "ssh-rsa" looks normal (as on my previous picture).
Is it possible for you to send us a small sample (at support@oxygenxml.com)?
We just need the ditamap file and the topics involved in the codeblock.
Can you also confirm the scenario? Are you running the transformation inside Oxygen or in a separate command line?
Regards,
Julien
-
- Posts: 667
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unexpected change of font inside <pre>
Post by julien_lacour »
Hello,
The problem is caused by the non-breaking hyphen character: the font used for the codeblock cannot render it, so it is rendered using one of our fallback font (used for CJK languages).
The best solution is to replace it by a combination of word joiner and normal hyphen:
Regards,
Julien
The problem is caused by the non-breaking hyphen character: the font used for the codeblock cannot render it, so it is rendered using one of our fallback font (used for CJK languages).
The best solution is to replace it by a combination of word joiner and normal hyphen:
Code: Select all
ssh⁠-⁠rsa
Julien
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service