lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Header pagination PR


From: Greg Chicares
Subject: Re: [lmi] Header pagination PR
Date: Tue, 18 Sep 2018 19:14:19 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-09-18 17:39, Vadim Zeitlin wrote:
> On Tue, 18 Sep 2018 17:26:35 +0000 Greg Chicares <address@hidden> wrote:
[...]
> GC> Manually test that a default PDF illustration of each ledger type
> GC> can be created:
> GC> 
> GC>   for z in sample2* do  # casual shell pseudocode
> GC> 
> GC>   File | New | Illustration
> GC>     change "Policy" to $z
> GC>   OK
> GC>   File | Print to PDF
> GC> 
> GC> ...succeeds for "sample2naic", but fails thus for all others:
> GC> 
> GC>   [copied by hand from an un-copyable-from 'wine' messagebox]
> GC>   Assertion 'dc().GetTextExtent(i).x <= rect.width()' failed.
> GC>   [wx_table_generator.cpp : 250]
> 
>  Yes, this is the same one I'm seeing. It's quite strange that you can see
> it too now whereas you couldn't before, as I definitely see it both before
> and after my changes.
> 
>  FWIW the difference is also relatively important for me: it's 121 for the
> actual extent and 110 for the rectangle width IIRC.

A little detail on the first failure for each ledger type:

'sample2finra': 110 < 116 "0.00% Assumed Sep Acct"
'sample2gpp'  : 110 < 116 "0.00% Hypothetical Gross"
'sample2ipp'  : 110 < 121 "0.00% Hypothetical Rate of"

But if the assertion is suppressed, then many failures are observed,
as may be seen with this experimental patch:

---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 4ec91b87..7c9491e7 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -23,6 +23,7 @@
 
 #include "wx_table_generator.hpp"
 
+#include "alert.hpp"
 #include "assert_lmi.hpp"
 #include "miscellany.hpp"               // count_newlines(), split_into_lines()
 #include "ssize_lmi.hpp"
@@ -247,7 +248,15 @@ void wx_table_generator::output_super_header
 
     for(auto const& i : lines)
         {
-        LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+if(rect.width < dc().GetTextExtent(i).x)
+  warning()
+    << rect.width << " rect.width\n"
+    << dc().GetTextExtent(i).x << " dc().GetTextExtent(i).x\n"
+    << i << " i\n"
+    << LMI_FLUSH
+    ;
+
+//      LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
         dc_.DrawLabel(i, rect, wxALIGN_CENTER_HORIZONTAL);
         rect.y += row_height_;
         pos_y  += row_height_;
--------->8-------->8-------->8-------->8-------->8-------->8-------->8-------

With that patch, I produce a 'sample2finra' PDF, and compare it to
  all-samples.sample2nasd.000000004.pdf
from the set of samples I sent by personal mail on 2018-08-30T23:23Z
(which is the right file, because FINRA is the new NASD), and the
font sizes seem to be different: the new ones look bigger, and that
seems to be the cause of the assertion.

If you want to rule out any possible input-file difference by
using the input file in the archive sent August 30, do this first:
  vim all-samples.cns
  :%s/nasd/finra/

The code where the font sizes are set is unchanged:

        // Use non-default font sizes that are used to make the new
        // illustrations more similar to the previously existing ones.
        pdf_writer_wx writer
            (output.string()
            ,wxPORTRAIT
            ,{8, 9, 10, 12, 14, 18, 20}
            );

so could this be a wxHTML regression?

> [...] shortening the super header

...is politically not an option.



reply via email to

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