Ticket Hash: | 7d17f860bf9df5356590356efbd697173976626c | |||
Title: | Support duplex printing, including card back faces | |||
Status: | Verified | Type: | Feature_Request | |
Severity: | Important | Priority: | High | |
Subsystem: | Document_Model | Resolution: | Open | |
Last Modified: | 2024-04-18 17:08:59 | |||
Version Found In: | ||||
User Comments: | ||||
thomas added on 2022-12-01 13:20:35:
Add support for duplex printing, including card back faces. For single-faced cards, the appropriate back image has to be fetched. Code changesDocumentWhen duplex mode is on, the page count will always be even. Front faces are on odd pages, back faces on even pages. Back pages should be read-only. Do not allow the user to put cards on back pages. Switching to/from duplex mode
Document shufflingThe shuffling algorithm has to be adjusted:
Adding pagesPages must be added in multiples of 2 to maintain the odd=front, even=back invariant Adding cardsWhen a card is added to an odd page, a back image has to be added to the next page Special care has to be taken when a double-faced card gets added. Removing cardsWhen a card is removed, it’s back has to be removed from the next page, too Document compactingThe compacting algorithm has to be adapted to run on both sets of odd and even pages in parallel. PageRendererThe page renderer has to flip all even pages.
AddCardWidgetThe AddCardWidget has to disallow adding cards to read-only back pages. thomas added on 2023-01-14 19:35:56: On duplex documents, odd pages contain card fronts, even pages contain card back sides. Idea for changes to the save file format
thomas added on 2023-04-23 22:23:23: The back faces need images, so implement fetching them. Managing back face imagesDatabase
Scryfall APIThe URLs to back face images aren't part of the regular bulk data.
Image database
thomas added on 2023-04-26 09:18:15:
Fixing mixed-size pages has to handle duplex documentsThe method Idea for explicitly saving back pagesInstead of implicitly saving even pages in duplex mode, it is possible to explicitly save them by adding a type column to the Card table. Card table type columnAdd a type column to the Card table. This can be used as a string-based enum to identify the type of card.
thomas added on 2023-04-28 14:08:25: The MissingImagesManager has to also handle missing back images, in case fetching those failed before printing thomas added on 2023-05-07 14:21:20: Progress report Implemented
TODO
thomas added on 2023-05-23 10:56:47: Handle reversible cards: There are a few reversible cards printed in the SLD set. Those have the same single-sided card on both front and back side. For example: https://scryfall.com/card/sld/1122 Those have to be supported properly when switching between printings in duplex mode. I.e. when switching the front to the SLD printing, the regular card back has to be replaced with the SLD printing back side. When switching away, the back has to be replaced with a regular card back. thomas added on 2023-12-24 22:48:15: Idea for handling of cards in duplex mode: Redefine the current "Card" classCurrently, the
Duplex handlingDocumentThe Document instance only holds one Card instance for each card in the document. With that, back sides are fully transparent and implicit. PageSceneIn duplex mode, the PageScene uses the front of each Card on the current page when rendering an odd page, and the back, when rendering an even page. SimplexDocumentIn simplex mode, the document holds two Card instances for each DFC, one with the front&back set, and one with only the back. Maybe use a plain CardFace for the back only. Ensure that the same object for both back face instances is used. Also ensure that the proper change signals are emitted. With that change, a single edit can alter two rows, even across pages. Linking backs to frontsTo easily find the other face for the purpose of updating DFCs or switching to duplex mode, evaluate if Print switchingWhen switching a printing, do so for both front and back Enabling duplexWhen enabling duplex, scan the document for DFC Cards and singular backs. For each DFC card, delete the backs based on object identity, and keep the full Card instances. For all remaining back sides (those had no front in the original document), construct a full Card instance and place them there. Disabling duplexFor each DFC, add a plain back side CardFace in the document. Maybe insert right after the front. thomas added on 2024-01-12 00:15:13: The Document model does not even need to actually hold Page instances for even/back pages. While in duplex mode, the list index of the currently active page can be computed by floor(active_page_number/2) thomas added on 2024-01-18 12:19:20:
Disabling duplex modeRemove all non-unique back faces, then re-flow the document, then remove empty pages. Unique back facesAll back faces that are only used by a single printing are unique. This includes meld card back sides and DFC back sides. The BackFace class should hold this property as a boolean. Re-flow
thomas added on 2024-02-04 10:09:37: Empty back pages in DFC-only mode should not draw cut helper lines, document titles and page numbers. Those pages should be completely empty If the user prints a DFC-only duplex mode document on a simplex printer, the app should not print an empty cut helper grid on all back pages without actual images. These pages should be left completely blank, so that the sheets can be put back into the printer paper feed. thomas added on 2024-04-18 17:08:59: Alternate idea, which should solve most issues: Replace the Document classCompletely replace the document class. 1. The document is split into 4 sections
Each section holds cards as a list. Each individual card can hold it's front face and back face 2. Paginate via a QSortFilterProxyModelImplement a custom QSortFilterProxyModel that converts the base Document into a list of pages. Enabling/disabling duplex printing can then do an easy full re-structuring of the proxy model. When duplex is enabled, the double-sided sections can be projected into the target format, be it straight duplex or printing in a way that allows some folding adjacent prints to form double-sided print-outs. |