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

WIP: Add simple print operation #937

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hzulla
Copy link

@hzulla hzulla commented Jun 25, 2018

Hello,

this implements a very simple print function and closes #888.

There are still some issues with this, therefore I'm asking for comments.

The print settings are being reset each time the user creates a new or loads an existing document. For the first printing, the documents dimensions and resolution are compared to those of the printer's default document size.

If the document fits onto a single printer's page, it is scaled at the default 100%, even if that results in a small document printed on an mostly empty page.

If the document dimensions and resolution are too large, printing is scaled down accordingly to fit a single page.

If the user decides to use a different scaling factor or printer document size, the document will be tiled on as many printer pages as needed for the user's desired settings.

The print settings are then stored for the document and will be reused for the next call to the print function. If the user has made the document larger by then, the printing will be tiled accordingly.

Here are the issues where I request help/feedback.

  • The accelerator Ctrl+P doesn't work as I would expect from reading the code, it will activate the TogglePreviewTool instead and I haven't found out why.
  • My code first writes a temporary PNG file, uses that for printing and then deletes it later. Obviously, it should be possible to use the document directly for printing without a temporary image file, but my understanding of mypaint's cairo/gtk code is very limited and bit of help on how to make the document draw directly on the print page's cairo context would be welcome.
  • The default DPI setting of a mypaint document is 72, which results in rather big prints. But that may be desirable for younger users, so it isn't much of an issue.
  • Should the document always be printed on the center of the printer page?

@hzulla
Copy link
Author

hzulla commented Jun 25, 2018

continuous-integration/appveyor/pr — AppVeyor build failed

Please advise. It appears to be unrelated to my patch?

@hzulla
Copy link
Author

hzulla commented Jul 27, 2018

@achadwick do you have on opinion on this patch? I'd welcome your comments and would love to know if this is a desired functionality.

@odysseywestra odysseywestra modified the milestones: Limbo, MyPaint v2.1.x Dec 11, 2019
@AesaraB AesaraB marked this pull request as draft January 17, 2024 08:43
@AesaraB AesaraB modified the milestones: v2.1.x, v2.02 Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Call system print dialogue
3 participants