bugGNU troff - Bugs: bug #48835, preformatted text does not retain...

 
 

bug #48835: preformatted text does not retain adjacent spaces using ps,pdf, html output devices

Submitted by:  None
Submitted on:  Sat 20 Aug 2016 03:50:15 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Incorrect behaviourStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenPlanned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 20 Aug 2016 04:46:42 PM UTC, comment #1:

In regards to ps and pdf, (I don't know anything about html), spaces are not "printed" they are just measured gaps between items which are printed. In your example you are using the proportional Times Roman font - the default. The width of a space in this font is about one third of the width of the capitals you are using. If you edit your example and add a new line at the top:-

.fam C

Groff will now use a fixed pitch font (courier) where the width of the space is the same as the width of the capitals. You should now see the spacing as you expect. You will see exactly the same phenomenon if you copy your example text into a word processor and mark the text with a proportional font and then change it to a fixed width font.

Deri James <deri>
Project Member
Sat 20 Aug 2016 03:50:15 PM UTC, original submission:

Terminal devices properly retain spaces when using .na or .nf, but when "groff -T DRIVER" is used and DRIVER is ps, html, or pdf spaces are not retained correctly in pre-formatted text. For example, using the following input file:

.nf

> HH HH EEEEEEEEEE LL LL OOOOOOOO
> HH HH EEEEEEEEEE LL LL OOOOOOOOOO
> HH HH EE LL LL OO OOO
> HH HH EE LL LL OO O OO
> HHHHHHHHHH EEEEE LL LL OO O OO
> HHHHHHHHHH EEEEE LL LL OO O OO
> HH HH EE LL LL OO O OO
> HH HH EE LL LL OOO OO
> HH HH EEEEEEEEEE LLLLLLLLLL LLLLLLLLLL OOOOOOOOOO
> HH HH EEEEEEEEEE LLLLLLLLLL LLLLLLLLLL


and "groff -T html" this text becomes

OOOOOOOO<p>&gt; HH HH EEEEEEEEEE LL LL OOOOOOOO <br>
&gt; HH HH EEEEEEEEEE LL LL OOOOOOOOOO <br>
&gt; HH HH EE LL LL OO OOO <br>
&gt; HH HH EE LL LL OO O OO <br>
&gt; HHHHHHHHHH EEEEE LL LL OO O OO <br>
&gt; HHHHHHHHHH EEEEE LL LL OO O OO <br>
&gt; HH HH EE LL LL OO O OO <br>
&gt; HH HH EE LL LL OOO OO <br>
&gt; HH HH EEEEEEEEEE LLLLLLLLLL LLLLLLLLLL OOOOOOOOOO <br>
&gt; HH HH EEEEEEEEEE LLLLLLLLLL LLLLLLLLLL OOOOOOOO</p>

where the text should be in a "<pre>" section or spaces should be retained with "&nbsp;" replaceing the spaces in such a region.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by deri (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1