Scribus Forums

Scribus => Scripts and Plugins => Topic started by: Gibbz on October 26, 2018, 06:46:28 am

Title: PDF Export, subset all fonts settings
Post by: Gibbz on October 26, 2018, 06:46:28 am
Hi,

Im looking at subsetting my fonts to reduce filesize. In the export dialog there is a "subset all" button.
But in the python scripter api:

fontEmbedding = <attribute 'fontEmbedding' of 'PDFfile' objects>
Choose the font embedding mode :
0 - Embed fonts fully or as subset depending on 'fonts' attribute
1 - Outline fonts: fonts will be converted to vector
2 - No embedding: no font will be embedded.

fonts = <attribute 'fonts' of 'PDFfile' objects>
List of fonts to embed.


Is it possible to specify "All" for the fonts option?
Or is there a way to easily get a list of all fonts used to supply this option with?
Title: Re: PDF Export, subset all fonts settings
Post by: Gibbz on October 26, 2018, 06:58:19 am
I found the answer, just supply all fonts on the system:

pdf.fonts = scribus.getFontNames()
Title: Re: PDF Export, subset all fonts settings
Post by: Gibbz on October 31, 2018, 02:22:01 am
Ah it looks like this solution does not work.
Any other ideas?
Title: Re: PDF Export, subset all fonts settings
Post by: a.l.e on October 31, 2018, 10:04:39 am
as far as i can tell, you have to change the value in the fonts settings.

if i look in the API under "Font commands" i can find a getXFontNames (what a terrible name!) but i cannot find a way to set the value.
it should not be hard to add a command for setting the subsetting for a single font...

as an alternatvie, in the pdf "section" you can find a font attribute that tells what is supposed to be embedded: if any of the fonts are not subset, you can warn the user (or create a log file) asking the user / operator to change the setting.