Delta character does not work

Oxygen general issues.
Dieter
Posts: 1
Joined: Thu Aug 18, 2022 1:53 pm

Delta character does not work

Post by Dieter »

Hi
I have problem getting the delta character working in Oxygen. It shows up ok in the editor, but in the PDF it is replaced by a "#". I have tried also the decimal and hexadecimal options, but they did not work either. However, the em-dash hexadecimal (&#2014:) works fine.
I am using Oxygen version 24.0 in a MATE Desktop Environment version 1.20.4.
Any idea how to solve this?

Best regards,

Dieter
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: Delta character does not work

Post by julien_lacour »

Hello Dieter,

When a character is rendered as "#" in the PDF, that means that the current font used to render the text doesn't have the corresponding glyph in its list of supported glyphs. To avoid characters being rendered as #, you need to add one or more fallback font(s):

Code: Select all

:root {
  font-family: "Times New Roman", Symbol !important;
}
Also, and as you will see in the user-guide topic, you can add a generic font family (serif, sans-serif or monospace) as fallback font.
This will tell Oxygen PDF Chemistry to use one of its predefined fallback fonts : for Linux based platforms, the processor mainly uses the following fonts:
  • DejaVu (DejaVu Sans / DejaVu Serif / DejaVu Sans Mono)
  • Free (FreeSans / FreeSerif / FreeMono)
Those fonts normally covers a lot of symbols (full list of fallback fonts available here).
If you already used a generic family as fallback font, make sure the underlined fonts are installed on your platform.

Regards,
Julien
MWdal
Posts: 20
Joined: Thu Jun 09, 2022 2:49 pm

Re: Delta character does not work

Post by MWdal »

I tried your fallback font suggestion, and it works partly.
With this line in the css file:

Code: Select all

body{
...
font-family: "Times New Roman", "DejaVu sans" !important;
.. }
the delta character is printed ok. But the rest of the document also gets the Dejavu font which is not really what we want. Is there any way to make it use the fallback font ONLY for characters that Times new roman can't render, like the delta character?
andrei_pomacu
Posts: 39
Joined: Mon Jul 25, 2022 11:18 am

Re: Delta character does not work

Post by andrei_pomacu »

Hi,

Can you send me your CSS files and the publication that you are working on in order to debug it and see where the problem occurs?
In case you have sensitive content that you do not want to share with us you could randomize the text with Randomize XML text content.

Kind regards,
Andrei
MWdal
Posts: 20
Joined: Thu Jun 09, 2022 2:49 pm

Re: Delta character does not work

Post by MWdal »

Hello Andrei,
we have quite heavy restrictions on what we can send, so before I do that I just want to ask you some more questions. So if I put Deja vu Sans as fallback font, and there is a delta character in the publication, the complete publication will have Deja vu Sans as font.
And I would get the same result if I put Deja vu Sans as font without any fallback font, right?

Code: Select all

body{
...
font-family:  "DejaVu sans" !important;
.. }
thanks, Mikael
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

Re: Delta character does not work

Post by julien_lacour »

Hello Mikael,

Unfortunately the processor use the font that allows it to render all the character, this is why DejaVu Sans is used for all the text.
A workaround to this problem is to wrap the delta character into a <ph> element and to add the fallback font for this element only:

Code: Select all

*[class ~= "topic/ph"] {
  font-family: "Times New Roman", "DejaVu sans" !important;
}
Regards,
Julien
MWdal
Posts: 20
Joined: Thu Jun 09, 2022 2:49 pm

Re: Delta character does not work

Post by MWdal »

Thanks for good tip Julien.
I think that we now enough options to make this work.
The option to use DejaVu for all text may be the best solution, since that also solves the problem with unordered lists with several levels. In those lists level 2 and lower is rendered as # (and not bullets) with Times New Roman, but with DejaVu it looks fine.
regards,
Mikael
Post Reply