Author Topic: PDF Export, subset all fonts settings  (Read 161 times)

Gibbz

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
  • Scribus User
PDF Export, subset all fonts settings
« 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?

Gibbz

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
  • Scribus User
Re: PDF Export, subset all fonts settings
« Reply #1 on: October 26, 2018, 06:58:19 am »
I found the answer, just supply all fonts on the system:

pdf.fonts = scribus.getFontNames()

Gibbz

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
  • Scribus User
Re: PDF Export, subset all fonts settings
« Reply #2 on: October 31, 2018, 02:22:01 am »
Ah it looks like this solution does not work.
Any other ideas?

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1620
  • Karma: 23
    • the graphics lab
Re: PDF Export, subset all fonts settings
« Reply #3 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.