summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/README
blob: 28e4d71a4a144fe4358ff891609613af81a37530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
dvipdfmx and xdvipdfmx for TeX Live
===================================

This package is released under the GNU GPL, version 2, or (at your
option) any later version.

dvipdfmx is now maintained as part of TeX Live.

Mailing list for bug reports and all discussion:
https://lists.tug.org/dvipdfmx; anyone can join the list, but it is not
necessary to join to post. Archives are public.

xdvipdfmx
=========
xdvipdfmx is an extended version of dvipdfmx, and is now incorporated in
the same sources.

The extensions provided by xdvipdfmx provide support for the Extended DVI
(.xdv) format used by xetex, including support for platform-native fonts
and the xetex graphics primitives, as well as Unicode/OpenType text.

Like its direct ancestor dvipdfmx, this is free software and may be
redistributed under the terms of the GNU General Public License,
version 2 or (at your option) any later version.

Jonathan Kew mentions that in the past, XeTeX used a Mac-specific
program xdv2pdf as the backend instead of xdvipdfmx.  xdv2pdf supported
a couple of special effects that are not yet available through
xdvipdfmx: the Quartz graphics-based shadow support, AAT "variation"
fonts like Skia, transparency as an attribute of font color, maybe other
things.  It would be nice for those things to continue to be supported,
if anyone is looking for some nontrivial but not-impossible job and
happens across this file.

Contents
--------
1. Introduction

2. Installation

  2.1. Compiling and Installation
 
  2.2. TeX Directory Structure (TDS)

  2.3. Auxiliary Files

3. CJK Support

  3.1. Quick Test of Installation

  3.2. CJK-LaTeX and HLaTeX

  3.3. Omega and Other Extended TeX  

  3.4. Vertical Typesetting
    
4. Unicode Support

  4.1. Unicode Support in General

  4.2. ToUnicode CMap Support

  4.3. OpenType Support and Unicode

  4.4. Type1 Font Support and Unicode
    
5. Graphics and Image Format

  5.1. Supported Graphics File Format

  5.2. Graphics Extension

  5.3. Using External Programs for Format Conversion

6. DVI Specials

  6.1. Compatibility

  6.2. Additions to Dvipdfm's pdf: Special

7. Font Mapping

8. Incompatible Changes From Dvipdfm

9. Other Improvement Over Dvipdfm

10. Font Licensing and Embedding



1. Introduction
   ------------

   The dvipdfmx (formerly dvipdfm-cjk) project provides an eXtended version
   of the dvipdfm, a DVI to PDF translator developed by Mark A. Wicks.

   The primary goal of this project is to support multi-byte character
   encodings and large character sets for East Asian languages. The secondary
   goal is to support as many features as pdfTeX developed by Han The Thanh.

   This project is a combined work of the dvipdfm-jpn project by Shunsaku
   Hirata and its modified one, dvipdfm-kor, by Jin-Hwan Cho.


2. Installation
   -----------------------

   Typical usage and installation steps are not different from the original dvipdfm.
   Please refer documents from dvipdfm distribution for detailed instruction on how
   to install and how to use dvipdfm.


2.1. Compiling and Installation


   If you have obtained older version, please use latest version unless you have a
   clear reason to choose older versions. The latest snapshot of dvipdfmx source is
   available at:

     http://project.ktug.or.kr/dvipdfmx/snapshot/

   And the CVS repository for this project can be obtained through anonymous CVS
   access with the following command:

     cvs -d:pserver:anonymous@cvs.ktug.or.kr:/home/cvsroot login
     cvs -d:pserver:anonymous@cvs.ktug.or.kr:/home/cvsroot co dvipdfmx

   When prompted for a password, simply press the Enter key.

 
   The kpathsea library is required to compile and install dvipdfmx in UNIX or
   UNIX-like platforms. It is usually included for most of TeX distributions.
   If you already have installed dvipdfm (the original) by yourself, you should
   already have kpathsea library and it's headers. And zlib library is highly
   recommended as dvipdfmx can't compress data without this.
 

   Before starting things, you must check the location of your TeX installation.
   If other TeX related programs are installed under, e.g., '/usr/local/TeX/bin',
   you should specify directory '/usr/local/TeX' as an for ./configure script as
 
     ./configure --prefix=/usr/local/TeX --with-kpathsea=/usr/local/TeX

   If you are using libpaper to handle paper sizes for various program, you can
   use --with-paper option to ./configure. The location of libpaper library can
   be specified with this option as

     --with-paper=DIR

   Please note thath dvipdfmx uses JIS paper size for B-series paper instead of
   ISO's one for historical reason. (too late to change the default behavior)
   The most easiest way to fix this is to use libpaper if you already have that,
   otherwise define ISO_PAPERSIZE macro at compilation time. 

   Dvipdfmx requires libpng library available from
   
     http://www.libpng.org/pub/png/libpng.html
   
   to read PNG format images. To tell dvipdfmx the location of libpng header
   and library, use configure option
   
     --with-png=DIR

   After you have finished ./configure, just type

     make && make install

   then dvipdfmx will be installed under the directory specified by the --prefix
   option to ./configure script. After you have successfully installed dvipdfmx,
   you may need to install various auxiliary files and slightly adjust location
   of files or configuration. Amount of additional files and modification depends
   on your environment, and briefly described in the sections follows.


2.2. TeX Directory Structure (TDS)


   If your TeX installation is conforming with TDS version 1.1 described in

     http://www.tug.org/ftp/tex/tds-1.1/

   , then you'll need to adjust your dvipdfmx installtion. This also applies when
   you have updated programs without modifying existing platform independent files
   (files in texmf directory). Dvipdfmx installs few files in addition to dvipdfmx
   program itself, dvipdfmx.cnf, cid-x.map and others, but it currently does not
   choose installation directory as appropriate for TDS 1.1.

   If your 'kpsewhich' program recognizes '.sfd' file format, i.e.,

     kpsewhich --show-path --format=.sfd  

   does not answer as 'unknown format', then you should move several files under
   appropriate locations or should modify texmf.cnf as follows:

     * Subfont Definition (SFD) Files
 
       Recommended location of SFD files (.sfd) is

         $TEXMF/fonts/sfd/

       and environmental variable for specifying additional search path for this
       file format files is

         SFDFONTS

       . To make those files visible to dvipdfmx under TDS 1.1 installation, you
       must move all .sfd files to the directory mentioned above or set SFDFONTS
       variable in texmf.cnf. As some programs may not be updated to follow this
       convention yet, it is recommended to preserve old installation directory.
       If you have .sfd files under "$TEXMF/dvipdfm/", please do not use that,
       please move all files to the directory mentioned above.

    * PostScript CMap Resources

      Recommended location of CMap files (no suffix or with suffix .cmap) is

        $TEXMF/fonts/cmap/

      and environmental variable for adding extra search path for this format files
      is

        CMAPFONTS

      You may want to set CMAPFONTS to include GhostScript's Resource path, e.g.,

         /usr/share/ghostscript/Resource/CMap//

      in your texmf.cnf file as this resource can be used by various programs that
      manipulates PS/PDF files. Dvipdfmx installs few additional files into the
      directory "$TEXMF/dvipdfm/CMap", please move this files to the directory for
      CMap files. But please note that file "Adobe-Identity-UCS2" is not meaningful
      to other programs at all, so you should place at least this file in different
      location than CMap files. (Or you can just remove this unless you see problems
      in copy-and-pasting text from dvipdfmx output PDF.) 

    * Font Mapping Files

      Suggested place for dvipdfm's font mapping files (.map) is

        $TEXMF/fonts/map/dvipdfm/
      
      and environmental variable for this format files is

        TEXFONTMAPS

      For files containing dvipdfmx extension to dvipdfm format, place them into

        $TEXMF/fonts/map/dvipdfmx/

      instead of sub-directory 'dvipdfm'.

    * OpenType Fonts

      Appropriate place for OpenType font with PostScript outline (.otf) is
  
         $TEXMF/fonts/opentype/supplier/typeface/

      where 'supplier' and 'typeface' should be replaced with font's supplier and
      typeface identifier strings.

 
2.3. Auxiliary Files


 1) CMap PostScript Resources

   Dvipdfmx internally identifies glyphs in a font with identifier represented
   as numbers ranging from 0 to 65535. CMap PostScript Resources defines how the
   input character codes are translated to those ID's (CID). CID's should be
   uniquely assigned to every glyphs contained in a collection of glyphs. Adobe
   has defined several "character collection"s; Adobe-GB1 (Simplified Chinese),
   Adobe-CNS1 (Traditional Chinese), Adobe-Japan1 (Japanese), and Adobe-Korea1
   (Korean), which contains much of glyphs necessary for publishing for each
   languages. Details on Adobe's character collections can be found at Adobe's
   developer site:

     http://partners.adobe.com/public/developer/font/index.html

   Please install CMap resource files under the directory

     ${TEXMF}/fonts/cmap

   , or set CMAPFONTS variable to point the directory containing CMap resource
   in texmf.cnf. If your TeX installation does not conforming TDS 1.1, then you
   should set CMAPINPUTS variable to make those files visible to dvipdfmx. For
   examples,

     CMAPINPUTS= .;$TEXMF/fonts/cmap//     

   Adobe's "CMaps for PDF 1.4 CJK Fonts" are available from:
 
     http://partners.adobe.com/public/developer/acrobat/index_advanced.html

   or

     ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/

   You can find a short explanation of each CMap files in cid2code.txt contained
   in the archive files found at the above FTP site.

 
 2) SubFont Definition Files

   .....

  
 3) Adobe Glyph List and ToUnicode Mapping Files

   The Adobe glyph list (AGL) file describes correspondence between PostScript
   glyph names (e.g., AE, Aacute, ...) and it's Unicode character sequences.
   Most features described in the section "Unicode Support" requires this file.

   Dvipdfmx looks for file "glyphlist.txt" when conversion from PostScript glyph
   names to Unicode is necessary. This conversion is done in various situations;
   when creating ToUnicode CMap for 8bit encoded fonts, finding glyph description
   from TrueType/OpenType fonts supporting Unicode when the font itself does not
   provide the mapping from PostScript glyph names to glyph indices (version 2.0
   "post" table), and when encoding "unicode" is specified for Type 1 font.

   The "glyphlist.txt" file written by Adobe is found at

     http://partners.adobe.com/asn/tech/type/glyphlist.txt

   You should place file "glyphlist.txt" in a directory shown by

     kpsewhich --progname=dvipdfm --show-path="other text files"

   Please check kpathsea library can find this file by 'kpsewhich' command:

     kpsewhich --progname=dvipdfm --format="other text files" glyphlist.txt

   The 'progname' is not dvipdfmx but dvipdfm here.

   ToUnicode mapping is similar to glyph list file but describes correspondence
   between CID numbers and Unicode values. The content of this file look like a
   CMap files and is contained in "CMaps for PDF 1.4 CJK Fonts" from Adobe (see
   "CMap PostScript Resources" above). This file is required to support TrueType
   font (including OpenType fonts with TrueType outline). Those files should be
   installed same directory as ordinary CMap files.


3. CJK Support

3.1. Quick Test of Installation

3.2. CJK-LaTeX and HLaTeX

3.3. Omega and Other Extended TeX  

 
4. Unicode Support

4.1. Unicode Support in General

4.2. ToUnicode CMap Support

4.3. OpenType Support and Unicode

4.4. Type1 Font Support and Unicode

    
5. Graphics and Image Format

5.1. Supported Graphics File Format

5.2. Graphics Extension

5.3. Using External Programs for Format Conversion


6. DVI Specials

6.1. Compatibility

