Fonts & Character SetsFixing characters with width 0 for PDF/A

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
morris
Posts: 2
Joined: Sat Oct 17, 2009 6:58 pm

Fixing characters with width 0 for PDF/A

Post by morris »

Hello everybody,
I have the following problem: My document which I create with pdflatex has to be PDF/A compliant. PDF/A is a subset of PDF 1.4 designed for long term archiving. As far as I know there is no official validator for PDF/A compliance, I use Adobe Acrobat.

pdflatex by itself does not produce PDF/A compliant files. I am using the pdfx package to solve some the issues. One of the remaining problems now is that Acrobat complains about characters with a width of 0 which are apparently prohibited by the PDF/A standard. In my case, the characters are within the fonts CMSY8 and CMSY10.

I have found this tutorial which addresses the problem:
http://support.river-valley.com/wiki/in ... rom_pdftex
The authors suggest the following procedure (numbers added by me):
----------
Usually we fix the problem by these steps:
1. convert original tfm to pl by tftopl
2. fix chars with zero width in pl (0.0 -> 0.001)
3. converted pl back to tfm by pltotf
4. convert original pfb to txt by t1disasm
5. check chars with zero width in *.txt (0 hsbw -> 1 hsbw)
6. converted txt back to pfb by t1asm
7. for each original pl, create a vpl which simply maps each char to itself
convert vpl to vf/tfm
Example: let's have mtsy.tfm and mtsy.pfb where a few characters have zero widths. Applying the above steps, we get:
mtsy2.tfm = original mtsy.tfm, except that chars with zero widths are replaced by 0.001
mtsy2.pfb = mtsy.pfb, except that chars with zero widths (0 hsbw) are replaced by 1 hsbw
mtsy.vf: map each char to the same char in mtsy2
mtsy.tfm: identical to original mtsy.tfm
The reason of using virtual fonts is that we don't want to make any change to mtsy.tfm, so that our workaround doesn't change the layout at all. TeX still sees the same font.
---------------

I have followed their guideline until step 6. Now, I am stuck. First, I do not know how to create the vpl and vf/tfm files. I also have not found the documentation or a tutorial which addresses this. Second, I do not know how to proceed afterwards. Where do I have to put my files and how do I have to modify my latex files in order to use the new fonts? Can anyone of you put me onto the right track?

Thanks a lot for your help
Morris

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

morris
Posts: 2
Joined: Sat Oct 17, 2009 6:58 pm

Re: Fixing characters with width 0 for PDF/A

Post by morris »

Hello everybody,
ok, I'm a bit further now. First, I can solve the problem in a dirty way: I have created files cmsy8fixed.pfb and cmsy8fixed.tfm (same for CMSY10) according to steps 1 to 6 of the tutorial. If I now save them as cmsy8.pfb and cmsy8.tfm in the directory of my latex files then these files are used instead of the system font files, and I get a PDF/A-1b compliant file (for those who are interested: PDF/A-1a which is a harder superset of PDF/A-1b is out of reach for me, because pdflatex does not create tagged PDFs and I will not fix that).

However, I would still like to understand how it is done properly because if I understand the tutorial guys correctly then by using the virtual font the original tfm file will be used and the output will be exactly the same as before.

Ok, here is what I have tried:
1) I have created a virtual font cmsy8.vf/csmy8.tfm (same for 10, but I keep writing about 8) according to this tutorial: http://www.tug.org/TUGboat/Articles/tb2 ... chmitz.pdf
The virtual font maps all characters of cmsy8 to the corresponding one in cmsy8fixed.

2) If I now put cmsy8.vf into the current directory and call pdflatex, pdftex does not find cmsy8fixed. This is expected, of course, but it shows, that it indeed sees my virtual font.

3) If I copy cmsy8fixed.pfb and cmsy8fixed.tfm also into the current directory, I get:
mktexpk: don't know how to create bitmap font for cmsy8fixed.
I have looked at quite some font documentation now, but I certainly have not understood everything. What I got is that I need some sort of mapping file. My system one seems to be located in /usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map. In there, I find the line
cmsy8 CMSY8 <cmsy8.pfb
which I kind of understand with the help of http://sarovar.org/docman/view.php/106/ ... -a.pdf.pdf

4) The documentation also says that this mapping file is also looked for in the current directory. So my first idea is to put a file pdftex.map into my current directory with a minimal line
cmsy8fixed <cmsy8fixed.pfb
However, pdftex breaks very early with
! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.
In fact, it even does that with an empty pdftex.map. So apparently, it does not add the stuff from different mapping files.

5) So, as a positive control, I just copy the system pdftex.map to the current directory and expect to get back to step 3). However, it now breaks with a different message:
!pdfTeX error: pdflatex (file cm-super-ts1.enc): cannot open encoding file for reading
This is a font, I have never messed with?!

Here my half knowledge leaves me again. I have no idea what I should do. If one of you has, please let me know.

Thanks again for your help
Morris
Post Reply