[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


Hi,
I download the cweb based version of MetaPost from

    http://foundry.supelec.fr/frs/download.php/663/mplib-beta-1.090-linux2.6-i386.tar.bz2

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 ======
prologues:=3;
beginfig(1);
label(btex $a$ etex, (50,50));
endfig;
bye.
===================

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
below:

========================================================
--- 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
pop}ifelse}forall}bd
 /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
 %%EndResource
 %%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 @@
 74109050FBA2602E72593FBCBFC26E726EE4AEF97B7632BC4F5F353B5C67FED2
 3EA752A4A57B8F7FEFF1D7341D895F0A3A0BE1D8E3391970457A967EFF84F6D8
 47750B1145B8CC5BD96EE7AA99DDC9E06939E383BDA41175233D58AD263EBF19
-AFC0E2F840512D321166547B306C592B8A01E1FA2564B9A26DAC14256414E4C8
-42616728D918C74D13C349F4186EC7B9708B86467425A6FDB3A396562F7EE4D8
-40B43621744CF8A23A6E532649B66C2A0002DD04F8F39618E4F572819DD34837
-B5A08E643FDCA1505AF6A1FA3DDFD1FA758013CAED8ACDDBBB334D664DFF5B53
-9560176676ABB71BBD0EE56B4CC492C0652750227CEC7DB153AAF50E53CABC8E
-0E0F1774878C54465B194A131B7E152A65174AD35DE8CB2780C167FB33E30054
-E3F31A4700223D9AC00E1831DE3B962198C9AC3A9E53543B1416EBA24187F6F4
-D676C85D599002BA70151A704BEC1355A25FA8D1931D58505826EB93DE6877FF
-3A0F8695C51734BFF89702D69799BAB03BF594B7BA0F9F27DC323101650E722F
-29ECF35198E82ECEC805AC7A2E5D829EF14CCBEB562B13861EEE789AF8570557
-42C9B1E71CAE81403590E190428163BEF0FD3FECD272E06D7AE799B10B64A632
-5ABDB7048B00AECC013401C7E17187C83FC5D6E075F6E040F985BE9C75814F48
-73F03DA144665FC1D4AD81808400CA165B689AFBBC25AB8178D56F36CB0DCC72
-F8FA27D311E8041E7E81C688411363E1EE4772222811AB62D4686C7727B021E2
-1FEA2217BB9C48D7CCD253B1D3EC3CA74635B2510F5798821A0A94D01F03DC81
-FD07FFDD90A1CE
+AFD4837D0703219B0515992454A0488BD843AB130BEED730D449FF4B597B98BC
+D550106FF1EC54032A52A53D46A14C63EE14A8048100832779BDFDFB3E4893D3
+28500A3BED4D45D821FA1035BA8FBA57162992D8441334B5B87A07C16CF564FA
+B871DDAC1248B5E6C189D0EC2B24D1187EBDAA347506A4AE8CEA9CCC1F5BEA11
+88047D7DA893B765B7BE98F4EACD111CA5942CF341AD0DEA0808B9951FA5B990
+50D23A60CE16BDD02C77B4BF20053E29467F02927ED0817F03F6194F41518E05
+003C3836F1C8C193EEAFE853EFFDA47DC130DD9ECE383DFB2416B0727B5420F4
+DA9E48D4C788A602C982DE06E47E299D91FE3E4B8F03B7A5A61A526A53C6BFBA
+058376D00AC78C736780924B6F96374E758B61CDD06C17D482193BFFC5F77ECF
+201D770432FD3E97FD2C9348A1C3117C70F2B449FC53658FD0F29D0D93F7F9F9
+F42927587B99105E5E04B4700346FC7F7D7A530D4F910A48A8C9EDFB144DEA7D
+15A449ACCC59B69460CA00F826D70D85B57DEEFD42FE172B50DD7C1C8EBA2681
+C4DD7FF68102FD512D17A1DC8E649089F61DC35270B320D5A39B2C0D43C7F22D
+BCD8C9FEC6F88A5EA8EB9B03A009A068E9B6A272C3456FEAB2A054EE6EB4680A
+1C980750EF866D218DFA7ACF1D1E3EFF7B3F8E408B0580
 0000000000000000000000000000000000000000000000000000000000000000
 0000000000000000000000000000000000000000000000000000000000000000
 0000000000000000000000000000000000000000000000000000000000000000
========================================================

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.
.........
cleartomark
========================================================

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,
H


More information about the metapost mailing list