Skip to content

Conversation

@fedelibre
Copy link
Member

@fedelibre fedelibre commented Apr 10, 2025

Fix #1414

@fedelibre fedelibre marked this pull request as draft April 10, 2025 20:42
@fedelibre
Copy link
Member Author

I'm happy with the changes.

I'm keeping it as draft, as I have to remember to update the user manual. But I'd like to have some feedback first. See also the screenshots I put in issue #1414

@fedelibre fedelibre marked this pull request as ready for review April 26, 2025 14:11
@fedelibre
Copy link
Member Author

@bmjcode I've rebased it and updated the documentation.

@bmjcode
Copy link
Collaborator

bmjcode commented Apr 26, 2025

Looks good. Just a couple points:

The page list on the left is slightly too narrow to display the full labels on mine. Can it be made a hair wider?

image

Also, the manual mentions an external printing command can be set on Windows and macOS. That's not actually the case on any platform, as a quick glance through preferences/musicviewers.py will confirm. (With the move to QtPdf, everything is now printed as a raster image.)

image

@fedelibre
Copy link
Member Author

fedelibre commented Apr 27, 2025

On Linux at startup (with no previous conf file present), the preferences appear very shrinked:

prefs shrinked

then you can drag the window and the size is remembered. So it's not a big deal... but sure it could be improved.

I see a better behaviour with the left sidebar on Linux. When I shrink the window horizontally to the minimum it never cuts the preferences on the left:

prefs no cut

@fedelibre
Copy link
Member Author

Also, the manual mentions an external printing command can be set on Windows and macOS. That's not actually the case on any platform, as a quick glance through preferences/musicviewers.py will confirm. (With the move to QtPdf, everything is now printed as a raster image.)

So the tooltip in Preferences>Music View>Resolution saying "Set the resolution if Frescobaldi prints using raster images" is not accurate? If everything is now printed as a raster image, we'd better say something like "Set the resolution for printing (as Frescobaldi prints the music as raster image)".
By the way, the PDF generated by LilyPond is not raster, right? So I'd rather print from a PDF viewer than from Frescobaldi.

The part of the manual about printing doesn't seem accurate anymore:

= Printing Music =

The printing command is used to print a PostScript or PDF file.
On Linux you don't need this, but on Windows and macOS you can
provide a command to avoid that PDF documents are being printed
using raster images, which is less optimal.

$pdf gets replaced with the PDF filename, or alternatively,
$ps is replaced with the PostScript filename.
$printer is replaced with the printer's name to use.

Uncheck the Use Frescobaldi's print dialog option when the
printing command opens a print dialog itself, in which you can
select e.g. the page range to print and the printer to use.
If you don't use Frescobaldi's print dialog, you don't need to put
the $printer variable in your command line.

If Frescobaldi must fall back to printing using raster images,
you can specify the number of dots per inch here.

I can't find the Use Frescobaldi's print dialog option in the code. Maybe it's been removed?
And I don't see where I could use that variables: $pdf, etc.

Here's what I see in the print dialog:

print dialog

@bmjcode
Copy link
Collaborator

bmjcode commented Apr 27, 2025

Also, the manual mentions an external printing command can be set on Windows and macOS. That's not actually the case on any platform, as a quick glance through preferences/musicviewers.py will confirm. (With the move to QtPdf, everything is now printed as a raster image.)

So the tooltip in Preferences>Music View>Resolution saying "Set the resolution if Frescobaldi prints using raster images" is not accurate? If everything is now printed as a raster image, we'd better say something like "Set the resolution for printing (as Frescobaldi prints the music as raster image)". By the way, the PDF generated by LilyPond is not raster, right?

PDF uses vectors, but both screens and printers are raster devices, so it has to be rendered to a raster image either way. In qpageview >= 1.0.0 that happens in qpageview.pdf.PdfRenderer.draw(). The same logic is used for both kinds of devices.

Poppler provided a so-called vector backend, but all that really did was offload rasterization to Poppler itself. Since printers operate at a fixed resolution the final output was still a raster image.

Note that QPrinter.setResolution() only "requests that the printer prints at dpi or as near to dpi as possible". So if that preference is set to 300dpi but your printer only supports 600dpi, the PDF will print at 600dpi. You might phrase that in the manual as "the closest resolution supported by your printer will be used" and "if unsure, leave this set to the default".

So I'd rather print from a PDF viewer than from Frescobaldi.

I agree. I only ever print from Frescobaldi to test that code since I seem to be maintaining it now. :)

The part of the manual about printing doesn't seem accurate anymore:

...snip...

I can't find the Use Frescobaldi's print dialog option in the code. Maybe it's been removed? And I don't see where I could use that variables: $pdf, etc.

It must have been removed some time ago. I don't recall ever seeing it on any platform.

@fedelibre
Copy link
Member Author

Thanks for the detailed explanation. I've added one more commit

Copy link
Collaborator

@bmjcode bmjcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@fedelibre fedelibre merged commit cfbd1b5 into master Apr 29, 2025
@fedelibre fedelibre deleted the pref-1414 branch April 29, 2025 08:54
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

Successfully merging this pull request may close these issues.

Organize/Structure Preferences window

3 participants