Discussion:
[tex-live] making XeTeX not embed fonts
Werner LEMBERG
2018-11-14 14:14:12 UTC
Permalink
Folks,


is there a simple option to make XeTeX (or rather xdvipdfmx) not embed
fonts in PDFs? I'm going to post-process the output, which will do
the embedding.


Werner
Shunsaku Hirata
2018-11-17 20:01:56 UTC
Permalink
Hi Werner,

I think there are no such an option to make xdvipdfmx not embed
all fonts.

Shunsaku Hirata
Post by Werner LEMBERG
Folks,
is there a simple option to make XeTeX (or rather xdvipdfmx) not embed
fonts in PDFs? I'm going to post-process the output, which will do
the embedding.
Werner
Werner LEMBERG
2018-11-26 05:41:18 UTC
Permalink
Post by Werner LEMBERG
is there a simple option to make XeTeX (or rather xdvipdfmx) not
embed fonts in PDFs? I'm going to post-process the output, which
will do the embedding.
I think there are no such an option to make xdvipdfmx not embed all
fonts.
Thanks. I'll dive into the code to look for more details. If
ghostscript is going to be used as a post-processor, such a feature
could be really beneficial.

BTW, who is responsible for xdvipdfmx coding today, and where should I
discuss related issues?


Werner
Karl Berry
2018-11-26 22:06:19 UTC
Permalink
ghostscript is going to be used as a post-processor, such a feature
could be really beneficial.

FWIW, here is a post describing how to unembed fonts (I haven't tried
it myself):
https://tex.stackexchange.com/questions/89864

So perhaps you could let (x)dvipdfmx do its thing, then unembed and do
whatever you want after that.

BTW, who is responsible

Primarily Shunsaku :). Also Akira.

for xdvipdfmx coding today,

FYI, xdvipdfmx and dvipdfmx have been the same program for some years
now, thanks primarily to Khaled. There is only one source directory.

and where should I discuss related issues?

There is no mailing list specifically for dvipdfmx (or most other
drivers). Maybe we can use tex-k. --happy fonthacking, karl.
Akira Kakuto
2018-11-27 05:07:07 UTC
Permalink
Dear Werner, Karl,
Post by Karl Berry
FWIW, here is a post describing how to unembed fonts (I haven't tried
https://tex.stackexchange.com/questions/89864
The method works fine.
An attached removefonts.zip contains
xtst.pdf:
Created by xelatex xtst.tex
xtst.ps:
Created by extractpdfmark xtst.pdf >xtst.ps
noembed.txt:
Created by pdffonts xtst.pdf >noembed.txt
noembed.ps:
Created by editing noembed.txt
final.pdf:
Created by a script mk.sh:

#!/bin/sh
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
-sOutputFile=final.pdf -c -f noembed.ps xtst.pdf xtst.ps

In final.pdf all embedded fonts in xtst.pdf are removed.

Best,
Akira
Werner LEMBERG
2018-11-27 14:34:35 UTC
Permalink
Post by Akira Kakuto
Post by Karl Berry
FWIW, here is a post describing how to unembed fonts (I haven't tried
https://tex.stackexchange.com/questions/89864
The method works fine.
Well...
Post by Akira Kakuto
An attached removefonts.zip contains
Created by xelatex xtst.tex
Created by extractpdfmark xtst.pdf >xtst.ps
Created by pdffonts xtst.pdf >noembed.txt
Created by editing noembed.txt
#!/bin/sh
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
-sOutputFile=final.pdf -c -f noembed.ps xtst.pdf xtst.ps
In final.pdf all embedded fonts in xtst.pdf are removed.
... this is very nice! Alas, it doesn't work properly if you mix
XeTeX with LilyPond.


Werner
Akira Kakuto
2018-11-29 09:45:27 UTC
Permalink
Dear Werner, Karl,
Post by Akira Kakuto
In final.pdf all embedded fonts in xtst.pdf are removed.
I copied open type fonts into Resource/CIDFont of Ghostscript:
KozGoPr6N-Bold,
KozGoPr6N-Medium,
KozMinPr6N-Regular,
SourceHanSans-Heavy.

Note that I removed the suffix .otf from the filenames.

I could embed fonts again into the final.pdf by a command
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite \
-sOutputFile=xtst2.pdf final.pdf xtst.ps.

(Actually gs is gswin32c since I'm on Windows.)

pfffonts xtst2.pdf
showed

name type encoding
emb sub uni object ID
------------------------------------ -----------------
---------------- --- --- --- ---------
QJJKMJ+KozGoPr6N-Medium CID Type 0C Identity-H
yes yes no 23 0
QQKGCN+KozMinPr6N-Regular CID Type 0C Identity-H
yes yes no 19 0
HOTETC+KozGoPr6N-Bold CID Type 0C Identity-H
yes yes no 15 0
SEWZDA+SourceHanSans-Heavy CID Type 0C Identity-H
yes yes yes 11 0

The fonts are subsetted, but
(size of xtst2.pdf) / (size of xtst.pdf) = 7.26.

It seems that the subsetting of open type fonts
in (x)dvipdfmx is much better than in Ghostscript.

Best,
Akira

Loading...