Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF layout options? #6

Closed
arelkin opened this issue Jan 20, 2022 · 3 comments
Closed

PDF layout options? #6

arelkin opened this issue Jan 20, 2022 · 3 comments

Comments

@arelkin
Copy link

arelkin commented Jan 20, 2022

https://www.vox.com/21523212/crossword-puzzles-free-daily-printable
(See January 18, 2022 puzzle: by Juliana Tringali Golden)

  1. the blue shading is not reflected in the PDF.
    (in .puz, they are reflected as circles; in .jpz, reflected properly as blue shading)

  2. the grid is bottom aligned. (seems like it should be top aligned)

JulianaTringaliGolden.pdf

Feature request for PDF: allow user to choose font. Or at least give a few more font options. I usually find it easier to read sans-serif fonts.

@jpd236
Copy link
Owner

jpd236 commented Jan 21, 2022

Thanks for the report!

The shading is actually there - it is just very, very subtle. There is a setting for ink saver that should default to being off, but which you appear to have enabled; the problem is that this shade of blue is so light that any amount of further lightening makes it very hard to see. Dropping the percentage to 25% or lower makes it more visible. Unfortunately, it's a bit hard to pick a setting here that works well across the board. I commonly see crosswords which use very dark/bright colors (e.g. https://spyscape.com/crosswords/puzzle-148-up-to-speed, which looks good even at 75% Ink Saver), so applying the ink saver setting to the custom colors seems appropriate in general, but won't work well for every situation. I can leave this open and think about whether some sort of minimum contrast ratio could make things better.

The grid layout is just hard-coded to go in the bottom right for simplicity - again, hard to come up with a scheme that works for all grid sizes and puzzle types. Adding a setting to put it in other corners by default would probably be doable. Trying to detect a "best" corner for each puzzle would be tougher.

Settings/controls for font options makes sense. One drawback is that the fonts have to be bundled with the extension, or else special characters won't be supported (and I don't think there's a way to access system fonts, though it would probably be possible to support uploading a custom font). But a sans-serif option would probably be reasonable, at least.

@arelkin
Copy link
Author

arelkin commented Jan 21, 2022

Thanks for the quick response.

Yes, you're right, I did have the ink saver set rather high. Sorry about missing that.

Re, fonts: would it be possible to, at least, include a generic sans-serif: Arial, or some similar font?

Also, any plans to scrape Crossword Compiler grids?
https://www.washingtonexaminer.com/crossword-grounded-flights
https://crosswordsbackwards.com/backward-crossword-puzzle-380/

think about whether some sort of minimum contrast ratio could make things better.

Yes, I guess if the constructor sets very light colors, you could darken them a little if they go past some lightness threshold.

jpd236 added a commit that referenced this issue Jan 23, 2022
Supports any applet embedded directly on the current page, as well as
sites which use an iframe to embed a page with the applet as long as the
page comes from a known list. (Otherwise, we'd need to request global
host permissions in order to be able to check for the presence of an
applet on an iframe).

See #6
@jpd236
Copy link
Owner

jpd236 commented Jan 23, 2022

Added a setting to select a sans-serif font for PDFs, and support for Crossword Compiler applets. For the latter, one caveat is that these are hosted directly by the site's host, rather than a central service, so it's impossible to know up front if an embedded frame contains such a puzzle or not just from the URL. Since we don't want to request permission to view every page as this is scary to some users, the scraper only supports sites which embed the applet directly on the current page, or specifically listed sites known to contain iframes. The two sites you linked, as well as another I'm aware of (www.brendanemmettquigley.com), should all work, but let me know if you're aware of any more.

Otherwise, I filed a separate bug to track selection of the grid corner when rendering PDFs at jpd236/kotwords#27, and for dealing with light cell background colors in ink saver mode at jpd236/kotwords#28. These are more significant, though, so I probably won't get to them soon unless there's more demand.

I think that's everything here, but feel free to reopen / file a separate request for anything I missed. Will make a new release some time soon unless I find other issues.

@jpd236 jpd236 closed this as completed Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants