utelle / wxpdfdoc

wxPdfDocument - Generation of PDF documents from wxWidgets applications
http://utelle.github.io/wxpdfdoc/
Other
70 stars 27 forks source link

Use of deprecated wxFillLogFont() #60

Closed iwbnwif closed 5 years ago

iwbnwif commented 5 years ago

This function is now deprecated and causes a compiler warning. The following trivial diff fixes the warning in accordance with the method proposed by wxWidgets.

The trivial fix is to replace:

wxFillLogFont(&lf, &font);

with

LOGFONT lf = font.GetNativeFontInfo()->lf;

at line 230 of pdffontparsertruetype.cpp and including fontutil.h.

Sorry for not submitting a PR, but I don't have a clone of this repository.

vadz commented 5 years ago

Thanks, this is indeed the right fix and it should work not only with 3.0, but even with 2.8 (although I haven't tested it there...).

utelle commented 5 years ago

Commit 6bc5794ba0c7461225ec976c7d9130871bd6ce5a should fix the issue.

I verified that it works for wxWidgets 2.8 as well.

utelle commented 5 years ago

@vadz One of the Travis CI runs fails, namely the one for MSW cross compilation which downloads archives from your website (tt-solutions.com). Here are the messages dislayed:

Get:1 http://apt.tt-solutions.com trusty/main amd64 wx3.0-headers amd64 3.0.2+dfsg-2 [1,022 kB]
Get:1 http://apt.tt-solutions.com trusty/main amd64 wx3.0-headers amd64 3.0.2+dfsg-2 [1,022 kB]
Get:2 http://apt.tt-solutions.com trusty/main amd64 wx3.0-headers-msw amd64 3.0.2+dfsg-2 [256 kB]
Get:3 http://apt.tt-solutions.com trusty/main amd64 libwxmsw3.0-dev amd64 3.0.2+dfsg-2 [15.0 MB]
Err:3 http://apt.tt-solutions.com trusty/main amd64 libwxmsw3.0-dev amd64 3.0.2+dfsg-2
  Connection failed
Err:3 http://apt.tt-solutions.com trusty/main amd64 libwxmsw3.0-dev amd64 3.0.2+dfsg-2
  Connection failed
Err:3 http://apt.tt-solutions.com trusty/main amd64 libwxmsw3.0-dev amd64 3.0.2+dfsg-2
  Connection failed
Fetched 1,000 kB in 2min 10s (7,683 B/s)
E: Failed to fetch http://apt.tt-solutions.com/pool/main/w/wxwidgets3.0/libwxmsw3.0-dev_3.0.2+dfsg-2_amd64.deb  Connection failed
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Maybe it would be better to set up an AppVeyor script for MSW testing using the official precompiled wxWidgets binaries?

vadz commented 5 years ago

I don't understand what's going on here, the repository is up and I can fetch the failing URL from another machine without any problems, yet Travis fails to get it, even though I've restarted this build twice now. I can try rehosting these files on another machine perhaps, but maybe the problem will disappear on its own slightly later?

As for AppVeyor, I'd rather have both, as building natively and cross-compiling is not quite the same.

utelle commented 5 years ago

The download process consistently failed for about 2 days. However, I restarted that build again just a few minutes ago ... and it seems that this time the download was successful ... and the build succeeded, too. So, we can keep this cross-compiling build for now.

I will add an AppVeyor script soon. It certainly makes sense to include a native Windows build in CI, too.

utelle commented 5 years ago

In the meantime I added AppVeyor CI. At the moment only compilation.

This triggered Travis CI as well. And again the download from your server failed. I restarted the job, and watched the progress. When it came to downloading the wx libs, the downloads started, but transfer speed was very low - below 1 kB/sec. After several seconds the downloads were interrupted/stopped with a Connection failed message. Restarting the job again didn't help. Could it be that your server is rather busy during daytime?

utelle commented 5 years ago

I tried to download the failing URL manually from my computer, and I also observe a very low transfer speed (below 2 kB/s with an estimated download time of almost 2 hours). That is, there seems to be an issue with the Internet connection.

vadz commented 5 years ago

I'll look at this a.s.a.p.

vadz commented 5 years ago

I have no idea what's going on here, it looks like I do have a problem on my side, but I don't know what is it exactly. After rebooting the rooter, things seem to work much better (it's still only ~120kB/s, but this is sufficient for now and I'll think about moving these files to wxWidgets main server, which has much better connectivity).

utelle commented 5 years ago

Thanks for looking into this.

Another option could be to add those files as assets of the corresponding wxWidgets release on GitHub.

vadz commented 5 years ago

Just FYI: the router was faultless, looking further into this I see that my bandwidth on this connection is just exhausted by a couple of IPs from 35.184.0.0/13 CIDR (Google LLC, but this is probably one of their cloud servers?), that keep downloading libwxmsw3.0-dev_3.0.2%2bdfsg-2_amd64.deb all the time (and so rebooting the rooter just broke their connections for awhile). I'm pretty sure this is some kind of misconfiguration rather than anything malicious, but the fact is that I'm just being DoS'd.

I'll probably block this subnet for now, but if it happens again, I'll move these packages somewhere else...

utelle commented 5 years ago

I hope you can sort things out, so that this DoS type access stops.

Since the original goal of this issue has been fulfilled, I'm closing it now.