lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] First version of the illustrations pagination patch


From: Vadim Zeitlin
Subject: Re: [lmi] First version of the illustrations pagination patch
Date: Sat, 21 Jul 2018 23:57:42 +0200

On Wed, 18 Jul 2018 22:21:08 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2018-07-18 15:17, Greg Chicares wrote:
GC> > On 2018-07-18 12:16, Greg Chicares wrote:
GC> >> On 2018-07-17 21:14, Greg Chicares wrote:
GC> >>
GC> > [...steps to reproduce...]
GC> >>
GC> >> Not enough space for all 10 columns.
GC> > [...]
GC> >> Assertion '0 <= ci.col_width - column_margin()' failed.
GC> [...]
GC> > I rolled back the last nine of the thirteen commits in this PR...
GC> [...]
GC> > /opt/lmi/src/lmi[0]$git checkout d1b03aa0 
GC> [...]
GC> > ..and rebuilt, after which I observed neither the problems above,
GC> > nor the one below
GC> 
GC> Those errors reappear if I roll back only eight of the commits:
GC>   git checkout b515441b
GC> 
GC> They do go away with this brute-force change:
GC> 
GC> 
---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
GC> diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
GC> index 95372c93..289de90b 100644
GC> --- a/group_quote_pdf_gen_wx.cpp
GC> +++ b/group_quote_pdf_gen_wx.cpp
GC> @@ -666,7 +666,7 @@ void group_quote_pdf_generator_wx::save(std::string 
const& output_filename)
GC>      pdf_writer_wx pdf_writer
GC>          (output_filename
GC>          ,wxLANDSCAPE
GC> -        ,{7, 8, 10, 12, 14, 17, 20} // Standard HTML font sizes.
GC> +        ,{7, 7,  7,  7,  7,  7,  7} // Standard HTML font sizes.
GC>          );
GC>  
GC>      int pos_y = 0;
GC> 
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------
GC> 
GC> but I don't see what the problem was.

 Sorry, the problem is indeed as stupid as making a mistake in the font
sizes and my proposed fix (also pushed to the PR 86 as
https://github.com/vadz/lmi/pull/86/commits/8df37dfb3edc175df2c0789c6b3c792376f6f0bb)
is not very different from the above one:
---------------------------------- >8 --------------------------------------
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 67ad6916a..5bc3e3468 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -665,7 +665,7 @@ void group_quote_pdf_generator_wx::save(std::string const& 
output_filename)
     pdf_writer_wx pdf_writer
         (output_filename
         ,wxLANDSCAPE
-        ,{7, 8, 10, 12, 14, 17, 20} // Standard HTML font sizes.
+        ,{6, 7, 8, 9, 11, 13, 16} // Standard HTML font sizes for 8pt base.
         );
 
     int pos_y = 0;
---------------------------------- >8 --------------------------------------

GC> Searching online for "Standard HTML font sizes" produces such a chorus
GC> of "Use CSS!" that I'd almost think HTML3 predated the web.

 "Standard" in this context really means "used by default by wxHTML",
although it does base the font sizes used on what antique browsers used to
do, i.e. uses the factors {0.75, 0.83, 1, 1.2, 1.44, 1.73, 2} that (almost)
correspond to the successive powers of 1.2. The problem is that I used
these factors with the base size of 10, whereas PDF quotes used the normal
font of size of only 8pt by default, so the right thing to do is to
recalculate the font sizes by multiplying 8, not 10, by these factors (note
also that the results are supposed to be truncated, not rounded, and that I
used 7pt for the smaller font instead of 6pt as this would have made it of
the same size as tiny font, which would seem to be wrong, but none of this
matters as group quotes code only uses the normal and +1 font sizes).

 Sorry again for this stupid bug and thanks for finding it!
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]