6.2. Additions to Dvipdfm's pdf: Special
 

7. Font Mapping


7.1. Options for CJK Font

   Few options are available in dvipdfmx (for CID-keyed fonts) in addition
   to the original dvipdfm.


 1) TTC Index

   You can specify TrueType Collection index number with :n: option in front
   of TrueType font name.

     min10  H :1:mincho

   In this example, the option :1: tells dvipdfmx to select TrueType font #1
   from TrueType collection font "mincho.ttc".


 2) No-embed Switch

   It is possible to block embedding glyph data with the character `!'
   in front of the font name in the font mapping file.

   This feature reduces the size of the final PDF output, but the PDF file
   may not be viewed exactly in other systems on which appropriate fonts
   are not installed.

   Use of this option is not recommended for fonts that contains unusual
   characters (and characters having different width from default value).
   Please note that glyph metric information is not written in the output
   PDF file for TrueType fonts without embedding. It will be treated as
   fixed-pitch with all widths equal to the default value (will be fixed
   someday).


 3) Stylistic Variants

   Keywords ",Bold", ",Italic", and ",BoldItalic" can be used to create
   synthetic bold, italic, and bolditalic style variants from other font
   using PDF viewer's (or OS's) function.

     jbtmo@UKS@     UniKSCms-UCS2-H :0:!batang,Italic
     jbtb@Unicode@  Identity-H      !batang/UCS,Bold

   Availability of this feature highly depends on the implementation of PDF
   viewers. This feature is not supported for embedded fonts in the most of
   PDF viewers, like Adobe Acrobat Reader and GNU Ghostscript.

   Notice that this option automatically disable font embedding.



8. Incompatible Changes From Dvipdfm



9. Other Improvement Over Dvipdfm


9.1. Encryption


9.2. Font



10. Font Licensing and Embedding

   In OpenType format, information regarding how the font should be treated
   when creating documents can be recorded. Dvipdfmx uses this information
   to decide whether embedding font into the document is permitted.

   This font embedding information is indicated by a flag called as "fsType"
   flag; each bit representing different restrictions on font embedding.
   If multiple flag bits are set in fsType, the least restrictive license
   granted takes precedence in dvipdfmx. The fsType flag bits recognized by
   dvipdfmx is as follows:

     * Installable embedding

       All font with this type of license can be embedded.

     * Editable embedding

       All font with this type of license can be embedded.

     * Embedding for Preview & Print only

       Dvipdfmx give the following warning message for fonts with this
       type of license:

         This document contains `Preview & Print' only licensed font

       For the font with this type of licensing, font embedding is allowed
       solely for the purpose of (on-screen) viewing and/or printing the
       document; further editing of the document or extracting an embedded
       font data for other purpose is not allowed. To ensure this condition,
       you must at least protect your document with non-empty password.

   All other flags are treated as more restrictive license than any of the
   above flags and treated as "No embedding allowed"; e.g., if both of the
   editable-embedding flag and unrecognized license flag is set, the font
   is treated as editable-embedding allowed, however, if only unrecognized
   flags are set, the font is not embedded.

   Embedding flags are preserved in embedded font if the font is embedded
   as a TrueType font or a CIDFontType 2 CIDFont. For all font embedded as
   a PostScript font (CFF, CIDFontType 0 CIDFont), they are not preserved.
   Only /Copyright and /Notice in the FontInfo dictionary are preserved in
   this case.

   Some font vendors put different embedding restrictions for different
   condition; e.g., font embedding might be not permitted for commercial
   materials unless you acquire "commercial license" separately.
   Please read EULA carefully before making decision on font usage.


   Adobe provide a font licensing FAQ and a list of embedding permissions
   for Adobe Type Library fonts:

     http://www.adobe.com/type/browser/legal/

   For Japanese font in general, embedding permission tend to be somewhat
   restrictive. Japanese users should read the statement regarding font
   embedding from Japan Typography Association (in Japanese):

     http://www.typography.or.jp/act/morals/moral4.html