Dear font experts! For some weeks I try very hard to generate minimal PDF documents using the PDF base 14 fonts. Now the following problem popped up: The Helvitica, Times, and Courier fonts have "8a" as their default encoding. Unfortunately, the 8a encoding is somewhat incomplete because it misses some characters (eg. the degree character). In TeX I use texnansi encoding because it offers most of the special characters that I need. If I use 8a encoding for the PDF document (in order to avoid reencoding) then the degree symbol is typeset by an embedded "txsy" font. The bad thing about this solution is that this degree character does not take care of \bf, \it, or \bi. Therefore the result is unsatisfactory. If I use texnansi encoding for the PDF document then the degree symbol is typeset nicely. The disadvantage of this option is that now the built-in fonts are always reencoding which make some additional 2kb for the PDF document. I would like to have the reeconded font to be used only if it is really necessary. Now I see two problems: 1. A particual problem in this situation Is it possible to define font synonymes locally (i.e. inside a group)? In that case I could map the virtual fonts that are base on 8a encoded raw fonts into virtual fonts that are based on texnansi reencoded raw fonts. I tried that but it seems that font synonymes are accepted only at the beginning. 2. A general problem Provided that I write a set of typescripts for defining a typeface similar to the postscript typefaces of ConTeXt but based on other (virtual) fonts: is it possible to switch between these two typefaces. The switch must respect the current font characteristics (i.e. \ss, \rm, \tt, \bf, \it, \bi, and size). Thanks for your attention, --Stefan
Stefan Wachter wrote:
1. A particual problem in this situation
Is it possible to define font synonymes locally (i.e. inside a group)? In that case I could map the virtual fonts that are base on 8a encoded raw fonts into virtual fonts that are based on texnansi reencoded raw fonts.
I tried that but it seems that font synonymes are accepted only at the beginning.
not true; what you observe is that font defs are frozen; an option is to define multiple typeface collections, since these store information; so, \definetypeface[timesa][rm][serif][times][default[encoding=texnansi] \definetypeface[timesb][rm][serif][times][default[encoding=ec] now you can use both intermixed
The switch must respect the current font characteristics (i.e. \ss, \rm, \tt, \bf, \it, \bi, and size).
\timesa \bf test \pushcurrentfont \timesb \popcurrentfont test alternatively you can define symbols for those special chars, see symb-*.tex; \getglyph is also an option; this one follows the style Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi Hans, thanks for the information. I changed my test document accordingly and deleted obsolete parts from the typescript. When I use the "builtInPostscript" or the "reencodedPostscript" as the sole body font then the document is typeset correctly. Yet, if I try to switch the family for example to the reencodedPostscript then the text that follows after the switch does not appear in the created PDF document. Do you have an idea? --Stefan \enableregime[il1] \setupencoding[default=texnansi] \setupoutput[pdftex] \pdfoptionpdfminorversion 4 \usetypescriptfile[smallpdf.tex] \definetypeface [builtInPostscript] [rm] [serif] [times] [default] [encoding=ec] \definetypeface [builtInPostscript] [ss] [sans] [helvetica] [default] [encoding=ec] \definetypeface [builtInPostscript] [tt] [mono] [courier] [default] [encoding=ec] %\definetypeface [builtInPostscript] [mm] [math] [times] [default] \usetypescript[reencode][texnansi][texnansi] \definetypeface [reencodedPostscript] [rm] [serif] [times] [default] [encoding=texnansi] \definetypeface [reencodedPostscript] [ss] [sans] [helvetica] [default] [encoding=texnansi] \definetypeface [reencodedPostscript] [tt] [mono] [courier] [default] [encoding=texnansi] %\definetypeface [reencodedPostscript] [mm] [math] [times] [default] \setupbodyfont[builtInPostscript,sans,15pt] \mainlanguage[de] \setupheadertexts[] \def\Show{This is a test. 45\char176 \quotedblbase äöüßÄÖÜ\quotedblleft} \def\ShowVariants{\Show\par{\bf\Show}\par{\it\Show}\par{\bi\Show}\par} \starttext\pdfmapfile{+smallpdf.map} {\ss Helvetica\par\ShowVariants} {\rm Times-Roman\par\ShowVariants} {\tt Courier\par\ShowVariants} \reencodedPostscript {\ss Helvetica\par\ShowVariants} {\rm Times-Roman\par\ShowVariants} {\tt Courier\par\ShowVariants} \stoptext
Stefan Wachter wrote:
When I use the "builtInPostscript" or the "reencodedPostscript" as the sole body font then the document is typeset correctly. Yet, if I try to switch the family for example to the reencodedPostscript then the text that follows after the switch does not appear in the created PDF document.
Do you have an idea?
hard to test without those tfm files (i don't want to clobber my system by
generating them; also, i never use the p* variants)
looking at your map file:
there are no pfb files mentioned ... why?
raw-phvr8a Helvetica
raw-phvb8a Helvetica-Bold
raw-phvbo8a Helvetica-BoldOblique
raw-phvro8a Helvetica-Oblique
raw-ptmr8a Times-Roman
raw-ptmb8a Times-Bold
raw-ptmbi8a Times-BoldItalic
raw-ptmri8a Times-Italic
raw-pcrr8a Courier
raw-pcrb8a Courier-Bold
raw-pcrbo8a Courier-BoldOblique
raw-pcrro8a Courier-Oblique
raw-psyr Symbol
raw-pzdr ZapfDingbats
texnansi-raw-phvb8a Helvetica-Bold " TeXnANSIEncoding ReEncodeFont "
hard to test without those tfm files (i don't want to clobber my system by generating them; also, i never use the p* variants)
I created the vf and tfm files with the attached script. Maybe you can setup a local directory? Creating these fonts simply needs the following calls (the files are generated in the current directory!): fonts.sh <path-to-afm-dir> adobe helvetic ec fonts.sh <path-to-afm-dir> adobe times ec fonts.sh <path-to-afm-dir> adobe courier ec fonts.sh <path-to-afm-dir> adobe helvetic texnansi texnansi fonts.sh <path-to-afm-dir> adobe times texnansi texnansi fonts.sh <path-to-afm-dir> adobe courier texnansi texnansi The first three calls generate virtual fonts that are base on raw fonts with default encoding and the last three calls generate virtual fonts that are based on texnansi reencoded raw fonts. (After studying texfont I think that generating fonts based on the default encoding of raw fonts is not possible with texfont.) I think the generate vf and tfm files are correct because they can be used without problems as long as no family switching occurs. Is there a specific reason why the p* variants should not be used? I hoped that they are very similar to what is present in the different Acrobat Reader versions.
looking at your map file:
there are no pfb files mentioned ... why?
I want to use the built in fonts because the size of the PDF documents must be as small as possible. --Stefan
participants (2)
-
Hans Hagen
-
Stefan Wachter