non breaking space width

Here should go questions about transforming XML with XSLT and FOP.
i.weyers
Posts: 3
Joined: Mon Dec 16, 2013 4:03 pm

non breaking space width

Post by i.weyers »

Hello,

I'm using the DITA OT implementation in Oxygen 15.1 with FOP to render PDF's from my XML content. The system has been working fine, but we just added a non-breaking space ( ) between values and units and noticed that when rendering the non-breaking space, that these spaces are wider that normal spaces (about twice as wide). I could not find anything in the topic.fo or any stage files (stage 1 and 1a.xml and stage 2 and 3.fo) to explain why this would happen. Possibly stranger still, these files did not mention anything about the non-breaking space.

Doe anyone know whether it is possible to change the width of the non-breaking space to equal the normal space?

Thank you!
Inge
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: non breaking space width

Post by sorin_ristache »

Hello,

Can you post here the whole paragraph in the DITA XML topic file that has this problem? It is possible that the text could be justified by the FO rendering engine because that is how it can break the text when the line containing the   character is filled. When the text is justified on a line in the PDF output the space between the words can appear longer than in the XML document, but that is only the effect of the text justification action.

The solution in this case would be to customize the DITA PDF transformation for that particular element containing the   character (paragraph, note, listitem, etc) and set other value for the text-align attribute, for example:

Code: Select all

<fo:block text-align="left">
instead of:

Code: Select all

<fo:block text-align="justify">

Regards,
Sorin
i.weyers
Posts: 3
Joined: Mon Dec 16, 2013 4:03 pm

Re: non breaking space width

Post by i.weyers »

Hello Sorin,

The nbsp's are in the following text:

Code: Select all


...
</step>
</steps-unordered>
<postreq>
<note type="caution">Gebruik het apparaat per keer niet langer dan 30&#160;seconden achter
elkaar en laat het apparaat na ieder gebruik minstens 2&#160;minuten afkoelen.</note>
</postreq>
</taskbody>
</task>
The entire topic is quite lengthy. As for your suggestion± I think that would mean that I would have to give all fo:blocks text-align="left". I will try it on that note that it is in now. Thanks in advance!

Inge
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: non breaking space width

Post by sorin_ristache »

I inserted your note in a DITA topic but I get a normal width space at the location of &#160;:

Image

It seems that in your case the longer space comes from the justification of the text on the line. You should customize the PDF transformation to replace text-align="justify" with other value.


Regards,
Sorin
i.weyers
Posts: 3
Joined: Mon Dec 16, 2013 4:03 pm

Re: non breaking space width

Post by i.weyers »

I have tried your suggested approach by adding the attribute text-align="left" at severatl different places in the note structure but to no avail. Even if the direct parent fo:block has text-align="left" the nbsp still takes up a double space.

Do you have any other ideas as to what might cause this? If you want to see more information, I can post or send it. I must warn you though, the customization stylesheet is quite complicated (perhaps more complicated than necessary, but I try my best).

Inge
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: non breaking space width

Post by sorin_ristache »

Hello Inge,

Please can you post here a screenshot with the PDF result output or send it to us (the screenshot or the PDF output)?

Yes, please post your customization stylesheet. Let's look at your custom stylesheet first. I have no other idea for now because I can't even reproduce the problem in the PDF output.


Regards,
Sorin
Post Reply