[metapost] mplib-beta-1.090 can not properly embed fonts into EPS files !?

Zhi-Wei Huang zwhuang at gmail.com
Sat Jul 19 08:32:00 CEST 2008

I download the cweb based version of MetaPost from


I regenerate the mem file, then put "mpost" and "mpost.mem" in the
proper places. So as to check the newly installed MetaPost program, I
compile a previous example file "example.mp". In this file,
"prologues:=3" is set, and there are several subfigs. Some of them
contain labels. Accidentally, I find that subfigs without labels can
be viewed successfully by "gv" or "evince", while subfigs with labels
only display white boxes. That is, no labels are shown at all.

By using "-troff" option of by setting "prologues:=1" ("prologues:=2"
works too), all subfigs can be shown successfully, except for
improperly font shape. At this time, I think this new version of
"mpost" has problem of embedding fonts into EPS files.

Then I use a very simple/short source file "aa.mp" to prove my opinion.

====== aa.mp ======
label(btex $a$ etex, (50,50));

Only one letter "a" (cmmi10) is involved here. The old version of
Metapost (1.005) can generate proper EPS file ("old.1"), while the new
version (1.090) generate improper EPS file ("new.1").

I use "diff" to help me to see the differences of such two EPS files
genereated by to versions of MetaPost, the the diffrences are shown

--- old.1	2008-07-19 14:07:28.829427289 +0800
+++ new.1	2008-07-19 14:07:43.124429671 +0800
@@ -1,7 +1,7 @@
 %!PS-Adobe-3.0 EPSF-3.0
 %%BoundingBox: 47 47 53 53
 %%HiResBoundingBox: 47.36694 47.85524 52.63304 52.14474
-%%Creator: MetaPost 1.005
+%%Creator: MetaPost 1.090
 %%CreationDate: 2008.07.19:1407
 %%Pages: 1
 %%DocumentResources: procset mpost-minimal
@@ -15,6 +15,7 @@
 /fcp{findfont dup length dict begin{1 index/FID ne{def}{pop
 /fmc{FontMatrix dup length array copy dup dup}bd/fmd{/FontMatrix exch def}bd
 /Amul{4 -1 roll exch mul 1000 div}bd/ExtendFont{fmc 0 get Amul 0 exch
put fmd}bd
+/ScaleFont{dup fmc 0 get Amul 0 exch put dup dup 3 get Amul 3 exch put fmd}bd
 /SlantFont{fmc 2 get dup 0 eq{pop 1}if Amul FontMatrix 0 get mul 2
exch put fmd}bd
 %%BeginResource: font ICXWUR-CMMI10
@@ -37,7 +38,7 @@
 /FontMatrix [0.001 0 0 0.001 0 0] readonly def
 /Encoding 256 array
 0 1 255 {1 index exch /.notdef put} for
-dup 97 /a put
+dup  /a put
 readonly def
 /FontBBox{-32 -250 1048 750}readonly def
 currentdict end
@@ -62,22 +63,21 @@

Apparently, there are four differences between two files, but the
first two are trival, the last two are major differences, one is

-dup 97 /a put
+dup  /a put

and another lies in the pfa font stream. The first one makes the font
outline can not be correctly selected from font stream, and the second
seems to show that the new version of MetaPost generate incorrect pfa
font stream? And then, these two lead to no labels are shown in figs.

By the way, the pfa font contents are embeded in EPS file and it is
easy to dig them out from

%!PS-AdobeFont-1.1: CMMI10 1.100
%%CreationDate: 1996 Jul 23 07:53:57
% Copyright (C) 1997 American Mathematical Society. All Rights Reserved.

The pfa font ("old.pfa") from "old.1" can be prpperly shown by
"fontforge", while the pfa font ("new.pfa") from "new.1" can not. This
also means the font info in "new.1" are not correct.

Best wishes,

More information about the metapost mailing list