PDF font sizes as percent nest and can end up very small

Bug #953747 reported by Doug Smythies on 2012-03-13
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Server Guide
Doug Smythies

Bug Description

Use of <screen> with embedded <userinput> and <computerlisting> is used throughout the serverguide source .xml files.

Note that I omitted <command> above, as it uses inline.boldseq and doesn't suffer from this issue. The others use various forms of monoseq, which has the issue.

There is a major problem with the PDF generation, at least in my opinion, in that the font size for a lot of these templates (if that is the right word) is declared as a percentage of the current font size. Currently the most used one is 80%. As mentioned above, things are often nested to at least two levels, or a font size of .8 *.8 = .64 The main body font is already pretty small (well, at least for my 56 year old eyes, probably no problem if you are in your 20's)
Now add onto that some, perhaps, improper formatting where a <userinput> is nested inside of a <computerlisting> and we are down to 51% of the main body font size.

Keeping in mind that any solution should invovle only changes to Ubuntu files as opposed to docbook files, I have tried a number of ways to fix this (i.e. wasted lots of time), but the solution I will put forward as a proposed patch is to hardcode the font size as 9 pt instead of 80%, because the main body stuff is 11pt. If there is a way to make it 0.80*main, that would obviously be better ( I was unable to figure out how).

Note that there might be implications beyond my little world of the PDF version of the serverguide. Therefore I will hold off on submitting this as a merge proposal. Besides, I do not even know if I can submit a change to this particular file via a merge proposal.

There will be side effects of this change in that it would change the size of stuff that is currently too small in the PDF version. Some page breaks and such might need to be changed. (example: blank lines added before Table 19.1 so that it does not span a page break (bad example, actually because there are not any font changes on that page, but you get the idea). I will volunteer to take care of any required reformatting.

I'll add some attachments to help with my explaination, and include a diff of my proposed patch.

The file in question is ubuntu-pdf.xsl

A note about debugging this issue: It helps to make the change more dramatic. i.e. change from 80% to 50% to emphasize the nesting effect. Change my proposed 9 pt fix to 7 pt or even smaller, again to emphasize the results.

Related branches

Doug Smythies (dsmythies) wrote :
Doug Smythies (dsmythies) wrote :

Note: there are measurement errors, because even zoomed in there were not a lot of pixels.

Doug Smythies (dsmythies) wrote :
Doug Smythies (dsmythies) wrote :

Figured out how to to scale the font based on the master font, instead of just hardcoded.
New proposed patch is attached, however will actually be submitted via a merge proposal.

Changed in serverguide:
assignee: nobody → Doug Smythies (dsmythies)
status: New → Fix Committed
Changed in serverguide:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers