fonts are not embedded in the PDF on Mac, leading to much larger files

• Jun 11, 2015 - 17:33
Reported version
S4 - Minor

Not sure if this qualifies as a bug report, feature request, or just query. But -- somewhere between MuseScore 1.3 and 2.0 the file size of exported pdf files hugely expanded. A score that might have exported to a 100KB pdf file now will run in the neighborhood of 1 MB (or more). I think this happened at some time during the MuseScore 2 development process, as I think betas from early 2014 still produced small pdf's. I haven't noticed any change in the quality of the resulting pdf's, so it's not just that the dpi of the image has increased. Is MuseScore now exporting in gray-scale or color rather than black-and white? If this is a "feature", can there be an option to turn it off? Particularly when emailing drafts to collaborators it is much better to have smaller pdf's.


Esp. when unsure whether bug report, feature request, or just query it is better to open forum topic first...
Which version of MuseScore are you using currently and on what OS?
My PDFs are still all pretty small, some double digit KB, a few with triple digit KB, one with almost 3MB (but that does have 542 pages)

Thanks for the guidance about where to post. The OS is Mac Mavericks 10.9.x, and I'm pretty sure that's been the case since before the file size change. I am presently running a MuseScore nightly from about a week ago, but the file sizes have been large in nightlies going back to some time last summer. My recollection is that nightlies from spring 2014 were still producing small pdf's.

Status (old) needs info active

Good idea. Here is the example that brought the issue to back to my attention today. Attached are two musescore files, one made 2+ years ago with Musescore 1.2, and one made today by "saving as" in my one-week-old nightly; and the corresponding pdf files. You can tell which from the file name (whether it has 12 or 21 in the file name). The pdf file sizes for 1.2 and 2.1 are respectively 76 KB and 328 KB. In this case the small one was made on an older OS (Mac 10.6.8).

I notice there is also quite a difference in size of the .mscz files, but I guess that is OK as MuseScore 2 stores a much richer set of information.

I had hoped to find an example made with an early musescore 2 beta to illustrate the change, but at some point I went through and updated all such files that I could identify to a later beta (as I had had some issues with files created with one beta not being openable by a later one, and also some issues with text and ornaments moving between beta versions). I first noticed the pdf file size change (but did not report) while doing those updates.

OK, I opened Priidit'e_MuseScore21.mscz in 2.0.1 and exported as PDF -> 48kB, not 320kb...
And in the latest build this is not any different.

But I can confirm that opening the 1.2 mscz and saving in 2.0 makes it is large as your 2.1 mscz file

Windows 7 (Enterprise, 64bit)

Attachment Size
Priidit'e_MuseScore21.pdf 47.22 KB

The nightly I used to create the one I uploaded was from May 28. I just tried again with the latest nightly (rev 24f1af0) and I get the same file size. This is using the "export" menu in MuseScore. If instead I use "print" and then "save as pdf" it is even (slightly) larger, 332 KB vs 328. I would guess the latter uses Mac OSX's pdf generator.

Glad to see a better and more descriptive title to this thread. What determines the likelihood of this problem getting addressed?

For what it is worth I went back and tried to save a file (on mac) with musescore 1.3 and it was larger than with 2.02 nightly. So I guess my recollection was wrong and the file size suddenly becoming much larger must have been a coincidence with my going from Mac OS 10.6.8 to 10.9.x (which I did in order to keep using musescore nightlies after 10.6 support was dropped). So is there something about more recent Mac OS's that causes embedding of fonts to fail?

UPDATE -- rather interesting. I started from one musicXML file; imported into musescore 1.3, saved as pdf, got an 809 KB file. I imported into MuseScore 2.02 nightly, exported to pdf, got a 686 KB file. If from MuseScore nightly I choose print, then save as pdf, I get a 659 KB file. But get this: if I choose print, open print in Preview, and from Preview choose Export as PDF (or Export, then pick pdf format) I get a 92 KB file !! Text appears with identical clarity; things that are apparently being drawn (notes, ornaments) appear at slightly lower resolution when the pdf is blown up to maximum magnification, but not noticeable at normal or modest magnification on the screen or when printed on a laser printer.

Good news about this bug.
With Qt5.5.0 the fonts are exported as embedded TrueType fonts, similarly to what is done under Linux and Windows (see #33701: PDF export should embed OTF fonts for the implicit conversion).
Tested under Mac OS X 10.8.5, Qt5.5.0, commit 7f58e9fa2c9

- when using Qt5.5.0 for the compilation, the Qt "frameworks" folders where not added to the executables (genmanual, MuseScore), thus requiring DYLD_FALLBACK_LIBRARY_PATH to be defined;
- with Qt5.5.0 under Mac I saw the bug #71001: 'loading' window at startup does not close if using Qt library version == 5.5.0 (which current arch linux release uses).

Would this fix be contained in the latest nightlies for Mac OS X? I downloaded tonight the most recent (MuseScoreNightly-2015-08-11-2003-c2b3bb9.dmg) and I continue to find that files saved using either MuseScore's "export to PDF", or "Print", then "save as PDF". I base my statement on comparing the size of a pdf obtained this way vs. one opened to Mac Preview, then either exported or "Save as"'ed. The files saved directly from MuseScore or saved via "Print/Save as PDF" are approximately the same size as each other, and both are nearly six times bigger than the files save by first opening the pdf in preview then saving. I attach two samples, "Export.pdf", saved via MuseScore's "Export to PDF" menu, and "Preview_export.pdf", saved via going to "print" then "open in Preview then doing "export to PDF" from Preview. Compare the sizes!

Attachment Size
Export.pdf 232.72 KB
Preview_Export.pdf 41.6 KB

The issue is still active, which means it is not fixed in any version out there...
It sees this issue would be fix if and when we switch to using Qt-5.5 rather than 5.4

I just tried the trick with going through preview with the four movements of the cello part of string quartet and the results are convincing:

mvt. 1 (4p. + simple title page): File size direct export: 830kB. File size via Preview: 22kB
mvt. 2 (4p.): File size direct export: 769kB. File size via Preview: 50kB
mvt. 3 (2p.): File size direct export: 432kB. File size via Preview: 43kB
mvt. 4 (4p.): File size direct export: 644kB. File size via Preview: 39kB

Total: File size direct export: 2,675MB. File size via Preview: 154kB

All four movements look fine when watched at 200% size and will print perfectly well. Interestingly the new file sizes are not at all proportional to the size of the movements, especially the first movement comes out very small indeed.

To be clear here the procedure step by step:

1. Print (from menu or command P)
2. Open menu on bottom left corner of print window
3. Choose "open Pdf in Preview"
4. Preview will open and show the file.
5. In Preview open the "file" menu and pick "export as Pdf".
6. Choose file name and folder and save.

Kudos to Ron Cohen who figured this out!