Closed LinqLover closed 1 year ago
This will take time.
Lol, we're getting some occasional sporadic segfaults during screenshot generation on the CI. I have already experienced some of them when working locally (totally different stack dumps, though). Maybe out of memory/some memory leak/...?
@LinqLover Anything left for me to do here?
@codeZeilen Yes, could you maybe take a short stand to the open questions in the PR description? :) tl;dr: Should I further reduce PDF size & build times and if yes, should we have a switch for high-qualitative print builds?
Update:
This PR changes all figure scripts to use a high-dpi mode. Currently, a scale factor of 1000% is used.
Plan (see details below)
About the scale factor
The reasoning for the chosen scale factor is:
Plus, 1000% just look extremely sharp even on my high-dpi monitor when I scroll into any screenshot:
Performance considerations
Is this impact too large?
If yes, my recommendation would be to make the quality configurable so that we can still use the high quality for deploying the print version of the book (e.g., only when triggering a manual release through the CI).
SBEWorldHelper class>>#scaleFactor
dynamic. But this increases the risk for unexpected figure slips that only occur for certain scale factors, as I have met some while migrating for this PR. I have not yet further spiked this.Implementation
The key change is in https://github.com/hpi-swa-lab/SqueakByExample-english/pull/137/commits/1af076a83eac7511f7a00beaeaa16b10eb41d1de#diff-3c20f202c870e5c8070c65943b8b009add95dbfa97dd06304e4c152a68d23560 where the scale factor used during screenshotting is raised to 10. Besides, various places in the SBE-Extract logic and in the individual figure scripts are adjusted to be high-dpi-sensitive, i.e., using
#px
& Co. I had some fun converting the scripts semi-automatically, see the commit message in https://github.com/hpi-swa-lab/SqueakByExample-english/pull/137/commits/01d95a37dbbfd590061d24b30c93a187745bbc38 for additional details.All
\includegraphics
that usedscale=
are rewritten towidth=
to eliminate the dependency on a concrete scale factor. While I checked all figures in the book again, there might be some figures that no longer have to perfect size for your taste @codeZeilen.Regarding the Morphic examples in the book (Quinto/SBE-Morphic), they are kept free from any high-dpi-aware code for sake of simplicity. Instead, a few relevant figure scripts rescale the morphs in question manually (see https://github.com/hpi-swa-lab/SqueakByExample-english/pull/137/files#diff-8c737ffb22e03102e18ddb43a4ff377860346cfad3c78badbe05e37a4b75c5f8R49-R57 for instance).
Also, some scripts are refactored and some figures (such as QuickTour/ClassBrowser2) receive minor optical tweaking.
Depends on Morphic-ct.2047 and Morphic-ct.2048, which are already integrated into Squeak 6.1Alpha and backported to Squeak 6.0. Without these patches, some lists were scrolled incorrectly, and some halo labels were truncated.
Integrates #136. Closes #35.