~ubuntu-branches/ubuntu/precise/vflib3/precise

« back to all changes in this revision

Viewing changes to doc/VFlib-36.texi

  • Committer: Bazaar Package Importer
  • Author(s): Masayuki Hatta
  • Date: 2002-04-15 12:10:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020415121024-cann32wucyfbq22f
Tags: upstream-3.6.12
ImportĀ upstreamĀ versionĀ 3.6.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\input texinfo @c -*-texinfo-*-
 
2
@c %**start of header
 
3
@setfilename VFlib-36.info
 
4
@settitle VFlib 3.6.12
 
5
@syncodeindex vr fn 
 
6
@setchapternewpage odd
 
7
@iftex
 
8
@afourpaper
 
9
@end iftex
 
10
@c @dircategory Miscellaneous
 
11
@c @direntry
 
12
@c * VFlib: (VFlib-36.info).            A font library VFlib version 3.6.12
 
13
@c @end direntry
 
14
@c %**end of header
 
15
@c ------------------------------------------------------------------------
 
16
 
 
17
@iftex
 
18
@vsize = 8.9 in
 
19
@parskip = 7 pt
 
20
@parindent = 0 pt
 
21
@hyphenation{set-scrunch set-write-pos}
 
22
@end iftex
 
23
 
 
24
@ifinfo
 
25
@paragraphindent 0
 
26
@end ifinfo
 
27
 
 
28
@finalout
 
29
 
 
30
@c ------------------------------------------------------------------------
 
31
@titlepage
 
32
@title A Font Library VFlib 
 
33
@subtitle VFlib version 3.6.12 User's manual
 
34
@subtitle Final Revision: 1 Nov 2001
 
35
@author Hirotsugu Kakugawa
 
36
@end titlepage
 
37
@c ------------------------------------------------------------------------
 
38
 
 
39
 
 
40
 
 
41
@c ------------------------------------------------------------------------
 
42
@c      Node,   Next, Previous, Up
 
43
@node   Top ,       ,         , (dir)
 
44
 
 
45
@ifinfo
 
46
@flushleft
 
47
This is a TeXinfo version of 
 
48
@end flushleft
 
49
 
 
50
@c echo "VFlib 3.6.12" | ctext2pgm -18 -times -ascii-art-h
 
51
@example
 
52
VVVVV    VVVV FFFFFFFFF  ll   ii   bb      
 
53
 VVV      VV   FF    FF lll   ii  bbb      
 
54
  VV      V    FF     F  ll        bb      
 
55
  VVV     V    FF        ll        bb      
 
56
   VV    VV    FF        ll   ii   bb bbb  
 
57
   VV    V     FF    F   ll  iii   bbb bbb 
 
58
   VVV   V     FFFFFFF   ll   ii   bb   bb    33     66     1   22
 
59
    VV  VV     FF    F   ll   ii   bb   bb   3  3   6      11  2  2
 
60
    VVV V      FF        ll   ii   bb   bb      3   6       1     2
 
61
     VV V      FF        ll   ii   bb   bb     33   666     1    2
 
62
     VVVV      FF        ll   ii   bb   bb      3   6  6    1   2  
 
63
      VV       FF        ll   ii   bb  bb    3  3   6  6    1  2
 
64
      VV      FFFF      llll iiii  b bbb      33  *  66  * 111 2222
 
65
@end example
 
66
 
 
67
@flushright
 
68
User's Manual by Hirotsugu Kakugawa
 
69
Final Revision: 1 Nov 2001
 
70
@end flushright
 
71
 
 
72
 
 
73
@end ifinfo
 
74
 
 
75
 
 
76
@menu
 
77
* Copyright::
 
78
* Copying::
 
79
* Introduction::
 
80
* Installing VFlib::
 
81
* Programming with VFlib::
 
82
* Writing a vflibcap::
 
83
* Debugging a vflibcap::
 
84
* Code conversion system::
 
85
* Utility programs::
 
86
* Sample programs::
 
87
* Difference between VFlib version 3.6 and 2::
 
88
* Concept index::
 
89
* Data type index::
 
90
* Function index::
 
91
* Program index::
 
92
* Acknowledgments::
 
93
@end menu
 
94
@c ------------------------------------------------------------------------
 
95
 
 
96
@c ------------------------------------------------------------------------
 
97
@c      Node,      Next,         Previous,  Up
 
98
@node   Copyright, Copying, ,              Top
 
99
@chapter Copyright
 
100
 
 
101
@cindex Copyright
 
102
@cindex LGPL
 
103
@cindex GNU Library General Public License
 
104
 
 
105
Copyright (C) 1996-2001 Hirotsugu Kakugawa. 
 
106
All rights reserved.
 
107
 
 
108
This file is part of the VFlib Library.  This library is free
 
109
software; you can redistribute it and/or modify it under the terms of
 
110
the GNU Library General Public License as published by the Free
 
111
Software Foundation; either version 2 of the License, or (at your
 
112
option) any later version.  This library is distributed in the hope
 
113
that it will be useful, but WITHOUT ANY WARRANTY; without even the
 
114
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 
115
PURPOSE.  See the GNU Library General Public License for more details.
 
116
You should have received a copy of the GNU Library General Public
 
117
License along with this library; if not, write to the Free Software
 
118
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
119
 
 
120
 
 
121
 
 
122
@c ------------------------------------------------------------------------
 
123
@c      Node,      Next,         Previous,  Up
 
124
@node   Copying, Introduction, Copyright,   Top
 
125
@chapter Copying
 
126
 
 
127
@center GNU LIBRARY GENERAL PUBLIC LICENSE
 
128
@center  Version 2, June 1991
 
129
 
 
130
@display
 
131
Copyright @copyright{} 1991 Free Software Foundation, Inc.
 
132
675 Mass Ave, Cambridge, MA 02139, USA
 
133
 
 
134
Everyone is permitted to copy and distribute verbatim copies
 
135
of this license document, but changing it is not allowed.
 
136
 
 
137
[This is the first released version of the library GPL.  It is
 
138
 numbered 2 because it goes with version 2 of the ordinary GPL.]
 
139
@end display
 
140
 
 
141
@unnumberedsec Preamble
 
142
 
 
143
  The licenses for most software are designed to take away your
 
144
freedom to share and change it.  By contrast, the GNU General Public
 
145
Licenses are intended to guarantee your freedom to share and change
 
146
free software--to make sure the software is free for all its users.
 
147
 
 
148
  This license, the Library General Public License, applies to some
 
149
specially designated Free Software Foundation software, and to any
 
150
other libraries whose authors decide to use it.  You can use it for
 
151
your libraries, too.
 
152
 
 
153
  When we speak of free software, we are referring to freedom, not
 
154
price.  Our General Public Licenses are designed to make sure that you
 
155
have the freedom to distribute copies of free software (and charge for
 
156
this service if you wish), that you receive source code or can get it
 
157
if you want it, that you can change the software or use pieces of it
 
158
in new free programs; and that you know you can do these things.
 
159
 
 
160
  To protect your rights, we need to make restrictions that forbid
 
161
anyone to deny you these rights or to ask you to surrender the rights.
 
162
These restrictions translate to certain responsibilities for you if
 
163
you distribute copies of the library, or if you modify it.
 
164
 
 
165
  For example, if you distribute copies of the library, whether gratis
 
166
or for a fee, you must give the recipients all the rights that we gave
 
167
you.  You must make sure that they, too, receive or can get the source
 
168
code.  If you link a program with the library, you must provide
 
169
complete object files to the recipients so that they can relink them
 
170
with the library, after making changes to the library and recompiling
 
171
it.  And you must show them these terms so they know their rights.
 
172
 
 
173
  Our method of protecting your rights has two steps: (1) copyright
 
174
the library, and (2) offer you this license which gives you legal
 
175
permission to copy, distribute and/or modify the library.
 
176
 
 
177
  Also, for each distributor's protection, we want to make certain
 
178
that everyone understands that there is no warranty for this free
 
179
library.  If the library is modified by someone else and passed on, we
 
180
want its recipients to know that what they have is not the original
 
181
version, so that any problems introduced by others will not reflect on
 
182
the original authors' reputations.
 
183
 
 
184
  Finally, any free program is threatened constantly by software
 
185
patents.  We wish to avoid the danger that companies distributing free
 
186
software will individually obtain patent licenses, thus in effect
 
187
transforming the program into proprietary software.  To prevent this,
 
188
we have made it clear that any patent must be licensed for everyone's
 
189
free use or not licensed at all.
 
190
 
 
191
  Most GNU software, including some libraries, is covered by the ordinary
 
192
GNU General Public License, which was designed for utility programs.  This
 
193
license, the GNU Library General Public License, applies to certain
 
194
designated libraries.  This license is quite different from the ordinary
 
195
one; be sure to read it in full, and don't assume that anything in it is
 
196
the same as in the ordinary license.
 
197
 
 
198
  The reason we have a separate public license for some libraries is that
 
199
they blur the distinction we usually make between modifying or adding to a
 
200
program and simply using it.  Linking a program with a library, without
 
201
changing the library, is in some sense simply using the library, and is
 
202
analogous to running a utility program or application program.  However, in
 
203
a textual and legal sense, the linked executable is a combined work, a
 
204
derivative of the original library, and the ordinary General Public License
 
205
treats it as such.
 
206
 
 
207
  Because of this blurred distinction, using the ordinary General
 
208
Public License for libraries did not effectively promote software
 
209
sharing, because most developers did not use the libraries.  We
 
210
concluded that weaker conditions might promote sharing better.
 
211
 
 
212
  However, unrestricted linking of non-free programs would deprive the
 
213
users of those programs of all benefit from the free status of the
 
214
libraries themselves.  This Library General Public License is intended to
 
215
permit developers of non-free programs to use free libraries, while
 
216
preserving your freedom as a user of such programs to change the free
 
217
libraries that are incorporated in them.  (We have not seen how to achieve
 
218
this as regards changes in header files, but we have achieved it as regards
 
219
changes in the actual functions of the Library.)  The hope is that this
 
220
will lead to faster development of free libraries.
 
221
 
 
222
  The precise terms and conditions for copying, distribution and
 
223
modification follow.  Pay close attention to the difference between a
 
224
"work based on the library" and a "work that uses the library".  The
 
225
former contains code derived from the library, while the latter only
 
226
works together with the library.
 
227
 
 
228
  Note that it is possible for a library to be covered by the ordinary
 
229
General Public License rather than by this special one.
 
230
 
 
231
@unnumberedsec GNU LIBRARY GENERAL PUBLIC LICENSE
 
232
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
233
 
 
234
@enumerate
 
235
@item
 
236
This License Agreement applies to any software library which
 
237
contains a notice placed by the copyright holder or other authorized
 
238
party saying it may be distributed under the terms of this Library
 
239
General Public License (also called "this License").  Each licensee is
 
240
addressed as "you".
 
241
 
 
242
  A "library" means a collection of software functions and/or data
 
243
prepared so as to be conveniently linked with application programs
 
244
(which use some of those functions and data) to form executables.
 
245
 
 
246
  The "Library", below, refers to any such software library or work
 
247
which has been distributed under these terms.  A "work based on the
 
248
Library" means either the Library or any derivative work under
 
249
copyright law: that is to say, a work containing the Library or a
 
250
portion of it, either verbatim or with modifications and/or translated
 
251
straightforwardly into another language.  (Hereinafter, translation is
 
252
included without limitation in the term "modification".)
 
253
 
 
254
  "Source code" for a work means the preferred form of the work for
 
255
making modifications to it.  For a library, complete source code means
 
256
all the source code for all modules it contains, plus any associated
 
257
interface definition files, plus the scripts used to control compilation
 
258
and installation of the library.
 
259
 
 
260
  Activities other than copying, distribution and modification are not
 
261
covered by this License; they are outside its scope.  The act of
 
262
running a program using the Library is not restricted, and output from
 
263
such a program is covered only if its contents constitute a work based
 
264
on the Library (independent of the use of the Library in a tool for
 
265
writing it).  Whether that is true depends on what the Library does
 
266
and what the program that uses the Library does.
 
267
  
 
268
@item 
 
269
You may copy and distribute verbatim copies of the Library's
 
270
complete source code as you receive it, in any medium, provided that
 
271
you conspicuously and appropriately publish on each copy an
 
272
appropriate copyright notice and disclaimer of warranty; keep intact
 
273
all the notices that refer to this License and to the absence of any
 
274
warranty; and distribute a copy of this License along with the
 
275
Library.
 
276
 
 
277
  You may charge a fee for the physical act of transferring a copy,
 
278
and you may at your option offer warranty protection in exchange for a
 
279
fee.
 
280
 
 
281
@item
 
282
You may modify your copy or copies of the Library or any portion
 
283
of it, thus forming a work based on the Library, and copy and
 
284
distribute such modifications or work under the terms of Section 1
 
285
above, provided that you also meet all of these conditions:
 
286
 
 
287
@enumerate a
 
288
@item 
 
289
    The modified work must itself be a software library.
 
290
 
 
291
@item
 
292
    You must cause the files modified to carry prominent notices
 
293
    stating that you changed the files and the date of any change.
 
294
 
 
295
@item
 
296
     You must cause the whole of the work to be licensed at no
 
297
    charge to all third parties under the terms of this License.
 
298
 
 
299
@item
 
300
    If a facility in the modified Library refers to a function or a
 
301
    table of data to be supplied by an application program that uses
 
302
    the facility, other than as an argument passed when the facility
 
303
    is invoked, then you must make a good faith effort to ensure that,
 
304
    in the event an application does not supply such function or
 
305
    table, the facility still operates, and performs whatever part of
 
306
    its purpose remains meaningful.
 
307
 
 
308
    (For example, a function in a library to compute square roots has
 
309
    a purpose that is entirely well-defined independent of the
 
310
    application.  Therefore, Subsection 2d requires that any
 
311
    application-supplied function or table used by this function must
 
312
    be optional: if the application does not supply it, the square
 
313
    root function must still compute square roots.)
 
314
@end enumerate
 
315
 
 
316
These requirements apply to the modified work as a whole.  If
 
317
identifiable sections of that work are not derived from the Library,
 
318
and can be reasonably considered independent and separate works in
 
319
themselves, then this License, and its terms, do not apply to those
 
320
sections when you distribute them as separate works.  But when you
 
321
distribute the same sections as part of a whole which is a work based
 
322
on the Library, the distribution of the whole must be on the terms of
 
323
this License, whose permissions for other licensees extend to the
 
324
entire whole, and thus to each and every part regardless of who wrote
 
325
it.
 
326
 
 
327
Thus, it is not the intent of this section to claim rights or contest
 
328
your rights to work written entirely by you; rather, the intent is to
 
329
exercise the right to control the distribution of derivative or
 
330
collective works based on the Library.
 
331
 
 
332
In addition, mere aggregation of another work not based on the Library
 
333
with the Library (or with a work based on the Library) on a volume of
 
334
a storage or distribution medium does not bring the other work under
 
335
the scope of this License.
 
336
 
 
337
@item 
 
338
You may opt to apply the terms of the ordinary GNU General Public
 
339
License instead of this License to a given copy of the Library.  To do
 
340
this, you must alter all the notices that refer to this License, so
 
341
that they refer to the ordinary GNU General Public License, version 2,
 
342
instead of to this License.  (If a newer version than version 2 of the
 
343
ordinary GNU General Public License has appeared, then you can specify
 
344
that version instead if you wish.)  Do not make any other change in
 
345
these notices.
 
346
 
 
347
  Once this change is made in a given copy, it is irreversible for
 
348
that copy, so the ordinary GNU General Public License applies to all
 
349
subsequent copies and derivative works made from that copy.
 
350
 
 
351
  This option is useful when you wish to copy part of the code of
 
352
the Library into a program that is not a library.
 
353
 
 
354
@item 
 
355
You may copy and distribute the Library (or a portion or
 
356
derivative of it, under Section 2) in object code or executable form
 
357
under the terms of Sections 1 and 2 above provided that you accompany
 
358
it with the complete corresponding machine-readable source code, which
 
359
must be distributed under the terms of Sections 1 and 2 above on a
 
360
medium customarily used for software interchange.
 
361
 
 
362
  If distribution of object code is made by offering access to copy
 
363
from a designated place, then offering equivalent access to copy the
 
364
source code from the same place satisfies the requirement to
 
365
distribute the source code, even though third parties are not
 
366
compelled to copy the source along with the object code.
 
367
 
 
368
@item 
 
369
A program that contains no derivative of any portion of the
 
370
Library, but is designed to work with the Library by being compiled or
 
371
linked with it, is called a "work that uses the Library".  Such a
 
372
work, in isolation, is not a derivative work of the Library, and
 
373
therefore falls outside the scope of this License.
 
374
 
 
375
  However, linking a "work that uses the Library" with the Library
 
376
creates an executable that is a derivative of the Library (because it
 
377
contains portions of the Library), rather than a "work that uses the
 
378
library".  The executable is therefore covered by this License.
 
379
Section 6 states terms for distribution of such executables.
 
380
 
 
381
  When a "work that uses the Library" uses material from a header file
 
382
that is part of the Library, the object code for the work may be a
 
383
derivative work of the Library even though the source code is not.
 
384
Whether this is true is especially significant if the work can be
 
385
linked without the Library, or if the work is itself a library.  The
 
386
threshold for this to be true is not precisely defined by law.
 
387
 
 
388
  If such an object file uses only numerical parameters, data
 
389
structure layouts and accessors, and small macros and small inline
 
390
functions (ten lines or less in length), then the use of the object
 
391
file is unrestricted, regardless of whether it is legally a derivative
 
392
work.  (Executables containing this object code plus portions of the
 
393
Library will still fall under Section 6.)
 
394
 
 
395
  Otherwise, if the work is a derivative of the Library, you may
 
396
distribute the object code for the work under the terms of Section 6.
 
397
Any executables containing that work also fall under Section 6,
 
398
whether or not they are linked directly with the Library itself.
 
399
 
 
400
@item 
 
401
As an exception to the Sections above, you may also compile or
 
402
link a "work that uses the Library" with the Library to produce a
 
403
work containing portions of the Library, and distribute that work
 
404
under terms of your choice, provided that the terms permit
 
405
modification of the work for the customer's own use and reverse
 
406
engineering for debugging such modifications.
 
407
 
 
408
  You must give prominent notice with each copy of the work that the
 
409
Library is used in it and that the Library and its use are covered by
 
410
this License.  You must supply a copy of this License.  If the work
 
411
during execution displays copyright notices, you must include the
 
412
copyright notice for the Library among them, as well as a reference
 
413
directing the user to the copy of this License.  Also, you must do one
 
414
of these things:
 
415
 
 
416
@enumerate a
 
417
@item 
 
418
    Accompany the work with the complete corresponding
 
419
    machine-readable source code for the Library including whatever
 
420
    changes were used in the work (which must be distributed under
 
421
    Sections 1 and 2 above); and, if the work is an executable linked
 
422
    with the Library, with the complete machine-readable "work that
 
423
    uses the Library", as object code and/or source code, so that the
 
424
    user can modify the Library and then relink to produce a modified
 
425
    executable containing the modified Library.  (It is understood
 
426
    that the user who changes the contents of definitions files in the
 
427
    Library will not necessarily be able to recompile the application
 
428
    to use the modified definitions.)
 
429
 
 
430
@item
 
431
    Accompany the work with a written offer, valid for at
 
432
    least three years, to give the same user the materials
 
433
    specified in Subsection 6a, above, for a charge no more
 
434
    than the cost of performing this distribution.
 
435
 
 
436
@item
 
437
    If distribution of the work is made by offering access to copy
 
438
    from a designated place, offer equivalent access to copy the above
 
439
    specified materials from the same place.
 
440
 
 
441
@item
 
442
    Verify that the user has already received a copy of these
 
443
    materials or that you have already sent this user a copy.
 
444
@end enumerate
 
445
 
 
446
  For an executable, the required form of the "work that uses the
 
447
Library" must include any data and utility programs needed for
 
448
reproducing the executable from it.  However, as a special exception,
 
449
the source code distributed need not include anything that is normally
 
450
distributed (in either source or binary form) with the major
 
451
components (compiler, kernel, and so on) of the operating system on
 
452
which the executable runs, unless that component itself accompanies
 
453
the executable.
 
454
 
 
455
  It may happen that this requirement contradicts the license
 
456
restrictions of other proprietary libraries that do not normally
 
457
accompany the operating system.  Such a contradiction means you cannot
 
458
use both them and the Library together in an executable that you
 
459
distribute.
 
460
 
 
461
@item 
 
462
You may place library facilities that are a work based on the
 
463
Library side-by-side in a single library together with other library
 
464
facilities not covered by this License, and distribute such a combined
 
465
library, provided that the separate distribution of the work based on
 
466
the Library and of the other library facilities is otherwise
 
467
permitted, and provided that you do these two things:
 
468
 
 
469
@enumerate
 
470
@item  
 
471
    Accompany the combined library with a copy of the same work
 
472
    based on the Library, uncombined with any other library
 
473
    facilities.  This must be distributed under the terms of the
 
474
    Sections above.
 
475
 
 
476
@item 
 
477
    Give prominent notice with the combined library of the fact
 
478
    that part of it is a work based on the Library, and explaining
 
479
    where to find the accompanying uncombined form of the same work.
 
480
@end enumerate
 
481
 
 
482
@item 
 
483
 You may not copy, modify, sublicense, link with, or distribute
 
484
the Library except as expressly provided under this License.  Any
 
485
attempt otherwise to copy, modify, sublicense, link with, or
 
486
distribute the Library is void, and will automatically terminate your
 
487
rights under this License.  However, parties who have received copies,
 
488
or rights, from you under this License will not have their licenses
 
489
terminated so long as such parties remain in full compliance.
 
490
 
 
491
@item 
 
492
You are not required to accept this License, since you have not
 
493
signed it.  However, nothing else grants you permission to modify or
 
494
distribute the Library or its derivative works.  These actions are
 
495
prohibited by law if you do not accept this License.  Therefore, by
 
496
modifying or distributing the Library (or any work based on the
 
497
Library), you indicate your acceptance of this License to do so, and
 
498
all its terms and conditions for copying, distributing or modifying
 
499
the Library or works based on it.
 
500
 
 
501
@item
 
502
 Each time you redistribute the Library (or any work based on the
 
503
Library), the recipient automatically receives a license from the
 
504
original licensor to copy, distribute, link with or modify the Library
 
505
subject to these terms and conditions.  You may not impose any further
 
506
restrictions on the recipients' exercise of the rights granted herein.
 
507
You are not responsible for enforcing compliance by third parties to
 
508
this License.
 
509
 
 
510
@item 
 
511
If, as a consequence of a court judgment or allegation of patent
 
512
infringement or for any other reason (not limited to patent issues),
 
513
conditions are imposed on you (whether by court order, agreement or
 
514
otherwise) that contradict the conditions of this License, they do not
 
515
excuse you from the conditions of this License.  If you cannot
 
516
distribute so as to satisfy simultaneously your obligations under this
 
517
License and any other pertinent obligations, then as a consequence you
 
518
may not distribute the Library at all.  For example, if a patent
 
519
license would not permit royalty-free redistribution of the Library by
 
520
all those who receive copies directly or indirectly through you, then
 
521
the only way you could satisfy both it and this License would be to
 
522
refrain entirely from distribution of the Library.
 
523
 
 
524
If any portion of this section is held invalid or unenforceable under any
 
525
particular circumstance, the balance of the section is intended to apply,
 
526
and the section as a whole is intended to apply in other circumstances.
 
527
 
 
528
It is not the purpose of this section to induce you to infringe any
 
529
patents or other property right claims or to contest validity of any
 
530
such claims; this section has the sole purpose of protecting the
 
531
integrity of the free software distribution system which is
 
532
implemented by public license practices.  Many people have made
 
533
generous contributions to the wide range of software distributed
 
534
through that system in reliance on consistent application of that
 
535
system; it is up to the author/donor to decide if he or she is willing
 
536
to distribute software through any other system and a licensee cannot
 
537
impose that choice.
 
538
 
 
539
This section is intended to make thoroughly clear what is believed to
 
540
be a consequence of the rest of this License.
 
541
 
 
542
@item 
 
543
If the distribution and/or use of the Library is restricted in
 
544
certain countries either by patents or by copyrighted interfaces, the
 
545
original copyright holder who places the Library under this License may add
 
546
an explicit geographical distribution limitation excluding those countries,
 
547
so that distribution is permitted only in or among countries not thus
 
548
excluded.  In such case, this License incorporates the limitation as if
 
549
written in the body of this License.
 
550
 
 
551
@item 
 
552
The Free Software Foundation may publish revised and/or new
 
553
versions of the Library General Public License from time to time.
 
554
Such new versions will be similar in spirit to the present version,
 
555
but may differ in detail to address new problems or concerns.
 
556
 
 
557
Each version is given a distinguishing version number.  If the Library
 
558
specifies a version number of this License which applies to it and
 
559
"any later version", you have the option of following the terms and
 
560
conditions either of that version or of any later version published by
 
561
the Free Software Foundation.  If the Library does not specify a
 
562
license version number, you may choose any version ever published by
 
563
the Free Software Foundation.
 
564
 
 
565
@item 
 
566
If you wish to incorporate parts of the Library into other free
 
567
programs whose distribution conditions are incompatible with these,
 
568
write to the author to ask for permission.  For software which is
 
569
copyrighted by the Free Software Foundation, write to the Free
 
570
Software Foundation; we sometimes make exceptions for this.  Our
 
571
decision will be guided by the two goals of preserving the free status
 
572
of all derivatives of our free software and of promoting the sharing
 
573
and reuse of software generally.
 
574
 
 
575
@iftex
 
576
@heading NO WARRANTY
 
577
@end iftex
 
578
@ifinfo
 
579
@center NO WARRANTY
 
580
@end ifinfo
 
581
 
 
582
@item 
 
583
BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
 
584
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
 
585
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
 
586
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
 
587
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
 
588
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
589
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
 
590
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
 
591
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
 
592
 
 
593
@item
 
594
 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
 
595
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
 
596
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
 
597
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
 
598
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
 
599
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
 
600
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
 
601
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
 
602
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 
603
DAMAGES.
 
604
@end enumerate
 
605
 
 
606
 
 
607
@iftex
 
608
@heading END OF TERMS AND CONDITIONS
 
609
@end iftex
 
610
@ifinfo
 
611
@center END OF TERMS AND CONDITIONS
 
612
@end ifinfo
 
613
 
 
614
@page
 
615
@unnumberedsec Appendix: How to Apply These Terms to Your New Libraries
 
616
 
 
617
  If you develop a new library, and you want it to be of the greatest
 
618
possible use to the public, we recommend making it free software that
 
619
everyone can redistribute and change.  You can do so by permitting
 
620
redistribution under these terms (or, alternatively, under the terms of the
 
621
ordinary General Public License).
 
622
 
 
623
  To apply these terms, attach the following notices to the library.  It is
 
624
safest to attach them to the start of each source file to most effectively
 
625
convey the exclusion of warranty; and each file should have at least the
 
626
"copyright" line and a pointer to where the full notice is found.
 
627
 
 
628
@smallexample
 
629
@var{one line to give the library's name and a brief idea of what it does.}
 
630
Copyright (C) @var{year}  @var{name of author}
 
631
 
 
632
This library is free software; you can redistribute it and/or
 
633
modify it under the terms of the GNU Library General Public
 
634
License as published by the Free Software Foundation; either
 
635
version 2 of the License, or (at your option) any later version.
 
636
 
 
637
This library is distributed in the hope that it will be useful,
 
638
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
639
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
640
Library General Public License for more details.
 
641
 
 
642
You should have received a copy of the GNU Library General Public
 
643
License along with this library; if not, write to the Free
 
644
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
645
@end smallexample
 
646
 
 
647
Also add information on how to contact you by electronic and paper mail.
 
648
 
 
649
You should also get your employer (if you work as a programmer) or your
 
650
school, if any, to sign a "copyright disclaimer" for the library, if
 
651
necessary.  Here is a sample; alter the names:
 
652
 
 
653
@smallexample
 
654
  Yoyodyne, Inc., hereby disclaims all copyright interest in the
 
655
  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
 
656
 
 
657
  @var{signature of Ty Coon}, 1 April 1990
 
658
  Ty Coon, President of Vice
 
659
@end smallexample
 
660
 
 
661
That's all there is to it!
 
662
 
 
663
 
 
664
@c ------------------------------------------------------------------------
 
665
@c      Node,         Next,             Previous,  Up
 
666
@node   Introduction, Installing VFlib, Copying,   Top
 
667
@chapter Introduction
 
668
 
 
669
Today many font files are available in various font file formats. 
 
670
When we need a software to display or print characters which does not
 
671
depend on a windowing system and/or an operating system, we must
 
672
write interface routines for accessing font files in each application
 
673
software again and again.  To do this, programmers must have
 
674
knowledge on font file formats; it will be a hard task for
 
675
programmers if the number of font formats that an application
 
676
software supports becomes large.
 
677
 
 
678
  VFlib is a font library written in C providing several functions to
 
679
obtain bitmaps of characters.  VFlib hides the font format of font
 
680
files and provides a unified API for all supported font formats. 
 
681
Thus, programmers for application software need not have knowledge on
 
682
font file formats.  Instead, any software using VFlib can support
 
683
various font file formats immediately.
 
684
 
 
685
  This document describes the fundamental concepts of VFlib and gives
 
686
a brief introduction in writing programs using VFlib.
 
687
 
 
688
As described above, VFlib supports many font file formats and
 
689
absorbs differences between font file formats.
 
690
Currently, VFlib supports the following font file formats: 
 
691
PCF, BDF, HBF, TrueType, Type1, GF, PK, Virtual Fonts, TFM, 
 
692
SyotaiKurabu (a vector font format for Japanese Kanji characters), 
 
693
JG (another vector font format for Japanese Kanji characters), and
 
694
eKanji (a bitmap font format for Kanji characters).
 
695
 
 
696
The VFlib system consists of two parts:
 
697
 
 
698
@table @asis
 
699
@item A library (@file{libVFlib.a} and/or @file{libVFlib.so})
 
700
@cindex libVFlib.a
 
701
@cindex libVFlib.so
 
702
 
 
703
It provides several C functions.  Any application software
 
704
using VFlib must link this library.
 
705
 
 
706
VFlib (optionally) uses kpathsea, FreeType, and T1Lib libraries.
 
707
Application software linked with VFlib must be linked with
 
708
these external libraries, if you want to use them.
 
709
Application software must be linked against
 
710
kpathsea, FreeType and T1Lib in addition to VFlib 
 
711
if you configured VFlib to use them. 
 
712
 
 
713
@item A font database file (@file{vflibcap})
 
714
@cindex vflibcap
 
715
 
 
716
When we open a font, information about the font file (font
 
717
format, location, possibly necessary glyph modifications
 
718
etc.) is necessary.  This file describes such information;
 
719
it is read when the initialization function of VFlib is called.
 
720
@end table
 
721
 
 
722
 
 
723
@noindent
 
724
Basic concept of VFlib
 
725
 
 
726
@table @b
 
727
 
 
728
@item Font Classes and Font Drivers
 
729
@cindex font class
 
730
@cindex font driver
 
731
 
 
732
VFlib can handle multiple font file formats.  Reading a font file
 
733
according to its font file format is done by an internal module in
 
734
VFlib corresponding to its font file format.  This internal module
 
735
is called a @emph{font driver}.  Service units provided by a font driver
 
736
is called @emph{font class}.  From an end-user's point of view,
 
737
various font formats are distinguished by various names of font
 
738
classes.  Font drivers themselves are internal of VFlib and invisible
 
739
for end-users.
 
740
 
 
741
 Some font drivers may not read font files on disk; they may
 
742
generate glyph and outlines by internal computation only.  In
 
743
addition, some font drivers may return glyph which are obtained as
 
744
glyph by another font class (hence the name `Virtual Font library').
 
745
@cindex Virtual Font library
 
746
 
 
747
@item A View of VFlib Font From The End-User
 
748
 
 
749
Each (virtual) font by VFlib has its inherent information of point
 
750
size, pixel size, and resolution of the target device.  In addition
 
751
to these font metrics are defined for each glyph.
 
752
 
 
753
 Some font file formats does not have such concepts; in such case,
 
754
(1) lacking information is given in a font database file @file{vflibcap}
 
755
or (2) the specific font driver gives such information as default
 
756
values.  For instance, a TrueType font file is a vector font file
 
757
and does not has information on point size and resolution of the
 
758
target device (such information is unnecessary since vector fonts
 
759
can be scaled at any size).  SyotaiKurabu font format (a vector
 
760
font for Japanese Kanji) does not have font metric information at
 
761
all.  A font driver for this font format virtually generates font
 
762
metrics by information given in a vflibcap file.
 
763
 
 
764
@item Font Names and Font Searching Mechanism
 
765
 
 
766
In VFlib, a font is specified by a font name when a font is requested to open.
 
767
First, VFlib checks whether the font name is given in vflibcap or not.  
 
768
If the font name is found, VFlib reads the description for the
 
769
font in vflibcap.  The description contains a font class name; 
 
770
VFlib then invokes a font driver corresponding to the font class name.
 
771
Finally the font driver opens the font file (if necessary).
 
772
 
 
773
If the font name is not given in a vflibcap file, a font searching
 
774
mechanism is invoked.  Since there are many font files for X Window
 
775
and @TeX{}, this feature is introduced to avoid writing an entry for
 
776
each font file.  
 
777
Various font drivers will be called to see whether
 
778
the font can be opened.  
 
779
If a font driver succeeds in opening the font, font searching finishes 
 
780
and the VFlib font opening function returns successfully.  
 
781
Otherwise, font open fails.
 
782
 
 
783
Fonts described in a vflibcap file are called @emph{explicit fonts} and
 
784
fonts that are searched for by the font search feature are called 
 
785
@emph{implicit fonts}.
 
786
Support for explicit and implicit fonts depends on font driver.
 
787
 
 
788
 
 
789
@item Obtaining Bitmaps (Glyph)
 
790
 
 
791
Two interfaces are provided to obtain glyph (bitmaps) of a font.
 
792
 
 
793
@table @asis
 
794
@item High resolution device oriented glyph
 
795
@cindex High resolution oriented mode
 
796
 
 
797
This method is suitable for devices of high resolution such as
 
798
laser printers. The size of glyph is specified by the
 
799
physical size of glyph and device resolution.  When the size
 
800
of a glyph in the source font is different from the target
 
801
size, VFlib scales the source glyph internally.
 
802
 
 
803
@item Low resolution device oriented glyph
 
804
@cindex Low resolution oriented mode
 
805
 
 
806
This method is suitable for low resolution devices such as CRT
 
807
displays.  Glyph sizes are specified by pixel size rather than
 
808
by device resolution.  When the size of a glyph in the source
 
809
font is different from the target size, VFlib scales the
 
810
source glyph internally.
 
811
 
 
812
@end table
 
813
@end table
 
814
 
 
815
 
 
816
 
 
817
 
 
818
 
 
819
@c ------------------------------------------------------------------------
 
820
@c      Node,             Next,                   Previous,     Up
 
821
@node   Installing VFlib, Programming with VFlib, Introduction, Top
 
822
@chapter Installing VFlib
 
823
@cindex Installing VFlib
 
824
 
 
825
VFlib uses GNU autoconf and GNU libtool to compile.
 
826
According to the following procedure, 
 
827
compile and install VFlib.
 
828
 
 
829
VFlib (optionally) uses FreeType 1.3.0 or later, 
 
830
T1Lib 1.3 or later, and kpathsea 3.2 libraries.
 
831
They must be installed before compiling VFlib if you want use them.
 
832
They are available from the following sites:
 
833
 
 
834
@itemize @bullet
 
835
 
 
836
@item FreeType
 
837
VFlib is tested with FreeType 1.3.
 
838
(FreeType 1.0 does not work with current VFlib3.)
 
839
@itemize @minus
 
840
@item @url{http://www.freetype.org/}
 
841
@item @url{ftp://ftp.freetype.org/pub/freetype/freetype-1.3.tar.gz}
 
842
@end itemize
 
843
 
 
844
@item T1Lib
 
845
VFlib is tested with T1Lib 1.3.
 
846
@itemize @minus
 
847
@item @url{ftp://sunsite.unc.edu/pub/Linux/libs/graphics/}
 
848
@item @url{http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib/t1lib.html}
 
849
@item @url{ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib/}
 
850
@end itemize
 
851
 
 
852
@item kpathsea
 
853
VFlib is tested with kpathsea 3.2 in web2c-7.2b.
 
854
@itemize @minus
 
855
@item @url{ftp://ftp.ctan.org/tex-archive/system/web2c/}
 
856
@end itemize
 
857
 
 
858
@end itemize
 
859
 
 
860
 
 
861
@enumerate
 
862
@item 
 
863
  VFlib is tested on the following platforms:
 
864
@itemize @bullet
 
865
@item FreeBSD 2.2.2 and 3.2 on IBM PC-clones
 
866
@item Solaris 2.5.1 on Sun SPARC Stations
 
867
@end itemize
 
868
 
 
869
Porting to Unix-like system is easy since the source code
 
870
is not specific system dependent.
 
871
Porting to non-Unix-like system is not difficult; please try.
 
872
 
 
873
@item 
 
874
 Go into the directory @file{VFlib3-3.6.12}.
 
875
 
 
876
@item
 
877
 Run the @command{configure} script.
 
878
 
 
879
@example
 
880
% ./configure  [RET]
 
881
@end example
 
882
 
 
883
@cindex FreeType
 
884
@cindex T1Lib
 
885
@cindex kpathsea
 
886
@cindex web2c
 
887
By default, VFlib does @emph{not} support for TrueType and Type1 fonts 
 
888
and @TeX{} font searching by kpathsea library
 
889
for searching @TeX{}-related font files such as GF, PK, TFM, VF.
 
890
For such features, VFlib (optionally) uses FreeType library 
 
891
version 1.2 or later for rendering TrueType font files,
 
892
T1Lib library version 1.3 or later for rendering Type 1 font files,
 
893
and kpathsea library version 3.2.
 
894
 
 
895
VFlib can be built to use these libraries
 
896
by giving  options when you run @command{configure} script.
 
897
Probably, the following is the typical options to configure script to use
 
898
TrueType and Type 1 fonts and font search feature by kpathsea library.
 
899
 
 
900
@example
 
901
% ./configure \
 
902
       --with-kpathsea \
 
903
       --with-kpathsea-includedir=/usr/local/include \
 
904
       --with-kpathsea-libdir=/usr/local/lib
 
905
       --with-freetype \
 
906
       --with-freetype-includedir=/usr/local/include/freetype \
 
907
       --with-freetype-libdir=/usr/local/lib"
 
908
       --with-t1lib \
 
909
       --with-t1lib-includedir=/usr/local/include \
 
910
       --with-t1lib-libdir=/usr/local/lib            [RET]
 
911
@end example
 
912
 
 
913
@emph{Note:}
 
914
See the @command{configure-site} script; 
 
915
it invokes the @command{configure} script with typical settings shown above.
 
916
 
 
917
 
 
918
Options for configure script is as follows:
 
919
 
 
920
@table @asis
 
921
 
 
922
@item @t{--enable-shared}
 
923
   Enable to build a shared library version of VFlib.
 
924
   By default, shared library version is created, 
 
925
   if the target system supports shared library.
 
926
 
 
927
@item @t{--disable-shared}
 
928
   Disable to build a shared library version of VFlib.
 
929
 
 
930
@item @t{--disable-static}
 
931
   Disable to build a static library version of VFlib.
 
932
   By default, static library version is not created, 
 
933
   if the target system supports shared library.
 
934
 
 
935
@item @t{--enable-static}
 
936
   Enable to build a shared library version of VFlib.
 
937
 
 
938
@item @t{--disable-bdf}
 
939
   VFlib is built without the BDF font driver.
 
940
 
 
941
@item @t{--disable-pcf}
 
942
   VFlib is built without the PCF font driver.
 
943
 
 
944
@item @t{--disable-hbf}
 
945
   VFlib is built without the HBF font driver.
 
946
 
 
947
@item @t{--disable-gf}
 
948
   VFlib is built without the @TeX{} GF font driver.
 
949
 
 
950
@item @t{--disable-pk}
 
951
   VFlib is built without the @TeX{} PK font driver.
 
952
 
 
953
@item @t{--disable-tfm}
 
954
   VFlib is built without the @TeX{} TFM font driver.
 
955
 
 
956
@item @t{--disable-jtex}
 
957
   VFlib is built without the Japanese @TeX{} Kanji font driver.
 
958
 
 
959
@item @t{--disable-tex-fonts}
 
960
   VFlib is built without all @TeX{}-related font drivers, i.e., 
 
961
   GF, PK, VF, TFM, and ASCII Japanese @TeX{} Kanji.
 
962
 
 
963
@item @t{--disable-zeit}
 
964
   VFlib is built without the Zeit (Syotai Kurabu) font driver.
 
965
 
 
966
@item @t{--disable-jg}
 
967
   VFlib is built without the JG font driver.
 
968
 
 
969
@item @t{--disable-ekanji}
 
970
   VFlib is built without the eKanji font driver.
 
971
 
 
972
@item @t{--disable-comic}
 
973
   VFlib is built without the Japanese comic font driver.
 
974
 
 
975
@item @t{--disable-try}
 
976
   VFlib is built without the Try font driver.
 
977
 
 
978
@item @t{--disable-mojikmap}
 
979
   VFlib is built without the Mojikyo font mapping driver.
 
980
 
 
981
@item @t{--with-freetype@var{[=LIB]}}
 
982
   FreeType library file is @var{LIB}. 
 
983
   Default value is @code{ttf}.
 
984
  (Application programs must be linked against 
 
985
   @file{lib@var{LIB}.a} or @file{lib@var{LIB}.so}.)
 
986
 
 
987
@item @t{--with-freetype-includedir=@var{DIR}}
 
988
   FreeType include files are in @var{DIR}.
 
989
 
 
990
@item @t{--with-freetype-libdir=@var{DIR}}
 
991
   FreeType library files are in @var{DIR}.
 
992
 
 
993
@item @t{--with-t1lib@var{[=LIB]}}
 
994
   T1Lib library file is @var{LIB}. 
 
995
   Default value is @code{t1}.
 
996
  (Application programs must be linked against 
 
997
   @file{lib@var{LIB}.a} or @file{lib@var{LIB}.so}.)
 
998
 
 
999
@item @t{--with-t1lib-includedir=@var{DIR}}
 
1000
   T1Lib include files are in @var{DIR}.
 
1001
 
 
1002
@item @t{--with-t1lib-libdir=@var{DIR}}
 
1003
   T1lib library files are in @var{DIR}.
 
1004
 
 
1005
@item @t{--with-kpathsea@var{=LIB}}
 
1006
   Kpathsea library file is @var{LIB}. 
 
1007
   Default value is @code{kpathsea}.
 
1008
  (Application programs must be linked against 
 
1009
   @file{lib@var{LIB}.a} or @file{lib@var{LIB}.so}.)
 
1010
 
 
1011
@item @t{--with-kpathsea-includedir=@var{DIR}}
 
1012
   Kpathsea include files are in @var{DIR}.
 
1013
 
 
1014
@item @t{--with-kpathsea-libdir=@var{DIR}}
 
1015
   Kpathsea library files are in @var{DIR}.
 
1016
 
 
1017
@end table
 
1018
 
 
1019
@item
 
1020
 Run @command{make} to compile VFlib.
 
1021
 
 
1022
@example
 
1023
% make  [RET]
 
1024
@end example
 
1025
 
 
1026
@item
 
1027
Become a super user (root) and 
 
1028
run @command{make} with @option{install} option to install.
 
1029
(Run @command{make} with @option{uninstall} option to uninstall.)
 
1030
 
 
1031
@example
 
1032
# make  install [RET]
 
1033
@end example
 
1034
 
 
1035
@item 
 
1036
If installation is successful, the following has been created:
 
1037
 
 
1038
@table @asis
 
1039
@item  @file{libVFlib.a} and/or @file{libVFlib.so}
 
1040
@cindex libVFlib.a
 
1041
@cindex libVFlib.so
 
1042
These are the library files and linked with application programs.
 
1043
 
 
1044
@item @command{vflserver}, @command{vflmkcaptex}, @command{vflx11}, @command{vfltest}, etc.
 
1045
 --- A VFlib server and test programs on X11
 
1046
@cindex vflibcap
 
1047
 
 
1048
By @command{vflserver}, the functionality of VFlib is available 
 
1049
via network if @command{vflserver} is registered in @file{/etc/inetd.conf}. 
 
1050
It can be used
 
1051
interactively by invocation from shell.  Interactive use of
 
1052
VFlib is useful for testing or debugging purposes.
 
1053
 
 
1054
@command{vflx11} is a test program that displays characters on X Window System.
 
1055
You can use it to test if a font is correctly 
 
1056
configured in vflibcap file.
 
1057
 
 
1058
@command{vflmkcaptex} is an automatic vflibcap generator
 
1059
for @TeX{} DVI drivers, especially software in the @TeX{}-Guy package.
 
1060
It is a Unix Shell script, and it invokes many subprograms
 
1061
(written in C) to generate font definitions for each font format.
 
1062
 
 
1063
@command{vfltest} is a test program that displays characters 
 
1064
on terminal by ascii-art form.
 
1065
@end table
 
1066
 
 
1067
@end enumerate
 
1068
 
 
1069
Installation directories are as follows:
 
1070
 
 
1071
@table @asis
 
1072
 
 
1073
@item @file{/usr/local/share/VFlib/3.6.12/} (= @file{$prefix/share/VFlib/3.6.12/})
 
1074
Runtime files such as vflibcap are installed here.
 
1075
 
 
1076
This runtime root directory can be changed on runtime by
 
1077
an environment variable @code{VFLIB_RUNTIME_DIRECTORY}.
 
1078
If this environment variable is not set, the default
 
1079
directory (@file{/usr/local/share/VFlib/3.6.12/}) is used.
 
1080
 
 
1081
Under this directory, there are following subdirectories:
 
1082
 
 
1083
@table @asis
 
1084
@item @file{ccv}
 
1085
In this directory, code conversion files are installed.
 
1086
This directory can be changed on runtime by setting 
 
1087
an environment variable @code{VFLIB_CCV_DIRECTORY}.
 
1088
If this variable is set, default runtime directory and 
 
1089
the value by @code{VFLIB_RUNTIME_DIRECTORY} variable are ignored.
 
1090
 
 
1091
@item @file{t1lib}
 
1092
Encoding vector files for T1Lib (for Type 1 fonts) 
 
1093
are stored in this directory.
 
1094
Note that the file format for encoding vector files used by T1Lib is 
 
1095
different from those used by standard PostScript.
 
1096
To convert standard PostScript encoding vector files
 
1097
into T1Lib format, use @file{mkt1enc.sh} program in this directory.
 
1098
By default, this directory contains files 
 
1099
converted from encoding vector files in the @command{dvips} distribution. 
 
1100
 
 
1101
@item @file{ascii-jtex}
 
1102
In this directory, runtime files for Japanese @TeX{} 
 
1103
by ASCII Coop. are installed.
 
1104
This directory can be changed on runtime by setting 
 
1105
an environment variable @code{VFLIB_ASCII_JTEX_DIRECTORY}.
 
1106
If this variable is set, default runtime directory and 
 
1107
the value by @code{VFLIB_RUNTIME_DIRECTORY} variable are ignored.
 
1108
 
 
1109
@item @file{doc}
 
1110
This directory contains several papers on VFlib, written 
 
1111
by Hirotsugu Kakugawa.
 
1112
@end table
 
1113
 
 
1114
@item @file{/usr/local/share/VFlib/site/}
 
1115
Runtime files (vflibcap, ccv files, etc.) that are created by each site
 
1116
should be placed here.
 
1117
For each versiion of VFlib, it has own runtime directory
 
1118
(@file{/usr/local/share/VFlib/@var{x.y.z}/}) for default settings; 
 
1119
and therefore, the directory where runtime files such as vflibcap in
 
1120
differs by versions of VFlib.
 
1121
In oder to use your own runtime files regardless VFlib versions,
 
1122
runtime files modified for your system environment should be installed 
 
1123
in @file{/usr/local/share/VFlib/site/}, which is called 
 
1124
"site directory".
 
1125
 
 
1126
Before searching in @file{/usr/local/share/VFlib/@var{x.y.z}/},
 
1127
VFlib searches a runtime file in site directory.
 
1128
Note that there is no directory hierarchy in 
 
1129
site directory; all  runtime files are in the same directory.
 
1130
The site directory can be changed by an environment variable
 
1131
@code{VFLIB_RUNTIME_SITE_DIRECTORY}.
 
1132
 
 
1133
@item @file{/usr/local/bin/}
 
1134
Binary programs such as @command{vflserver}, @command{vflx11}, etc 
 
1135
are installed here. 
 
1136
 
 
1137
@item @file{/usr/local/include/}
 
1138
Include file for C programs 
 
1139
@file{VFlib-3_6.h} 
 
1140
is installed here.
 
1141
 
 
1142
@item @file{/usr/local/lib/}
 
1143
VFlib library files such as @file{libVFlib.a}, @file{libVFlib.so} 
 
1144
are installed here.
 
1145
 
 
1146
@end table
 
1147
 
 
1148
Install directories can be changed when you run @code{configure} 
 
1149
script by the @option{--prefix=} option, for example.
 
1150
Invoke @command{configure} with @option{--help} option for details.
 
1151
 
 
1152
 
 
1153
@c ------------------------------------------------------------------------
 
1154
@c      Node,                   Next,               Previous,         Up
 
1155
@node   Programming with VFlib, Writing a vflibcap, Installing VFlib, Top
 
1156
@chapter Programming with VFlib
 
1157
 
 
1158
 
 
1159
@menu
 
1160
* Data types::
 
1161
* Functions and variables::
 
1162
* Building an application software with VFlib::
 
1163
* A simple example::
 
1164
@end menu
 
1165
 
 
1166
 
 
1167
@c      Node,       Next,                Previous, Up
 
1168
@node   Data types, Functions and variables, , Programming with VFlib
 
1169
@section Data types
 
1170
 
 
1171
@menu
 
1172
* bitmap type::
 
1173
* metric1 type::
 
1174
* metric2 type::
 
1175
* outline type::
 
1176
@end menu
 
1177
 
 
1178
 
 
1179
@c      Node,                   Next,                  Up
 
1180
@node   bitmap type, metric1 type, , Data types
 
1181
@subsection bitmap type
 
1182
 
 
1183
A bitmap object is a structure of the following:
 
1184
 
 
1185
@example
 
1186
struct vf_s_bitmap @{
 
1187
  int              bbx_width, bbx_height; /* in pixels */
 
1188
  int              off_x, off_y;          /* in pixels */
 
1189
  int              mv_x,  mv_y;           /* in pixels */
 
1190
  unsigned char*   bitmap;
 
1191
  int              raster;
 
1192
@};
 
1193
typedef struct vf_s_bitmap*  VF_BITMAP;
 
1194
@end example
 
1195
@tindex struct vf_s_bitmap
 
1196
@tindex VF_BITMAP
 
1197
 
 
1198
@code{bbx_width} and @code{bbx_height} are the bitmap width and height. 
 
1199
A pair of @code{off_x} and @code{off_y}) forms a vector to the 
 
1200
left-upper corner of the bitmap from the reference point.  
 
1201
A pair of @code{mv_x} and @code{mv_y} is a vector
 
1202
to the next reference point from the current reference point. 
 
1203
(Positive values indicate a move into the right and upper
 
1204
direction respectively.)
 
1205
 
 
1206
The unit of @code{bbx_width}, @code{bbx_height}, 
 
1207
@code{off_x}, @code{off_y}, @code{mv_x}, and @code{mv_y} is pixels.
 
1208
@code{bitmap} is a pointer to the bitmap data;  one pixel
 
1209
corresponds to one bit.  
 
1210
 
 
1211
The left upper corner is the beginning
 
1212
of the bitmap data, and a raster line is defined as a horizontal
 
1213
line from the left to the right corner of the glyph bitmap. 
 
1214
@code{bitmap} is a sequence of raster lines starting from the top to
 
1215
the bottom.  The distance (in bytes) of two consecutive raster
 
1216
lines in memory is given by @code{raster}.  Although the raster line
 
1217
length of a bitmap is (@code{bbx_width}+7)/8, it is not guaranteed that
 
1218
this value is the same as @code{raster}.
 
1219
The type of @code{bitmap} is a pointer to @code{unsigned char} data object,
 
1220
and each @code{unsigned char} data object contains eight pixels.  
 
1221
Let @code{P[0]} be the start address of a raster line.  The @code{x}-th 
 
1222
pixel counted from the leftmost pixel (which is pixel 0) is 1 if and only if 
 
1223
@code{P[x/8] & (0x80>>(x%8))} is non-zero.  
 
1224
 
 
1225
If @code{bbx_width}
 
1226
is not a multiple of 8, there exist bits that do not correspond 
 
1227
to any pixels but their values are always zero.
 
1228
Even if @code{bbx_width} and/or @code{bbx_height} are zero, at least one
 
1229
byte is allocated for the bitmap data.  Thus, @code{bitmap} is always
 
1230
non-NULL.
 
1231
 
 
1232
 
 
1233
@c      Node,                  Next,                  Previous,            Up
 
1234
@node   metric1 type, metric2 type, bitmap type, Data types
 
1235
@subsection metric1 type
 
1236
 
 
1237
A metric1 object is a structure of the following:
 
1238
 
 
1239
@example
 
1240
struct vf_s_metric1 @{
 
1241
  double    bbx_width, bbx_height;  /* in points */
 
1242
  double    off_x, off_y;           /* in points */
 
1243
  double    mv_x, mv_y;             /* in points */
 
1244
@};
 
1245
typedef struct vf_s_metric1*  VF_METRIC1;
 
1246
@end example
 
1247
@tindex struct vf_s_metric1
 
1248
@tindex VF_METRIC1
 
1249
 
 
1250
 
 
1251
The members of this structure are the same as the members of a
 
1252
bitmap object but the members' unit is point.
 
1253
 
 
1254
 
 
1255
@c      Node,                  Next,                  Previous
 
1256
@node   metric2 type, outline type, metric1 type, Data types
 
1257
@subsection metric2 type
 
1258
 
 
1259
A metric2 object is a structure of the following: 
 
1260
 
 
1261
@example
 
1262
struct vf_s_metric2 @{
 
1263
  int    bbx_width, bbx_height;     /* in pixels */
 
1264
  int    off_x, off_y;              /* in pixels */
 
1265
  int    mv_x, mv_y;                /* in pixels */
 
1266
@};
 
1267
typedef struct vf_s_metric2*  VF_METRIC2;
 
1268
@end example
 
1269
@tindex struct vf_s_metric2
 
1270
@tindex VF_METRIC2
 
1271
 
 
1272
The members of this structure are the same as the members of a
 
1273
bitmap object, and the members' unit is pixel also.
 
1274
 
 
1275
 
 
1276
@c      Node,                    Previous
 
1277
@node   outline type, , metric2 type, Data types
 
1278
@subsection outline type
 
1279
 
 
1280
VFlib defines its private outline data formats for presenting
 
1281
vector data of characters.
 
1282
This data format is used by VFlib API functions 
 
1283
@code{VF_GetOutline()} and @code{VF_OutlineToBitmap()}.
 
1284
 
 
1285
Each font driver returns a outline data of a character of a font
 
1286
if a font driver of that font supports @code{VF_GetOutline()} function. 
 
1287
Even if data format of a font is different from VFlib-format,
 
1288
a font driver converts outline data to VFlib-format data.
 
1289
For instance, the PCF font driver (note that PCF is a bitmap font format)
 
1290
supports @code{VF_GetOutline()} function and it constructs and return 
 
1291
an outline data which is a set of square; each square corresponds
 
1292
to a pixel of a bitmap.
 
1293
 
 
1294
Note that not all font drivers support @code{VF_GetOutline()} function,
 
1295
but most of them do.
 
1296
The developer of font drivers are strongly recommented to
 
1297
implement this feature even if the font font format is bitmap-based.
 
1298
(The function is supported by BDF, PCF, HBF, PK, GF, TFM, Zeit, JG, 
 
1299
TrueType, and Type 1 font drivers.)
 
1300
 
 
1301
Outline data is defined as follows:
 
1302
 
 
1303
@example
 
1304
/* Outline data */
 
1305
typedef long              VF_OUTLINE_ELEM;
 
1306
typedef VF_OUTLINE_ELEM   *VF_OUTLINE;
 
1307
@end example
 
1308
@tindex VF_OUTLINE_ELEM
 
1309
@tindex VF_OUTLINE
 
1310
 
 
1311
According to CPU architecture, @code{VF_OUTLINE_ELEM}
 
1312
is defined as @code{int} if size of @code{long} is 8.
 
1313
 
 
1314
@example
 
1315
typedef long              VF_OUTLINE_ELEM;
 
1316
@end example
 
1317
 
 
1318
Outline data is an array of VF_OUTLINE_ELEM type 
 
1319
(@code{long} or @code{int} type).
 
1320
Outline data consists from two parts: header and outline.
 
1321
The header part contains metric data and outline part contains
 
1322
outline representation of a character.
 
1323
 
 
1324
Documentation for this feature is not finished.
 
1325
See the source code (e.g., @code{VFlib-3_6.h}, @code{raster.c}, 
 
1326
@code{bm2ol}, for example) for further information.
 
1327
 
 
1328
 
 
1329
@c      Node,     f              Next,  
 
1330
@node   Functions and variables, Building an application software with VFlib, Data types, Programming with VFlib
 
1331
@section Functions and variables
 
1332
 
 
1333
 
 
1334
@menu
 
1335
@b{Initialization}
 
1336
* VF_Init()::
 
1337
 
 
1338
@b{Errors}
 
1339
* vf_error::
 
1340
* VF_ClearError()::
 
1341
 
 
1342
@b{Font open and close}
 
1343
* VF_OpenFont1()::
 
1344
* VF_OpenFont2()::
 
1345
* VF_CloseFont()::
 
1346
 
 
1347
@b{Bitmaps and metrics}
 
1348
* VF_GetBitmap1()::
 
1349
* VF_GetBitmap2()::
 
1350
* VF_GetMetric1()::
 
1351
* VF_GetMetric2()::
 
1352
 
 
1353
@b{Outline}
 
1354
* VF_GetOutline()::
 
1355
* VF_OutlineToBitmap()::
 
1356
 
 
1357
@b{Font information}
 
1358
* VF_GetFontBoundingBox1()::
 
1359
* VF_GetFontBoundingBox2()::
 
1360
* VF_GetProp()::
 
1361
 
 
1362
@b{Bitmap operations}
 
1363
* VF_CopyBitmap()::
 
1364
* VF_MakeScaledBitmap()::
 
1365
* VF_ReflectedBitmap()::
 
1366
* VF_RotatedBitmap()::
 
1367
* VF_DumpBitmap()::
 
1368
 
 
1369
@b{Writing a bitmap to file}
 
1370
* VF_ImageOut_PBMAscii()::
 
1371
* VF_ImageOut_PGMAscii()::
 
1372
* VF_ImageOut_PGMRaw()::
 
1373
* VF_ImageOut_EPS()::
 
1374
* VF_ImageOut_ASCIIArt()::
 
1375
* VF_ImageOut_ASCIIArtV()::
 
1376
 
 
1377
@b{Releasing data objects}
 
1378
* VF_FreeBitmap()::
 
1379
* VF_FreeMetric1()::
 
1380
* VF_FreeMetric2()::
 
1381
 
 
1382
@b{Installing a font driver}
 
1383
* VF_InstallFontDriver()::
 
1384
@end menu
 
1385
 
 
1386
 
 
1387
@c    Node,      Next,     Previous, Up
 
1388
@node VF_Init(), vf_error, ,         Functions and variables
 
1389
@subsection @code{VF_Init()}
 
1390
 
 
1391
@example
 
1392
int  VF_Init(char* @var{vflibcap}, char* @var{variable_list})
 
1393
@end example
 
1394
@findex VF_Init
 
1395
 
 
1396
@table @asis
 
1397
@item Functionality
 
1398
  Initialization of VFlib.
 
1399
 
 
1400
@item Arguments
 
1401
 @var{vflibcap} is a file name of vflibcap (this file is 
 
1402
 a font database).  If the null pointer is given, the default
 
1403
 path name given on compile time is used (a typical default
 
1404
 value is @code{/usr/local/lib/VFlib/3.6.12/vflibcap}). 
 
1405
 Searching of a vflibcap file is done in the following way.
 
1406
 First, VFlib try to open a file as given to the first argument.
 
1407
 (That is, VFlib searches it relative to current working directory.)
 
1408
 If not found, then VFlib try to open the file under
 
1409
 default runtime directory (e.g., @code{/usr/local/lib/VFlib/3.6.12/}).
 
1410
 For example, @code{vflibcap-tex} is given, VFlib first look for 
 
1411
 @code{vflibcap-tex} in current directory, and then, it looks for 
 
1412
 the file under runtime directory.
 
1413
 
 
1414
 Default runtime directory can be changed by an environment variable
 
1415
 @code{VFLIB_RUNTIME_DIRECTORY} on runtime.  
 
1416
 If an environment variable @code{VFLIB_VFLIBCAP_PATH} is set,
 
1417
 the first argument of this function is ignored and 
 
1418
 its value is used.
 
1419
 If an environment variable @code{VFLIB_VFLIBCAP_DIRECTORY} is set,
 
1420
 a vflibcap file is searched under a directory sepecified by this 
 
1421
 environment variable. 
 
1422
 
 
1423
 @var{variable_list} is a list of parameters passed to VFlib. 
 
1424
 This is used to specify values of parameterized vflibcap
 
1425
 files.  (See basic.txt for parameterized vflibcap file.) 
 
1426
 The type of this argument is a string and its syntax is a sequence of 
 
1427
 @var{Variable=Value}, separated by a comma @code{,}.
 
1428
 For example, @code{DPI=400, LEVEL=1, FOO=bar}.
 
1429
 
 
1430
@item Return value
 
1431
 If initialization succeeds, a non-negative integer
 
1432
 is returned.  If initialization fails, a negative integer is returned.
 
1433
@end table
 
1434
 
 
1435
 
 
1436
@c    Node,      Next,            Previous,  Up
 
1437
@node vf_error,  VF_ClearError(), VF_Init(), Functions and variables
 
1438
@subsection @code{vf_error}
 
1439
@vindex vf_error
 
1440
 
 
1441
@example
 
1442
int  vf_error 
 
1443
@end example
 
1444
 
 
1445
@table @asis
 
1446
@item Functionality
 
1447
 This is a global variable.
 
1448
 Holding the error code of VFlib.  If no error, it keeps 0.  
 
1449
 If an error occurs, the corresponding error code is set.
 
1450
@end table
 
1451
 
 
1452
@c    Node,            Next,           Previous, Up
 
1453
@node VF_ClearError(), VF_OpenFont1(), vf_error, Functions and variables
 
1454
@subsection @code{VF_ClearError()}
 
1455
@findex VF_ClearError
 
1456
 
 
1457
@example
 
1458
void  VF_ClearError(void)
 
1459
@end example
 
1460
 
 
1461
@table @asis
 
1462
@item Functionality
 
1463
 Clear the error code variable of VFlib.
 
1464
@end table
 
1465
 
 
1466
 
 
1467
@c    Node,            Next,          Previous,     Up
 
1468
@node VF_OpenFont1(), VF_OpenFont2(), VF_ClearError(), Functions and variables
 
1469
@subsection @code{VF_OpenFont1()}
 
1470
@findex VF_OpenFont1
 
1471
 
 
1472
@example
 
1473
int  VF_OpenFont1(char* @var{font_name},
 
1474
                  double @var{dpi_x}, double @var{dpi_y}, double @var{point_size}, 
 
1475
                  double @var{mag_x}, double @var{mag_y})
 
1476
@end example
 
1477
 
 
1478
@table @asis
 
1479
@item Functionality
 
1480
 Open a font.  (If the same font is opened
 
1481
 multiple times, VFlib keeps track of the number of opened
 
1482
 font instances of the font.)  
 
1483
 Since the font is opened with device resolution, point
 
1484
 size and magnification, a font opened by this function 
 
1485
 may be useful for high resolution devices such as laser printers.
 
1486
 
 
1487
@item Arguments
 
1488
 The argument @var{font_name} is a name of the font to be
 
1489
 opened.  The device resolution of the target device is 
 
1490
 specified by @var{dpi_x} (horizontal) @var{dpi_y} (vertical).  
 
1491
 These values are given in DPI (dots per inch).
 
1492
 The argument @var{point_size} specifies the size of the bitmap. 
 
1493
 If this argument is negative the bitmap size will be the
 
1494
 inherent size of the font.
 
1495
 
 
1496
 To obtain a magnified bitmap, give a magnification factor
 
1497
 to the argument @var{mag_x} (horizontal) and @var{mag_y} (vertical).  
 
1498
 If  the argument @var{point_size} is non-negative, font size
 
1499
 will be @var{point_size} times @var{mag_x} (@var{mag_y}) large for
 
1500
 horizontal (vertical) direction.
 
1501
 
 
1502
@item Return Value
 
1503
 A non-negative integer is returned on success. 
 
1504
 This value is a font identifier (font id); it is used to
 
1505
 specify a font for further font operations.  If @code{VF_OpenFont1()}
 
1506
 fails, a negative integer is returned.
 
1507
@end table
 
1508
 
 
1509
 
 
1510
@c    Node,            Next,          Previous,     Up
 
1511
@node VF_OpenFont2(), VF_CloseFont(), VF_OpenFont1(), Functions and variables
 
1512
@subsection @code{VF_OpenFont2()}
 
1513
@findex VF_OpenFont2
 
1514
 
 
1515
@example
 
1516
int  VF_OpenFont2(char* @var{font_name},
 
1517
                  int @var{pixel_size}, double @var{mag_x}, double @var{mag_y})
 
1518
@end example
 
1519
 
 
1520
@table @asis
 
1521
@item Functionality
 
1522
 Open a font.  (If the same font is opened
 
1523
 multiple times, VFlib keeps track of the number of opened
 
1524
 font instances of the font.)  
 
1525
 Since the font is opened with pixel size and magnification,
 
1526
 a font opened by this function may be useful for 
 
1527
 low resolution devices such as CRT display.
 
1528
 
 
1529
@item Arguments
 
1530
 The argument @var{font} is a name of the font to be opened.  
 
1531
 The argument @var{pixel_size} specifies the size of the bitmap. 
 
1532
 If this argument is negative the bitmap size will be the
 
1533
 inherent size of the font.
 
1534
 To obtain a magnified bitmap, give a magnification factor
 
1535
 to the argument @var{mag_x} (horizontal) and @var{mag_y} (vertical).  
 
1536
 If  the argument @var{point_size} is non-negative, font size
 
1537
 will be @var{pixel_size} times @var{mag_x} (@var{mag_y}) large for
 
1538
 horizontal (vertical) direction.
 
1539
 
 
1540
@item Return Value
 
1541
 A non-negative integer is returned on success. 
 
1542
 This value is a font identifier (font id); it is used to
 
1543
 specify a font for further font operations.  If @code{VF_OpenFont2()}
 
1544
 fails, a negative integer is returned.
 
1545
@end table
 
1546
 
 
1547
 
 
1548
@c    Node,           Next,            Previous,       Up
 
1549
@node VF_CloseFont(), VF_GetBitmap1(), VF_OpenFont2(), Functions and variables
 
1550
@subsection @code{VF_CloseFont()}
 
1551
@findex VF_CloseFont
 
1552
 
 
1553
@example
 
1554
int  VF_CloseFont(int @var{font_id})
 
1555
@end example
 
1556
 
 
1557
@table @asis
 
1558
@item Functionality
 
1559
 Close a font.
 
1560
 
 
1561
@item Arguments
 
1562
 The argument @var{font_id} is a font id to be closed.
 
1563
 
 
1564
@item Return Value
 
1565
 A non-negative integer is returned on success.  
 
1566
 A negative integer is returned on failure.
 
1567
@end table
 
1568
 
 
1569
 
 
1570
@c    Node,            Next,            Previous,       Up
 
1571
@node VF_GetBitmap1(), VF_GetBitmap2(), VF_CloseFont(), Functions and variables
 
1572
@subsection @code{VF_GetBitmap1()}
 
1573
@findex VF_GetBitmap1
 
1574
 
 
1575
@example
 
1576
VF_BITMAP  VF_GetBitmap1(int @var{font_id}, long @var{code_point},
 
1577
                         double @var{mag_x}, double @var{mag_y})
 
1578
@end example
 
1579
 
 
1580
@table @asis
 
1581
@item Functionality
 
1582
  Obtain a glyph bitmap of given font id and code
 
1583
  point.  The font id @var{font_id} must be an id by @code{VF_OpenFont1()}.
 
1584
  Size of bitmap to be obtained can be specified by 
 
1585
  @var{mag_x} and @var{mag_y} arguments.
 
1586
 
 
1587
@item Arguments
 
1588
 @var{font_id} specifies the font; @var{code_point} specifies
 
1589
  the code point of a character. 
 
1590
  To obtain a magnified bitmap, give a magnification factor
 
1591
  to the argument @var{mag_x} (horizontal) and @var{mag_y} (vertical).
 
1592
  If a font is opened with magnification factor 2 and an bitmap
 
1593
  is obtained by this function with magnification factor 2,
 
1594
  then the size of yielding bitmap will be 4 times larger than
 
1595
  the original size.
 
1596
 
 
1597
@item Return Value
 
1598
  The return value is a pointer to a newly
 
1599
  allocated bitmap object.  If it fails to obtain a bitmap, the
 
1600
  null pointer is returned.  If the bitmap object is no longer
 
1601
  needed, it must be released by the function @code{VF_FreeBitmap()}.
 
1602
  The font may not have the specified size; in such case,
 
1603
  VFlib internally enlarges or shrinks the glyph to obtain 
 
1604
  a bitmap of the requested size.
 
1605
@end table
 
1606
 
 
1607
 
 
1608
@c    Node,            Next,            Previous,         Up
 
1609
@node VF_GetBitmap2(), VF_GetMetric1(), VF_GetBitmap1(), Functions and variables
 
1610
@subsection @code{VF_GetBitmap2()}
 
1611
@findex VF_GetBitmap2
 
1612
 
 
1613
@example 
 
1614
VF_BITMAP  VF_GetBitmap2(int @var{font_id}, long @var{code_point},
 
1615
                         double @var{mag_x}, double @var{mag_y})
 
1616
@end example
 
1617
 
 
1618
@table @asis
 
1619
@item Functionality
 
1620
 Obtain a glyph bitmap of given font id and code
 
1621
 point.  The font id 'font_id' must be an id by @code{VF_OpenFont2()}.
 
1622
 Size of bitmap to be obtained can be specified by @var{pixel_size},
 
1623
 @var{mag_x} and @var{mag_y} arguments.
 
1624
 
 
1625
@item Arguments
 
1626
 @var{font_id} specifies the font; @var{code_point} specifies
 
1627
 the code point of a character. 
 
1628
 To obtain a magnified bitmap, give a magnification factor
 
1629
 to the argument @var{mag_x} (horizontal) and @var{mag_y} (vertical).
 
1630
 If a font is opened with magnification factor 2 and an bitmap
 
1631
 is obtained by this function with magnification factor 2,
 
1632
 then the size of yielding bitmap will be 4 times larger than
 
1633
 the original size.
 
1634
 
 
1635
@item Return Value
 
1636
 The return value is a pointer to a newly
 
1637
 allocated bitmap object.  If it fails to obtain a bitmap, the
 
1638
 null pointer is returned.  If the bitmap object is no longer
 
1639
 needed, it must be released by the function @code{VF_FreeBitmap()}.
 
1640
 The font may not have the specified size; in such case,
 
1641
 VFlib internally enlarges or shrinks the glyph to obtain 
 
1642
 a bitmap of the requested size.
 
1643
@end table
 
1644
 
 
1645
 
 
1646
@c    Node,            Next,            Previous,         Up
 
1647
@node VF_GetMetric1(), VF_GetMetric2(), VF_GetBitmap2(), Functions and variables
 
1648
@subsection @code{VF_GetMetric1()}
 
1649
@findex VF_GetMetric1
 
1650
 
 
1651
@example 
 
1652
VF_METRIC1  VF_GetMetric1(int @var{font_id}, long @var{code_point},
 
1653
                          VF_METRIC1 @var{metric1},
 
1654
                          double @var{mag_x}, double @var{mag_y})
 
1655
@end example
 
1656
 
 
1657
@table @asis
 
1658
@item Functionality
 
1659
 Obtain font metrics of a given font and code point.
 
1660
 
 
1661
@item Arguments
 
1662
  Same arguments as of @code{VF_GetBitmap1()}.
 
1663
 
 
1664
@item Return Value
 
1665
  A pointer to a metric1 object is returned.  If an
 
1666
  error occurs, the NULL pointer is returned.  The obtained
 
1667
  metric is a metric for a bitmap obtained by @code{VF_GetBitmap1()}
 
1668
  with the same arguments, but the unit of the obtained metric
 
1669
  is point. If the metric1 object is no longer needed it must be
 
1670
  released by the function @code{VF_FreeMetric1()}.
 
1671
@end table
 
1672
 
 
1673
 
 
1674
@c    Node,            Next,            Previous,        Up
 
1675
@node VF_GetMetric2(), VF_GetOutline(), VF_GetMetric1(), Functions and variables
 
1676
@subsection @code{VF_GetMetric2()}
 
1677
@findex VF_GetMetric2
 
1678
 
 
1679
@example
 
1680
VF_METRIC2  VF_GetMetric2(int @var{font_id}, long @var{code_point},
 
1681
                          VF_METRIC2 @var{metric2},
 
1682
                          double @var{mag_x}, double @var{mag_y})
 
1683
@end example
 
1684
 
 
1685
@table @asis
 
1686
@item Functionality
 
1687
 Obtain font metrics of a given font and code point.
 
1688
 
 
1689
@item Arguments
 
1690
 Same arguments as of @code{VF_GetBitmap2()}.
 
1691
 
 
1692
@item Return Value
 
1693
  A pointer to a metric2 object is returned.  If an
 
1694
  error occurs, the NULL pointer is returned.  The obtained
 
1695
  metric is a metric for a bitmap obtained by @code{VF_GetBitmap2()}
 
1696
  with the same arguments, but the unit of the obtained metric
 
1697
  is pixel.  If the metric2 object is no longer needed, it must be
 
1698
  released by the function @code{VF_FreeMetric2()}.
 
1699
@end table
 
1700
 
 
1701
 
 
1702
@c    Node,            Next,                 Previous,        Up
 
1703
@node VF_GetOutline(), VF_OutlineToBitmap(), VF_GetMetric2(), Functions and variables
 
1704
@subsection @code{VF_GetOutline()}
 
1705
@findex VF_GetOutline
 
1706
 
 
1707
@example
 
1708
VF_OUTLINE  VF_GetOutline(int @var{font_id}, long @var{code_point},
 
1709
                          double @var{mag_x}, double @var{mag_y})
 
1710
@end example
 
1711
 
 
1712
@table @asis
 
1713
@item Functionality
 
1714
 Obtain outline data from a given font and code point.
 
1715
 
 
1716
@item Arguments
 
1717
 Same as @code{VF_GetBitmap1()}.
 
1718
 
 
1719
@item Return Value
 
1720
  Return value is a pointer to a newly allocated
 
1721
  outline data object.  If it fails to obtain a outline data,
 
1722
  the NULL pointer is returned.
 
1723
  Even if the original font is a bitmap, VFlib internally
 
1724
  creates outline data from the bitmap.  If the source font is
 
1725
  a vector font, VFlib internally converts the data format to
 
1726
  VFlib outline data style.  A bitmap of any specified size can
 
1727
  be obtained from outline data by the function
 
1728
  @code{VF_Outline2Bitmap()}.  (Default point size and device
 
1729
  resolution is also kept in the outline data.)
 
1730
@end table
 
1731
 
 
1732
 
 
1733
@c    Node,                 Next,         Previous,        Up
 
1734
@node VF_OutlineToBitmap(), VF_GetFontBoundingBox1(), VF_GetOutline(), Functions and variables
 
1735
@subsection @code{VF_OutlineToBitmap()}
 
1736
@findex VF_OutlineToBitmap
 
1737
 
 
1738
@example
 
1739
VF_OUTLINE  VF_OutlineToBitmap(VF_OUTLINE @var{outline},
 
1740
                               double @var{dpi_x}, double @var{dpi_y}, 
 
1741
                               double @var{point_size},
 
1742
                               double @var{mag_x}, double @var{mag_y})
 
1743
@end example
 
1744
 
 
1745
@table @asis
 
1746
@item Functionality
 
1747
 Obtain a bitmap from outline data.
 
1748
 
 
1749
@item Arguments
 
1750
 The argument @var{outline} is a pointer to an outline
 
1751
 object to be rasterised.  The arguments @var{dpi_x}, @var{dpi_y},
 
1752
 @var{point_size}, @var{mag_x} and @var{mag_y}  are the same as the
 
1753
 corresponding arguments of @code{VF_GetBitmap1()}.  The outline data
 
1754
 contains information on device resolution and point size
 
1755
 specified by @code{VF_GetOutline()}.  (If not specified, default
 
1756
 values are used. Thus, bitmaps with a default size can be
 
1757
 obtained by giving -1 for the arguments).
 
1758
 
 
1759
@item Return Value
 
1760
  A pointer to a bitmap object is returned.  
 
1761
  The NULL pointer is returned on failure.  If the bitmap object is
 
1762
  no longer needed it must be released by the function
 
1763
  @code{VF_FreeBitmap()}.
 
1764
@end table
 
1765
 
 
1766
 
 
1767
@c    Node,         Next,            Previous,             Up
 
1768
@node VF_GetFontBoundingBox1(), VF_GetFontBoundingBox2(), VF_OutlineToBitmap(), Functions and variables
 
1769
@subsection @code{VF_GetFontBoundingBox1()}
 
1770
@findex VF_GetFontBoundingBox1
 
1771
 
 
1772
@example
 
1773
int  VF_GetFontBoundingBox1(int @var{font_id}, 
 
1774
                            double @var{mag_x}, double @var{mag_y},
 
1775
                            double* @var{w}, double* @var{h},
 
1776
                            double* @var{xoff}, double* @var{yoff})
 
1777
@end example
 
1778
 
 
1779
@table @asis
 
1780
@item Functionality
 
1781
 Obtain font bounding box information of a given font.
 
1782
 
 
1783
@item Arguments
 
1784
 The argument @var{font_id} specify a font in interest.
 
1785
 The function writes the bounding box information to the locations
 
1786
 pointed by @var{w}, @var{h}, @var{xoff}, and @var{yoff}.  
 
1787
 @var{w} and @var{h} point to data objects for width and height
 
1788
 of bounding box, respectively.
 
1789
 @var{xoff} and @var{yoff} point to data objects for largest 
 
1790
 horizontal and vertical displacement of lower left corner of 
 
1791
 bounding box from reference points.
 
1792
 Note that these values does not guarantee the minimality;
 
1793
 they only guarantee that all characters can be contained in
 
1794
 a box descrived by them.
 
1795
 If some values of @var{w}, @var{h}, @var{xoff}, or @var{yoff} are 
 
1796
 not in interest, NULL pointer can be given.
 
1797
 
 
1798
 The argument @var{mag_x} and @var{mag_y} are maginification factor
 
1799
 to be scaled for a given font @var{font_id}.
 
1800
 
 
1801
@item Return Value
 
1802
  If font bounding information is successfully obtained, 
 
1803
 a non-negative integer is returned; otherwize, negative integer is 
 
1804
 returned.
 
1805
 
 
1806
 Units of bounding box information is in point.
 
1807
@end table
 
1808
 
 
1809
 
 
1810
 
 
1811
@c    Node,         Next,            Previous,             Up
 
1812
@node VF_GetFontBoundingBox2(), VF_GetProp(), VF_GetFontBoundingBox1(), Functions and variables
 
1813
@subsection @code{VF_GetFontBoundingBox2()}
 
1814
@findex VF_GetFontBoundingBox2
 
1815
 
 
1816
@example
 
1817
int  VF_GetFontBoundingBox2(int @var{font_id}, 
 
1818
                            double @var{mag_x}, double @var{mag_y},
 
1819
                            int* @var{w}, int* @var{h},
 
1820
                            int* @var{xoff}, int* @var{yoff})
 
1821
@end example
 
1822
 
 
1823
Same as @code{VF_GetFontBoundingBox1()} except units of 
 
1824
font bounding box parameters are pixel.
 
1825
 
 
1826
 
 
1827
@c    Node,         Next,            Previous,             Up
 
1828
@node VF_GetProp(), VF_CopyBitmap(), VF_GetFontBoundingBox2(), Functions and variables
 
1829
@subsection @code{VF_GetProp()}
 
1830
@findex VF_GetProp
 
1831
 
 
1832
@example
 
1833
char*  VF_GetProp(int @var{font_id}, char* @var{prop_name})
 
1834
@end example
 
1835
 
 
1836
@table @asis
 
1837
@item Functionality
 
1838
 Obtain a property of given font.  (This function
 
1839
 is font class dependent. You must be very careful to use it!)
 
1840
 
 
1841
@item Arguments
 
1842
 The argument @var{font_id} specifies a font from which to
 
1843
 obtain a property. @var{property_name} specifies the property name.
 
1844
 
 
1845
@item Return Value
 
1846
 If the given property exists, its value is
 
1847
 returned as a string.  The string for the property value is
 
1848
 newly allocated and must be released by @var{free()} if it is no
 
1849
 longer needed.  If the given property is undefined, the NULL
 
1850
 pointer is returned.
 
1851
@end table
 
1852
 
 
1853
 
 
1854
@c    Node,            Next,                  Previous,     Up
 
1855
@node VF_CopyBitmap(), VF_MakeScaledBitmap(), VF_GetProp(), Functions and variables
 
1856
@subsection @code{VF_CopyBitmap()}
 
1857
@findex VF_CopyBitmap
 
1858
 
 
1859
@example
 
1860
VF_BITMAP  VF_CopyBitmap(VF_BITMAP @var{bm})
 
1861
@end example
 
1862
 
 
1863
@table @asis
 
1864
@item Functionality
 
1865
 Make a copy of a bitmap object.
 
1866
 
 
1867
@item Arguments
 
1868
 The argument @var{bm} is a pointer to a bitmap object to be copied.
 
1869
 
 
1870
@item Return Value
 
1871
 A new bitmap object is allocated; all values are
 
1872
 copied.  Return value is a pointer to a new bitmap.  The
 
1873
 source bitmap @var{bm} remains unaffected.  If an error occurs,
 
1874
 the NULL pointer is returned.
 
1875
 The obtained bitmap object must be released by
 
1876
 @code{VF_FreeBitmap()} if it is no longer needed.
 
1877
@end table
 
1878
 
 
1879
 
 
1880
@c    Node,                  Next,            Previous,        Up
 
1881
@node VF_MakeScaledBitmap(), VF_ReflectedBitmap(), VF_CopyBitmap(), Functions and variables
 
1882
@subsection @code{VF_MakeScaledBitmap()}
 
1883
@findex VF_MakeScaledBitmap
 
1884
 
 
1885
@example
 
1886
VF_BITMAP  VF_MakeScaledBitmap(VF_BITMAP @var{bm}, 
 
1887
                               double @var{mag_x}, double @var{mag_y})
 
1888
@end example
 
1889
 
 
1890
@table @asis
 
1891
@item Functionality
 
1892
 Make an enlarged or shrinked bitmap.
 
1893
 
 
1894
@item Arguments
 
1895
 The argument @var{bm} specifies the source bitmap object,
 
1896
 @var{mag_x} and @var{mag_y} give the magnification factor in the
 
1897
 horizontal and vertical direction respectively.  If the
 
1898
 magnification factor is less than 1, a shrinked bitmap is
 
1899
 obtained.  Values for @var{mag_x} and @var{mag_y} can be arbitrary
 
1900
 such as 
 
1901
 (@math{@var{mag_x} > 1} and @math{@var{mag_y} < 1})
 
1902
 or (@math{@var{mag_x} < 1} and @math{@var{mag_y} > 1}).
 
1903
 
 
1904
@item Return Value
 
1905
 A bitmap object whose bitmap is enlarged or
 
1906
 shrinked is created and a pointer to the new bitmap is
 
1907
 returned.  If an error occurs, the NULL pointer is returned. 
 
1908
 The source bitmap @var{bm} remains unaffected.
 
1909
 Use @code{VF_FreeBitmap()} if the returned bitmap object 
 
1910
 is no longer necessary.
 
1911
@end table
 
1912
 
 
1913
 
 
1914
@c    Node,                  Next,            Previous,        Up
 
1915
@node VF_ReflectedBitmap(), VF_RotatedBitmap(), VF_MakeScaledBitmap(), Functions and variables
 
1916
@subsection @code{VF_ReflectedBitmap()}
 
1917
@findex VF_ReflectedBitmap
 
1918
 
 
1919
@example
 
1920
VF_BITMAP  VF_ReflectedBitmap(VF_BITMAP @var{bm}, 
 
1921
                              int @var{refl_x}, double @var{refl_y})
 
1922
@end example
 
1923
 
 
1924
@table @asis
 
1925
@item Functionality
 
1926
 Make a bitmap with horizontally and/or vertically reflected image.
 
1927
 
 
1928
@item Arguments
 
1929
 The argument @var{bm} specifies the source bitmap object,
 
1930
 @var{refl_x} and @var{refl_y} specify the reflection, respectively.
 
1931
 If @var{refl_x} is non-zero, the image is holizontally reflected;
 
1932
 if @var{refl_y} is non-zero, the image is vertically reflected.
 
1933
 In case @var{relf_x} and @var{refl_y} are both zero,
 
1934
 the effect is the same as @code{VF_CopyBitmap()}.
 
1935
 
 
1936
@item Return Value
 
1937
 A new bitmap object is created and a pointer to the new bitmap is
 
1938
 returned.  If an error occurs, the NULL pointer is returned. 
 
1939
 Metrics of created bitmap is the same as that of the original bitmap.
 
1940
 The source bitmap @var{bm} remains unaffected.
 
1941
 Use @code{VF_FreeBitmap()} if the returned bitmap object 
 
1942
 is no longer necessary.
 
1943
@end table
 
1944
 
 
1945
 
 
1946
@c    Node,                  Next,            Previous,        Up
 
1947
@node VF_RotatedBitmap(), VF_DumpBitmap(), VF_ReflectedBitmap(), Functions and variables
 
1948
@subsection @code{VF_RotatedBitmap()}
 
1949
@findex VF_RotatedBitmap
 
1950
 
 
1951
@example
 
1952
VF_BITMAP  VF_RotatedBitmap(VF_BITMAP @var{bm}, int @var{angle})
 
1953
@end example
 
1954
 
 
1955
@table @asis
 
1956
@item Functionality
 
1957
 Make a bitmap image with rotated image.
 
1958
 
 
1959
@item Arguments
 
1960
 The argument @var{bm} specifies the source bitmap object,
 
1961
 @var{angle} gives rotation angle in degree.
 
1962
 By the limitation of implementation, rotatin angle must be multiple of 90.
 
1963
 The rotation angle @var{angle} must be one of the following:
 
1964
@table @code
 
1965
@item VF_BM_ROTATE_0
 
1966
  Rotation angle is zero.
 
1967
  Thus,  the effect is the same as @code{VF_CopyBitmap()}.
 
1968
@item VF_BM_ROTATE_90
 
1969
  Rotation angle is 90 degree.
 
1970
@item VF_BM_ROTATE_180
 
1971
  Rotation angle is 180 degree.
 
1972
@item VF_BM_ROTATE_270
 
1973
  Rotation angle is 270 degree.
 
1974
@end table
 
1975
 
 
1976
@item Return Value
 
1977
 A bitmap object whose bitmap is rotated is created and 
 
1978
 a pointer to the new bitmap is returned.  
 
1979
 If an error occurs, the NULL pointer is returned. 
 
1980
 The source bitmap @var{bm} remains unaffected.
 
1981
 Use @code{VF_FreeBitmap()} if the bitmap object is no longer necessary.
 
1982
 
 
1983
 This function rotates a bitmap with the reference point as origin.
 
1984
 The vector to the next reference point is also rotated.
 
1985
 Therefore, position of the reference point 
 
1986
 and a vector to the next reference point 
 
1987
 of 
 
1988
   @code{VF_RotatedBitmap(@var{bm}, VF_BM_ROTATE_180)}
 
1989
 and that of 
 
1990
   @code{VF_ReflectedBitmap(@var{bm}, 1, 1)}
 
1991
 are different.
 
1992
@end table
 
1993
 
 
1994
 
 
1995
@c    Node,           Next,                    Previous,               Up
 
1996
@node VF_DumpBitmap(), VF_ImageOut_PBMAscii(), VF_RotatedBitmap(), Functions and variables
 
1997
@subsection @code{VF_DumpBitmap()}
 
1998
@findex VF_DumpBitmap
 
1999
 
 
2000
@example
 
2001
void  VF_DumpBitmap(VF_BITMAP @var{bm})
 
2002
@end example
 
2003
 
 
2004
@table @asis
 
2005
@item Functionality
 
2006
 Print a bitmap in ASCII-art-style to stdout.
 
2007
 
 
2008
@item Arguments
 
2009
 The argument @var{bm} specifies a bitmap to be displayed.
 
2010
 
 
2011
@end table
 
2012
 
 
2013
 
 
2014
@c    Node,                   Next,                   Previous,        Up
 
2015
@node VF_ImageOut_PBMAscii(), VF_ImageOut_PGMAscii(), VF_DumpBitmap(), Functions and variables
 
2016
@subsection @code{VF_ImageOut_PBMAscii()}
 
2017
@findex VF_ImageOut_PBMAscii
 
2018
 
 
2019
@example
 
2020
int  VF_ImageOut_PBMAscii(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2021
                          int @var{image_width}, int @var{image_height},
 
2022
                          int @var{position_x}, int @var{position_y}, 
 
2023
                          int @var{margin_l}, int @var{margin_r},
 
2024
                          int @var{margin_t}, int @var{margin_b},
 
2025
                          int @var{reverse}, int @var{shrink},
 
2026
                          char *@var{prog}, char *@var{title})
 
2027
@end example
 
2028
 
 
2029
@table @asis
 
2030
@item Functionality
 
2031
 Print a bitmap @var{bm} in PBM ASCII format to a file stream @var{fp}.
 
2032
 
 
2033
@item Arguments
 
2034
 @var{bm} is a bitmap to be written to a file stream @var{fp}.
 
2035
Size of output image (in pixel) is specified by @var{image_width} 
 
2036
and @var{image_height}.
 
2037
If -1 is given for these arguments, the image size should be minimum
 
2038
to contain the bitmap @var{bm}.
 
2039
 
 
2040
Arguments @var{position_x} and @var{position_y} specifies 
 
2041
the horizontal and vertical position of a source bitmap @var{bm} 
 
2042
in an output image file, respectively.
 
2043
These parameters have effect when @var{image_width} and @var{image_height}
 
2044
are specified.
 
2045
Possible values for @var{position_x} is
 
2046
@table @code
 
2047
@item VF_IMAGEOUT_POSITION_NONE
 
2048
  Same as @code{VF_IMAGEOUT_POSITION_LEFT}.
 
2049
@item VF_IMAGEOUT_POSITION_CENTER
 
2050
  @var{bm} is centered in output image.
 
2051
@item VF_IMAGEOUT_POSITION_LEFT
 
2052
  @var{bm} is flushed left in output image.
 
2053
@item VF_IMAGEOUT_POSITION_RIGHT
 
2054
  @var{bm} is flushed righted in output image.
 
2055
@end table
 
2056
 
 
2057
Possible values for @var{position_y} is
 
2058
@table @code
 
2059
@item VF_IMAGEOUT_POSITION_NONE
 
2060
  Same as @code{VF_IMAGEOUT_POSITION_TOP}.
 
2061
@item VF_IMAGEOUT_POSITION_CENTER
 
2062
  @var{bm} is centered in output image.
 
2063
@item VF_IMAGEOUT_POSITION_TOP
 
2064
  @var{bm} is placed at the top in output image.
 
2065
@item VF_IMAGEOUT_POSITION_BOTTOM
 
2066
  @var{bm} is placed at the bottom in output image.
 
2067
@end table
 
2068
 
 
2069
Arguments @var{margin_l}, int @var{margin_r} are used to speficy 
 
2070
left and right margins, respectively.
 
2071
Arguments @var{margin_t}, int @var{margin_b} are used to speficy 
 
2072
top and bottom margins, respectively.
 
2073
 
 
2074
If the argument @var{reverse} is not 0, black and white in an output image
 
2075
is reversed.
 
2076
Argument @var{shrink} specifys shrink factor of image @var{bm}.
 
2077
(If this value is 1, @var{bm} is not shrinked.
 
2078
Note: Currently, shrinking image is not supported in PBM ASCII format.)
 
2079
 
 
2080
Arguments @var{prog} and @var{title} are used to emmbed program name
 
2081
and title in an image file.
 
2082
 
 
2083
@end table
 
2084
 
 
2085
 
 
2086
@c    Node,                   Next,                   Previous,        Up
 
2087
@node VF_ImageOut_PGMAscii(), VF_ImageOut_PGMRaw(), VF_ImageOut_PBMAscii(), Functions and variables
 
2088
@subsection @code{VF_ImageOut_PGMAscii()}
 
2089
@findex VF_ImageOut_PGMAscii
 
2090
 
 
2091
@example
 
2092
int  VF_ImageOut_PGMAscii(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2093
                          int @var{image_width}, int @var{image_height},
 
2094
                          int @var{position_x}, int @var{position_y}, 
 
2095
                          int @var{margin_l}, int @var{margin_r},
 
2096
                          int @var{margin_t}, int @var{margin_b},
 
2097
                          int @var{reverse}, int @var{shrink},
 
2098
                          char *@var{prog}, char *@var{title})
 
2099
@end example
 
2100
 
 
2101
@table @asis
 
2102
@item Functionality
 
2103
 Print a bitmap @var{bm} in PGM ASCII format to a file stream @var{fp}.
 
2104
 
 
2105
@item Arguments
 
2106
 Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
 
2107
If @var{shrink} is greater than 1, output image is anti-aliased (gray-scaled).
 
2108
@end table
 
2109
 
 
2110
 
 
2111
@c    Node,                   Next,                   Previous,        Up
 
2112
@node VF_ImageOut_PGMRaw(), VF_ImageOut_EPS(), VF_ImageOut_PGMAscii(), Functions and variables
 
2113
@subsection @code{VF_ImageOut_PGMRaw()}
 
2114
@findex VF_ImageOut_PGMRaw
 
2115
 
 
2116
@example
 
2117
int  VF_ImageOut_PGMRaw(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2118
                        int @var{image_width}, int @var{image_height},
 
2119
                        int @var{position_x}, int @var{position_y}, 
 
2120
                        int @var{margin_l}, int @var{margin_r},
 
2121
                        int @var{margin_t}, int @var{margin_b},
 
2122
                        int @var{reverse}, int @var{shrink},
 
2123
                        char *@var{prog}, char *@var{title})
 
2124
@end example
 
2125
 
 
2126
@table @asis
 
2127
@item Functionality
 
2128
 Print a bitmap @var{bm} in PGM Raw format to a file stream @var{fp}.
 
2129
 
 
2130
@item Arguments
 
2131
 Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
 
2132
If @var{shrink} is greater than 1, output image is anti-aliased (gray-scaled).
 
2133
@end table
 
2134
 
 
2135
 
 
2136
@c    Node,                   Next,                   Previous,        Up
 
2137
@node VF_ImageOut_EPS(), VF_ImageOut_ASCIIArt(), VF_ImageOut_PGMRaw(), Functions and variables
 
2138
@subsection @code{VF_ImageOut_EPS()}
 
2139
@findex VF_ImageOut_EPS
 
2140
 
 
2141
@example
 
2142
int  VF_ImageOut_EPS(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2143
                     int @var{image_width}, int @var{image_height},
 
2144
                     int @var{position_x}, int @var{position_y}, 
 
2145
                     int @var{margin_l}, int @var{margin_r},
 
2146
                     int @var{margin_t}, int @var{margin_b},
 
2147
                     int @var{reverse}, int @var{shrink},
 
2148
                     char *@var{prog}, char *@var{title},
 
2149
                     double @var{ptsize}, int @var{pixsize})
 
2150
@end example
 
2151
 
 
2152
@table @asis
 
2153
@item Functionality
 
2154
 Print a bitmap @var{bm} in EPS (Encapsulated PostScript)
 
2155
format to a file stream @var{fp}.
 
2156
 
 
2157
@item Arguments
 
2158
 Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
 
2159
If @var{shrink} is greater than 1, output image is anti-aliased (gray-scaled).
 
2160
Arguments @var{ptsize} and @var{pixsize} specify size of EPS bounding box;
 
2161
@var{pixsize} pixels occupy @var{ptsize} points in physical paper.
 
2162
@end table
 
2163
 
 
2164
@c    Node,                   Next,                   Previous,        Up
 
2165
@node VF_ImageOut_ASCIIArt(), VF_ImageOut_ASCIIArtV(), VF_ImageOut_EPS(), Functions and variables
 
2166
@subsection @code{VF_ImageOut_ASCIIArt()}
 
2167
@findex VF_ImageOut_ASCIIArt
 
2168
 
 
2169
@example
 
2170
int  VF_ImageOut_ASCIIArt(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2171
                          int @var{image_width}, int @var{image_height},
 
2172
                          int @var{position_x}, int @var{position_y}, 
 
2173
                          int @var{margin_l}, int @var{margin_r},
 
2174
                          int @var{margin_t}, int @var{margin_b},
 
2175
                          int @var{reverse}, int @var{shrink})
 
2176
@end example
 
2177
 
 
2178
@table @asis
 
2179
@item Functionality
 
2180
 Print a bitmap @var{bm} in ASCII art format to a file stream @var{fp}.
 
2181
 
 
2182
@item Arguments
 
2183
 Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
 
2184
@end table
 
2185
 
 
2186
 
 
2187
@c    Node,                   Next,                   Previous,        Up
 
2188
@node VF_ImageOut_ASCIIArtV(), VF_FreeBitmap(), VF_ImageOut_ASCIIArt(), Functions and variables
 
2189
@subsection @code{VF_ImageOut_ASCIIArtV()}
 
2190
@findex VF_ImageOut_ASCIIArtV
 
2191
 
 
2192
@example
 
2193
int  VF_ImageOut_ASCIIArtV(VF_BITMAP @var{bm}, FILE *@var{fp}, 
 
2194
                           int @var{image_width}, int @var{image_height},
 
2195
                           int @var{position_x}, int @var{position_y}, 
 
2196
                           int @var{margin_l}, int @var{margin_r},
 
2197
                           int @var{margin_t}, int @var{margin_b},
 
2198
                           int @var{reverse}, int @var{shrink})
 
2199
@end example
 
2200
 
 
2201
@table @asis
 
2202
@item Functionality
 
2203
 Print a bitmap @var{bm} in ASCII art format to a file stream @var{fp}.
 
2204
Image is rotated in clockwise, 90 degree.
 
2205
 
 
2206
@item Arguments
 
2207
 Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
 
2208
@end table
 
2209
 
 
2210
 
 
2211
@c    Node,            Next,             Previous,                Up
 
2212
@node VF_FreeBitmap(), VF_FreeMetric1(), VF_ImageOut_ASCIIArtV(), Functions and variables
 
2213
@subsection @code{VF_FreeBitmap()}
 
2214
@findex VF_FreeBitmap
 
2215
 
 
2216
@example
 
2217
void  VF_FreeBitmap(VF_BITMAP @var{bm})
 
2218
@end example
 
2219
 
 
2220
@table @asis
 
2221
@item Functionality
 
2222
 Release a bitmap object.
 
2223
 
 
2224
@item Arguments
 
2225
 The argument @var{bm} is a pointer to a bitmap object to be released.
 
2226
@end table
 
2227
       
 
2228
 
 
2229
 
 
2230
@c    Node,             Next,             Previous,        Up
 
2231
@node VF_FreeMetric1(), VF_FreeMetric2(), VF_FreeBitmap(), Functions and variables
 
2232
@subsection @code{VF_FreeMetric1()}
 
2233
@findex VF_FreeMetric1
 
2234
 
 
2235
@example
 
2236
void  VF_FreeMetric1(VF_METRIC1 @var{metric})
 
2237
@end example
 
2238
 
 
2239
@table @asis
 
2240
@item Functionality
 
2241
 Release a metric1 object.
 
2242
 
 
2243
@item Arguments
 
2244
 The argument @var{metric} is a pointer to a metric1 object.
 
2245
@end table
 
2246
 
 
2247
 
 
2248
@c    Node,             Next,                   Previous,         Up
 
2249
@node VF_FreeMetric2(), VF_InstallFontDriver(), VF_FreeMetric1(), Functions and variables
 
2250
@subsection @code{VF_FreeMetric2()}
 
2251
@findex VF_FreeMetric2
 
2252
 
 
2253
@example
 
2254
void  VF_FreeMetric2(VF_METRIC2 @var{metric})
 
2255
@end example
 
2256
 
 
2257
@table @asis
 
2258
@item Functionality
 
2259
 Release a metric2 object.
 
2260
 
 
2261
@item Arguments
 
2262
 The argument @var{metric} is a pointer to a metric2 object.
 
2263
 
 
2264
@end table
 
2265
 
 
2266
 
 
2267
@c    Node,               Next, Previous,         Up
 
2268
@node VF_InstallFontDriver(), , VF_FreeMetric2(), Functions and variables
 
2269
@subsection @code{VF_InstallFontDriver()}
 
2270
@findex VF_InstallFontDriver
 
2271
 
 
2272
@example
 
2273
int  VF_InstallFontDriver(char* @var{class_name}, 
 
2274
                          int(*driver)(VF_FONT @var{font}, 
 
2275
                                       char* @var{class_name},
 
2276
                                       char* @var{font_name},
 
2277
                                       int @var{implicit_flag}));
 
2278
@end example
 
2279
 
 
2280
@table @asis
 
2281
@item Functionality
 
2282
 Install a font driver.
 
2283
 
 
2284
@item Arguments
 
2285
@var{class_name} is a font class name, @var{driver} is a
 
2286
pointer to a function of a font driver of the font class. 
 
2287
The function given by @var{driver} is called when a font of this
 
2288
font class is opened by @code{VF_OpenFont1()} and @code{VF_OpenFont2()}.
 
2289
The function @var{driver} is called with parameters of the font
 
2290
to be opened: @var{font} is a data object for font management
 
2291
defined by VFlib internally.  @var{class_name} is the font
 
2292
class name.  @var{font_name} is the name of the font to be
 
2293
opened.  This argument is the same as the argument of
 
2294
@code{VF_OpenFont1()} and @code{VF_OpenFont2()}.  
 
2295
@var{implicit_font} is 
 
2296
a flag whose value is 1 if a font is to be opened as an 
 
2297
implicit font (a font which does not explicitly appear in 
 
2298
vflibcap) and 0 if it is to be opened as an explicit font 
 
2299
(a font that does appear in vflibcap).
 
2300
 
 
2301
@item Return Value
 
2302
If successful, a non-negative integer is returned. 
 
2303
A negative integer is returned if the installation of the
 
2304
font driver fails.
 
2305
@end table
 
2306
 
 
2307
 
 
2308
 
 
2309
@c    Node,                                   Next,  Previous,                Up
 
2310
@node Building an application software with VFlib, A simple example, Functions and variables, Programming with VFlib
 
2311
@section Building an application software with VFlib
 
2312
 
 
2313
An application software that use VFlib must include 
 
2314
a header file 
 
2315
@file{VFlib-3_6.h}.
 
2316
@iftex
 
2317
@cindex VFlib-3\_6.h
 
2318
@end iftex
 
2319
@ifinfo
 
2320
@cindex VFlib-3_6.h
 
2321
@end ifinfo
 
2322
Typically, this file is installed @file{/usr/local/include/} directory.
 
2323
 
 
2324
Never forget, that application software that uses VFlib 
 
2325
must be linked against
 
2326
FreeType 1.2 or later (@file{libttf.a} or @file{libttf.so}), 
 
2327
T1Lib 1.0 or later (@file{libt1.a} or @file{libt1.so}), and 
 
2328
kpathsea 3.2 (@file{libkpathsea.a} or @file{libkpathsea.so}),
 
2329
if you configure VFlib to use them.
 
2330
(If VFlib is configured not to use them, they are not necessary.)
 
2331
 
 
2332
I recommend shared library versions for these optional libraries
 
2333
if you built a shared library version of VFlib.
 
2334
 
 
2335
 
 
2336
@example
 
2337
#include <VFlib-3_6.h>
 
2338
@end example
 
2339
 
 
2340
VFlib must be initialized before it is used.
 
2341
 
 
2342
@example
 
2343
char* vflibcap = "vflibcap";
 
2344
char* params =  "TeX_DPI=300, KPATHSEA_MODE=cx";
 
2345
 
 
2346
if (VF_Init(vflibcap, params) < 0)@{
 
2347
  fprintf(stderr, "Initializing VFlib: failed\n");
 
2348
  exit(1);
 
2349
@}
 
2350
@end example
 
2351
 
 
2352
Following program fragment opens a font, obtains a bitmap, and
 
2353
print obtained bitmap. 
 
2354
 
 
2355
@example
 
2356
int         fid;
 
2357
VF_BITMAP   bm;
 
2358
 
 
2359
if ((fid = VF_OpenFont2("timR24.pcf", -1, 1.0, 1.0)) < 0)@{
 
2360
  fprintf(stderr, "Opening font: failed\n");
 
2361
  exit(1);
 
2362
@}
 
2363
 
 
2364
bm = VF_GetBitmap2(fid, 0x67, 1.0, 1.0);
 
2365
 
 
2366
VF_DumpBitmap(bm);
 
2367
@end example
 
2368
 
 
2369
 
 
2370
@c    Node,                                   Next,  Previous,                Up
 
2371
@node A simple example, , Building an application software with VFlib, Programming with VFlib
 
2372
@section A simple example
 
2373
 
 
2374
@pindex vflbanner
 
2375
The following program code is a "banner" like using VFlib.
 
2376
For simplicity, this program accepts only 1-byte encoded characters.
 
2377
It reads an input from standard input and prints characters
 
2378
in ascii-art form to standard output.
 
2379
 
 
2380
@example
 
2381
/* 
 
2382
 * vflbanner.c - a banner by VFlib
 
2383
 * by Hirotsugu Kakugawa
 
2384
 *
 
2385
 *
 
2386
 */
 
2387
/*
 
2388
 * Copyright (C) 1998 Hirotsugu Kakugawa. 
 
2389
 * All rights reserved.
 
2390
 *
 
2391
 * This program is free software; you can redistribute it and/or modify
 
2392
 * it under the terms of the GNU General Public License as published by
 
2393
 * the Free Software Foundation; either version 2, or (at your option)
 
2394
 * any later version.
 
2395
 * 
 
2396
 * This program is distributed in the hope that it will be useful,
 
2397
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
2398
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
2399
 * GNU General Public License for more details.
 
2400
 * 
 
2401
 * You should have received a copy of the GNU General Public License
 
2402
 * along with this program; if not, write to the Free Software
 
2403
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
 
2404
 */
 
2405
 
 
2406
#include "config.h"
 
2407
#include <stdio.h>
 
2408
#include <stdlib.h>
 
2409
#include <ctype.h>
 
2410
#include "VFlib-3_6.h"
 
2411
 
 
2412
#define  DEFAULT_FONT  "timR18.pcf"
 
2413
 
 
2414
 
 
2415
char    *vflibcap;
 
2416
char    *fontname;
 
2417
 
 
2418
void  usage(void);
 
2419
void  vflbanner(FILE *fp);
 
2420
 
 
2421
 
 
2422
int
 
2423
main(int argc, char **argv)
 
2424
@{
 
2425
  vflibcap = NULL;
 
2426
  fontname = DEFAULT_FONT;
 
2427
 
 
2428
  --argc; argv++;
 
2429
  while (argc > 0)@{
 
2430
    if ((argc >= 1)
 
2431
        && ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0)))@{
 
2432
      usage();
 
2433
      exit(0);
 
2434
    @} else if ((argc >= 2) && (strcmp(argv[0], "-v") == 0))@{
 
2435
      --argc; argv++;
 
2436
      vflibcap = argv[0];
 
2437
      --argc; argv++;
 
2438
    @} else if ((argc >= 2) && (strcmp(argv[0], "-f") == 0))@{
 
2439
      --argc; argv++;
 
2440
      fontname = argv[0];
 
2441
      --argc; argv++;
 
2442
    @} else @{
 
2443
      break;
 
2444
    @}
 
2445
  @}
 
2446
 
 
2447
  vflbanner(stdin);
 
2448
 
 
2449
  return 0;
 
2450
@}
 
2451
 
 
2452
void usage(void)
 
2453
@{
 
2454
  printf("vflbanner - a banner program using VFlib\n");
 
2455
  printf("Usage: vflbanner [-v vflibcap] [-f fontname]\n"); 
 
2456
  printf("This program reads a text from standard input.  It supports\n");
 
2457
  printf("1-bit encoded font only. Thus, `ctextpgm' is better than this.\n");
 
2458
@}
 
2459
 
 
2460
 
 
2461
void
 
2462
vflbanner(FILE  *fp)
 
2463
@{
 
2464
  int  fid;
 
2465
  int  ch; 
 
2466
  int  pos_x, pos_y; 
 
2467
  VF_BITMAP  bm, page_bm;
 
2468
  struct vf_s_bitmaplist  PageBuff;
 
2469
 
 
2470
  if (VF_Init(vflibcap, NULL) < 0)@{
 
2471
    printf("VFlib initialization error");
 
2472
    switch (vf_error)@{
 
2473
    case VF_ERR_INTERNAL:
 
2474
      printf(" - Internal error.\n"); break;
 
2475
    case VF_ERR_NO_MEMORY:
 
2476
      printf(" - Server runs out of memory.\n"); break;
 
2477
    case VF_ERR_NO_VFLIBCAP:
 
2478
      printf(" -  No vflibcap.\n"); break;
 
2479
    default: 
 
2480
      printf(" -  Error code %d\n", vf_error); break;
 
2481
    @}
 
2482
    fflush(stdout);
 
2483
    exit(1);
 
2484
  @}
 
2485
 
 
2486
  if ((fid = VF_OpenFont1(fontname, -1, -1, -1, 1, 1)) < 0)
 
2487
    return;
 
2488
    
 
2489
  VF_BitmapListInit(&PageBuff);
 
2490
 
 
2491
  pos_x = pos_y = 0; 
 
2492
  while ((ch = getc(fp)) != EOF)@{
 
2493
    if (!isprint(ch))
 
2494
      ch = ' ';
 
2495
    if ((bm = VF_GetBitmap1(fid, (long)ch, 1, 1)) == NULL)
 
2496
      continue;
 
2497
    VF_BitmapListPut(&PageBuff, bm, pos_x, pos_y);
 
2498
    pos_x = pos_x + bm->mv_x;
 
2499
  @}
 
2500
 
 
2501
  page_bm = VF_BitmapListCompose(&PageBuff);
 
2502
  VF_DumpBitmap(page_bm);
 
2503
  VF_BitmapListFinish(&PageBuff);
 
2504
  VF_FreeBitmap(page_bm);
 
2505
 
 
2506
  VF_CloseFont(fid);
 
2507
@}
 
2508
 
 
2509
/*EOF*/
 
2510
@end example
 
2511
 
 
2512
 
 
2513
By the following commands is used to comple the program.
 
2514
 
 
2515
@example
 
2516
% gcc -c `VFlib3-config --cflags` vflbanner.c
 
2517
% gcc -o vflbanner vflbanner.o `VFlib3-config --libs` 
 
2518
@end example
 
2519
 
 
2520
@pindex VFlib3-config
 
2521
@command{VFlib3-config} is a program to print misc information on
 
2522
configuration of VFlib. It prints C compiler option to specify
 
2523
include directory (@option{--cflags}), dependent libraries (@option{--libs}),
 
2524
for example.
 
2525
Run @command{VFlib3-config} with @option{--help} option for detail.
 
2526
 
 
2527
 
 
2528
 
 
2529
@c ------------------------------------------------------------------------
 
2530
@c      Node,                Next,                Previous,               Up
 
2531
@node   Writing a vflibcap, Debugging a vflibcap, Programming with VFlib, Top
 
2532
@chapter Writing a vflibcap
 
2533
 
 
2534
@menu
 
2535
@b{Introduction}
 
2536
* Introduction to vflibcap::
 
2537
* Syntax of vflibcap::
 
2538
* Macros in vflibcap::
 
2539
* Searching font files::
 
2540
* Fast font file search::
 
2541
* Compressed font files::
 
2542
* Explicit and implicit fonts::
 
2543
* Variables in vflibcap::
 
2544
 
 
2545
@b{Global definitions}
 
2546
* VFlib defaults::
 
2547
 
 
2548
@b{Font drivers}
 
2549
* BDF font class::
 
2550
* PCF font class::
 
2551
* HBF font class::
 
2552
* TrueType font class::
 
2553
* Type1 font class::
 
2554
* Zeit font class::
 
2555
* JG font class::
 
2556
* eKanji font class::
 
2557
* TeX default and TeX font mapping font class::
 
2558
* PK font class::
 
2559
* GF font class::
 
2560
* TFM font class::
 
2561
* VF font class::
 
2562
 
 
2563
@b{Font drivers that map to another fonts}
 
2564
* ASCII Japanese TeX Kanji font class::
 
2565
* Japanese comic font class::
 
2566
* Try font class::
 
2567
* Mojikyo font mapping class::
 
2568
 
 
2569
@b{Examples of vflibcaps}
 
2570
* Example vflibcap 1::
 
2571
* Example vflibcap 2::
 
2572
* Example vflibcap 3::
 
2573
@end menu
 
2574
 
 
2575
 
 
2576
@c      Node,                   Next,       Previous, Up
 
2577
@node Introduction to vflibcap, Syntax of vflibcap, , Writing a vflibcap
 
2578
@section Introduction to vflibcap
 
2579
 
 
2580
A vflibcap file is a database of font definitions for the VFlib library.  
 
2581
A vflibcap font definition is described in a format
 
2582
similar to termcap and printcap.  
 
2583
Vflibcap provides logical font names and
 
2584
logical font names may not corresponds to font files to be accessed.
 
2585
In this document, we simply say "font" to denote logical fonts.
 
2586
 
 
2587
Each VFlib fonts have its own parameters listed below:
 
2588
 
 
2589
@itemize @bullet
 
2590
@item Pixel size,
 
2591
@item Point size, and
 
2592
@item Resolution of target device.
 
2593
@end itemize
 
2594
 
 
2595
These parameters may not be available in font file.
 
2596
For instance, these parameters are lacking in TrueType fonts.
 
2597
Lacking information is given in vflibcap file, 
 
2598
or it is given by a font driver as default values.
 
2599
 
 
2600
@b{Note:}
 
2601
If you want to use VFlib for @TeX{} DVI drivers, such as
 
2602
previewers and pronter driver,
 
2603
use @command{vflmkcaptex} program to generate vflibcap file
 
2604
automatically.
 
2605
 
 
2606
 
 
2607
@c      Node,             Next,                  Previous,                 Up
 
2608
@node Syntax of vflibcap, Macros in vflibcap, Introduction to vflibcap, Writing a vflibcap
 
2609
@section Syntax of vflibcap
 
2610
 
 
2611
The syntax of vflibcap file is lisp-like form. 
 
2612
A semicolon @code{;} starts a comment and following 
 
2613
text is ignored until the end of line.
 
2614
A colon in a string which is enclosed by double colons is not 
 
2615
considered as a comment character and forms a part of string.
 
2616
In the following explanation, we ignore comments.
 
2617
 
 
2618
A vflibcap file is a sequence of expressions called s-expressions.
 
2619
Basic data item of s-expression is string.
 
2620
Unlike lisp, there is no "number" type.
 
2621
A sequence of digits is parsed as a string.
 
2622
To include a special characters in a string such as double quotation,
 
2623
control code, and parenthesis, escape sequence can be used.
 
2624
String is a sequence of characters of the following form:
 
2625
 
 
2626
@table @asis
 
2627
@item String Form 1:
 
2628
   Sequence of characters enclosed by double quotations. 
 
2629
 
 
2630
   Examples: 
 
2631
@example
 
2632
   "hello world"
 
2633
   "a, b, c, d"
 
2634
   "He said \"Thanks!\"."
 
2635
   "a*(b+c)"
 
2636
@end example
 
2637
 
 
2638
@item String Form 2:
 
2639
   Sequence of characters except space, tab, newline, and 
 
2640
   closing parenthesis. A start character must not be a double quotation.
 
2641
 
 
2642
   Examples: 
 
2643
@example
 
2644
   font-file
 
2645
   hello\ world
 
2646
   He\ said\ \"Thanks!\".
 
2647
   a*\(b+c\)
 
2648
@end example
 
2649
@end table
 
2650
 
 
2651
Unlink lisp, there is no distinction between string and symbol in
 
2652
vflibcap; they are the same data type.
 
2653
That is, @code{HELLO} and @code{"HELLO"} are the same.
 
2654
 
 
2655
Parentheses is used to form a "list" like in lisp.
 
2656
For example, @code{(A B C)} is a list of three strings.
 
2657
List can be nested any depth, e.g., 
 
2658
@code{(A (B1 B2 B3) (C1 (C21 C22) C3))}.
 
2659
 
 
2660
A vflibcap must be a sequence of s-expression of the following forms:
 
2661
 
 
2662
@table @asis
 
2663
@item @code{(define-default @var{FONT-CLASS} @var{CAPABILITY-DEF} ... )}  
 
2664
  This expression defines a default values for a font class.
 
2665
 
 
2666
@item @code{(define-font @var{NAME} @var{CAPABILITY-DEF} ... )} 
 
2667
  This expression defines a font.
 
2668
 
 
2669
@item @code{(define-macro @var{NAME} @var{CAPABILITY-DEF} ... )}
 
2670
  This expression defines a macro @var{NAME}.
 
2671
@end table
 
2672
 
 
2673
@var{CAPABILITY-DEF} must be a list of form 
 
2674
@code{(@var{CAPABILITY-NAME} @var{VALUE})}, 
 
2675
e.g., @code{(font-file "/usr/local/share/fonts/"}.
 
2676
Each font class defines its own set of capabilities and
 
2677
capability sets can be different by font classes.
 
2678
 
 
2679
 
 
2680
This is an example of vflibcap file.
 
2681
 
 
2682
@example
 
2683
;; vflibcap
 
2684
(define-default VFlib
 
2685
  (extension-hints         (".bdf" bdf) (".pcf" pcf))
 
2686
  (uncompression-programs  (".Z" "zcat") (".gz" "gzip -cd")
 
2687
                           ("pk" ascii-jtex-kanji))
 
2688
  (implicit-font-classes   bdf pcf hbf ascii-jtex-kanji)
 
2689
  (variable-values     ("TeX_DPI" "300"))
 
2690
 
 
2691
(define-default bdf
 
2692
  (filename-extensions ".bdf")
 
2693
  (font-directories
 
2694
     "/usr/X11R6/lib/X11/fonts//" "/usr/local/share/fonts/X11//")
 
2695
  (compression-extensions ".gz" ".Z"))
 
2696
 
 
2697
(define-font timR24  ; times roman 24
 
2698
  (font-class bdf)
 
2699
  (font-file "timR24.bdf"))
 
2700
 
 
2701
(define-font timR18  ; times roman 18
 
2702
  (font-class bdf)
 
2703
  (font-file "timR18.bdf"))
 
2704
@end example
 
2705
 
 
2706
 
 
2707
@c      Node,             Next,                 Previous,           Up
 
2708
@node Macros in vflibcap, Searching font files, Syntax of vflibcap, Writing a vflibcap
 
2709
@section Macros in vflibcap
 
2710
 
 
2711
To avoid writing the same capabilities, macro feature is provided in vflib.
 
2712
In case of @var{CAPABILITY-DEF} is a string,
 
2713
it is treated as a macro and a macro definition for it is expanded.
 
2714
For instance, 
 
2715
 
 
2716
@example
 
2717
(define-font timR18
 
2718
  MACRO-NAME
 
2719
  (font-file "timR18.bdf"))
 
2720
@end example
 
2721
 
 
2722
is a font definition using a macro @code{MACRO-NAME}.
 
2723
Suppose a macro @code{MACRO-NAME} is defined as follows.
 
2724
 
 
2725
@example
 
2726
(define-macro MACRO-NAME
 
2727
  (font-class bdf)
 
2728
  (dpi 300))
 
2729
@end example
 
2730
 
 
2731
Then, the font definition for @code{timR24} is the same as follow.
 
2732
 
 
2733
@example
 
2734
(define-font timR18
 
2735
  (font-class bdf)
 
2736
  (dpi 300))
 
2737
  (font-file "timR18.bdf"))
 
2738
@end example
 
2739
 
 
2740
 
 
2741
The rule of macr expand is as following procedure.
 
2742
 
 
2743
@enumerate
 
2744
@item 
 
2745
Looks for use of macros. 
 
2746
From the first @var{CAPABILITY-DEF} to the last one,
 
2747
it is checked if it is a string (thus a macro) or not in order.
 
2748
If it is a macro, corresponding macro definition is substituted.
 
2749
Then, next @var{CAPABILITY-DEF} is checked.
 
2750
 
 
2751
@item
 
2752
Macro expand is done recursively.
 
2753
Thus, a macro can be used in another macro. 
 
2754
 
 
2755
@end enumerate
 
2756
 
 
2757
 
 
2758
@c      Node,               Next,            Previous,               Up
 
2759
@node Searching font files, Fast font file search, Macros in vflibcap, Writing a vflibcap
 
2760
@section Searching font files
 
2761
 
 
2762
Some font classes (e.g., BDF, PCF) defines a @code{font-directories} 
 
2763
capability in vflibcap file.
 
2764
This capability specifies a list of font directories, for instance,
 
2765
@code{(font-directories "/usr/local/fonts/" "/opt/fonts" "/usr/local/share/fonts//")}.
 
2766
A font file can be searched recursively in a directory tree
 
2767
if a font directory name ends by double slashes @code{//}.
 
2768
 
 
2769
Some font drivers support file search by kpathsea.
 
2770
Typically, font files are located under @file{/usr/local/share/texmf}.
 
2771
This directory is used to hold @TeX{}-related files.
 
2772
If a font driver supports searching by kpathsea,
 
2773
a special name @code{TEXMF} can be given in a list of
 
2774
@code{font-directories} capability. For instance, 
 
2775
suppose that 
 
2776
@code{(font-directories "/opt1/fonts//" "TEXMF" "/opt2/fonts//")}
 
2777
is specified.   Then files are searched under @code{/opt1/fonts}, 
 
2778
by kpathsea, and then @code{/opt2/fonts}, in this order.
 
2779
 
 
2780
Currently, pk, gf, tfm, vf, truetype, and type1 font classes suport 
 
2781
searcing files by kpathsea.
 
2782
 
 
2783
 
 
2784
@c      Node,               Next,            Previous,               Up
 
2785
@node Fast font file search, Compressed font files, Searching font files, Writing a vflibcap
 
2786
@section Fast font file search
 
2787
 
 
2788
@cindex VFlib.fdb
 
2789
In case there are many font directories and sub-directory
 
2790
which contains many font file, searching a font file take long time,
 
2791
since font directories are traversed to find a requested font file.
 
2792
For fast font file search,
 
2793
font file hint database (FDB for short) can be used.
 
2794
It is placed in a root of a font directory, and
 
2795
it contains pairs of font file name and relative pathname of the font file
 
2796
from the font directory.
 
2797
The file name of FDB is @code{VFlib.fdb}.
 
2798
 
 
2799
The following is an example of FDB file.
 
2800
@example
 
2801
times__m.pfb    type1/t/times__m.pfb
 
2802
times__m.afm    type1/t/times__m.afm
 
2803
zac_____.ttf    ttf/z/zac_____.ttf
 
2804
zalescap.ttf    ttf/z/zalescap.ttf
 
2805
@end example
 
2806
 
 
2807
Suppose that this FDB file is located in @file{/foo/bar/}, for instance.
 
2808
The file tells us that there is a file @file{times__m.pfb} 
 
2809
and absolute path name of the file is 
 
2810
@file{/foo/bar/type1/t/times__m.pfb}.
 
2811
 
 
2812
If FDB file is found in a root directory of font directory,
 
2813
the FDB file is opened to find a requested font file.
 
2814
If a requested font file is not found, other font directory is searched,
 
2815
i.e., the directory is not traversed at all.
 
2816
In case FDB file is not found, a font directory is traversed to 
 
2817
find a requested font file. 
 
2818
 
 
2819
It is important to remember that
 
2820
you must not forget to update FDB file after you 
 
2821
added new font files in a font directory.
 
2822
If you forget, installed font files are not found evenif they are
 
2823
in a font directory.
 
2824
To update a FDB file, run the utility program @code{vflmkfdb}.
 
2825
See @ref{vflmkfdb}, for details of the program.
 
2826
 
 
2827
A FDB file must be located in a root of a font directory
 
2828
and its name must be @file{VFlib.fdb}.
 
2829
Even if there is a FDB file in a sub-directory of a font directory,
 
2830
VFlib does not look for it. 
 
2831
 
 
2832
 
 
2833
 
 
2834
@c      Node,                  Next,                      Previous,               Up
 
2835
@node Compressed font files, Explicit and implicit fonts, Fast font file search, Writing a vflibcap
 
2836
@section Compressed font files
 
2837
 
 
2838
To reduce disk storage, compressed font files
 
2839
and uncompression on the fly is supported by some font class.
 
2840
Note that this feature is font class dependent and not all 
 
2841
font class support this.
 
2842
 
 
2843
In a vflibcap file, a font file name need not have a compressed type
 
2844
extension, such as @code{.gz}.
 
2845
When VFlib searches a font file, it internally adds compressed 
 
2846
type extension and finds a file.
 
2847
 
 
2848
 
 
2849
 
 
2850
@c    Node,                        Next,           Previous,               Up
 
2851
@node Explicit and implicit fonts, Variables in vflibcap, Compressed font files, Writing a vflibcap
 
2852
@section Explicit and implicit fonts
 
2853
@cindex explicit fonts
 
2854
@cindex implicit fonts
 
2855
 
 
2856
Fonts explicitly defined in a vflibcap file are called @emph{explicit fonts}.
 
2857
Fonts does not appear vflibcap file and searched by font drivers on
 
2858
demand are called @emph{implicit fonts}.
 
2859
 
 
2860
 
 
2861
@c    Node,                  Next,          Previous,                    Up
 
2862
@node Variables in vflibcap, VFlib defaults, Explicit and implicit fonts, Writing a vflibcap
 
2863
@section Variables in vflibcap
 
2864
@cindex variables
 
2865
 
 
2866
In a vflibcap file, variables can be used as capability values.
 
2867
A capability value can be a value of a variable if a dollar sign 
 
2868
(@code{$}) followed by a variable name is given.  
 
2869
 
 
2870
For instance, @code{(dpi $TeX_DPI)} can be used instead of @code{(dpi 300)}.
 
2871
The value for a variable must be defined somewhere.
 
2872
Default value can be given in @code{(define-default VFlib  ...)}, which 
 
2873
will be explained later.
 
2874
 
 
2875
@cindex VFLIBCAP_PARAM_var
 
2876
Default values can be overridden on initialization function of 
 
2877
VFlib @code{VF_Init()}, or Unix environment variables
 
2878
@code{VFLIBCAP_PARAM_@var{var}}. 
 
2879
For example, @code{VFLIBCAP_PARAM_TeX_DPI} is defined, its value becomes the
 
2880
value of the vflibcap variable @code{TeX_DPI}.
 
2881
 
 
2882
The value of an environment variable @code{VFLIBCAP_PARAM_@var{var}}
 
2883
is parsed as an S-expression, not as an string.
 
2884
Thus, if you want to specify a string @code{ABC 123}, 
 
2885
the value of an environment variablue must be @code{\"abc 123\"}.
 
2886
(Without double quotation, it will be a sequence of two strings.
 
2887
Only the first one is effective and the second one is ignored.)
 
2888
 
 
2889
@c    Node,          Next,           Previous,                    Up
 
2890
@node VFlib defaults, BDF font class, Variables in vflibcap, Writing a vflibcap
 
2891
@section VFlib defaults
 
2892
 
 
2893
To specify global behavior of VFlib, (virtual) font class
 
2894
@code{VFlib} is defined.
 
2895
 
 
2896
The following capability are defined.
 
2897
 
 
2898
@table @asis
 
2899
@item @code{implicit-font-classes} (optional)
 
2900
--- A list of implicit font classes. Font classes listed by
 
2901
this capability is candidates for implicit font searching.
 
2902
 
 
2903
example: @code{(implicit-font-classes "bdf" "pcf" "gf")}
 
2904
 
 
2905
@item @code{extension-hints} (optional)
 
2906
--- A list of paris of font name postfix and corresponding font class name.
 
2907
This is hint information to find font class from a font name in case
 
2908
of searching an implicit font.
 
2909
If an implicit font name matches with a postfix given by this capability,
 
2910
specified font class is invoked to search an implicit font.
 
2911
This is effective to reduce time to search an implicit font.
 
2912
 
 
2913
example: @code{(extension-hints (".pcf" pcf) (".bdf" bdf) ("gf" gf))}
 
2914
 
 
2915
@item @code{variable-values} (optional)
 
2916
--- A list of pairs of a name of vflibcap variable and its default value.
 
2917
 
 
2918
example: @code{(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE" "cx") (v ("p1" "v1")}
 
2919
 
 
2920
@item @code{uncompression-programs} (optional)
 
2921
--- A list of pairs of file name extension and corresponding uncompression
 
2922
program.  This is used for reading compressed font files.
 
2923
An uncompression program must output uncompressed data 
 
2924
to standard output.
 
2925
 
 
2926
This capability is just defines relations of 
 
2927
an extension and an uncompression program.
 
2928
A list of supported compressed types of a font class
 
2929
is given in a font class default description of each font class.
 
2930
 
 
2931
example: @code{(uncompression-programs (".Z" "zcat") (".gz" "gzip -cd")}
 
2932
 
 
2933
@item @code{code-conversion-files} (optional)
 
2934
--- A list of file names for encoding conversion. 
 
2935
Currently, TrueType font class uses this. 
 
2936
See @ref{Code conversion system}.
 
2937
 
 
2938
example: @code{(code-conversion-files "iso8859-1_unicode.ccv".ccv")}
 
2939
 
 
2940
@item @code{use-kpathsea} (optional)
 
2941
--- A flag whether kpathsea is used or not to search @TeX{} font files.
 
2942
Value of this capability must be one of @code{"Yes"} or @code{"No"}.
 
2943
 
 
2944
example: @code{(use-kpathsea "Yes")}
 
2945
 
 
2946
@item @code{kpathsea-mode} (optional)
 
2947
--- A device mode name for kpathsea library.
 
2948
 
 
2949
example: @code{(kpathsea-mode "cx")}
 
2950
 
 
2951
@item @code{kpathsea-dpi} (optional)
 
2952
--- Device resolution (in dpi) of a device mode for kpathsea library.
 
2953
 
 
2954
example: @code{(kpathsea-mode 300)}
 
2955
 
 
2956
@item @code{kpathsea-program-name} (optional)
 
2957
--- An application program name for kpathsea library.
 
2958
 
 
2959
example: @code{(kpathsea-mode "xgdvi")}
 
2960
 
 
2961
@end table
 
2962
 
 
2963
 
 
2964
 
 
2965
@c    Node,           Next,           Previous,               Up
 
2966
@node BDF font class, PCF font class, VFlib defaults, Writing a vflibcap
 
2967
@section BDF font class
 
2968
 
 
2969
The BDF format is a bitmap font format encoded in human-readable, platform
 
2970
independent format for distributing X Window fonts.
 
2971
 
 
2972
This font class supports compressed font files and implicit fonts.
 
2973
@*
 
2974
 
 
2975
@noindent
 
2976
@b{Font class name}: @code{bdf}
 
2977
@cindex BDF font class
 
2978
@*
 
2979
 
 
2980
@noindent
 
2981
@b{Capabilities for font class default:}
 
2982
@*
 
2983
 
 
2984
@table @asis
 
2985
@item @code{font-directories} (optional)
 
2986
---  A list of font directories for searching font files.
 
2987
Recursive searching of font files is support.
 
2988
 
 
2989
@item @code{compression-extensions}  (optional)
 
2990
--- A list of supported compression type for this font class.
 
2991
This font class supports only compression type given by this capability.
 
2992
When a font is searched, a file followed by a compression extension
 
2993
is searched if given font file is not found.
 
2994
(Note that @code{uncompression-programs} capability of 
 
2995
VFlib class default description gives a uncompression programs.)
 
2996
 
 
2997
example: @code{(compression-extensions ".gz" ".Z")}
 
2998
 
 
2999
@item @code{dpi}  (optional)
 
3000
--- Defualt device resolution.  
 
3001
Default horizontal and vertical resolutions will be the same value.
 
3002
  
 
3003
example: @code{(dpi 300)}
 
3004
 
 
3005
@item @code{dpi-x} (optional)
 
3006
--- Default horizontal device resolution.  
 
3007
  
 
3008
example: @code{(dpi-x 300)}
 
3009
 
 
3010
@item @code{dpi-y} (optional)
 
3011
--- Default vertical device resolution.  
 
3012
  
 
3013
example: @code{(dpi-y 300)}
 
3014
 
 
3015
@item @code{aspect-ratio} (optional)
 
3016
--- Aspect ratio of characters. 
 
3017
If this value is 0.5 then width is half, and if 2 then width is doubled. 
 
3018
 
 
3019
example: @code{(aspect-ratio 0.8)}
 
3020
 
 
3021
@item @code{properties} (optional)
 
3022
--- A list of pairs of a property name and its value. 
 
3023
Property values given by this parameter is used by @code{VF_GetProp()}
 
3024
 
 
3025
example: @code{(properties ("PROP-1" "value-1") ("PROP-2" "value-2"))}
 
3026
 
 
3027
@item @code{variable-values} (optional)
 
3028
--- A list of pairs of a vflibcap variable name and its default value. 
 
3029
 
 
3030
example: @code{(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE" "cx") ("TeX_KPATHSEA_PROGRAM" "/usr/X11R6/xldvi"))}
 
3031
 
 
3032
@end table
 
3033
@*
 
3034
 
 
3035
@noindent
 
3036
@b{Capabilities for font definition:}
 
3037
@*
 
3038
 
 
3039
@table @asis
 
3040
 
 
3041
@item @code{font-class} (essential)
 
3042
--- A font class name. This value must be @code{bdf}.
 
3043
 
 
3044
@item @code{font-directories} (optional)
 
3045
---  A list of font directories for searching font files.
 
3046
Recursive searching of font files is support.
 
3047
A font file is searched in the directories given by this capability.
 
3048
 
 
3049
If this capability is not given, 
 
3050
the font directory specified by the class default is used to search fonts.
 
3051
If this capability is given, 
 
3052
the font directory specified by the class default is not 
 
3053
used to search fonts.
 
3054
 
 
3055
@item @code{font-file} (optional)
 
3056
--- A font file name string. 
 
3057
If this capability is not specified, the font name is used as 
 
3058
the font file name.  
 
3059
Multiple font file names can be listed in this capability.
 
3060
The driver tries to open a font listed first.
 
3061
If it is impossible to open, then  it tries to open the second font.
 
3062
This is repeated until a font is successfully opened.
 
3063
If all fonts are impossible to open, font open fails.
 
3064
 
 
3065
example: @code{(font-file "timI24.bdf" "timR24.bdf")}
 
3066
 
 
3067
@item @code{point-size} (optional)
 
3068
--- font size in points.  If the size is different
 
3069
from the size defined in the BDF font file, the bitmap is
 
3070
enlarged or shrinked to yield the specified size.  
 
3071
This capability has effect for the VFlib functions @code{VF_GetBitmap1()}
 
3072
and @code{VF_GetMetric1()}.
 
3073
 
 
3074
example: @code{(point-size 24.0)}
 
3075
 
 
3076
@item @code{pixel-size} (optional)
 
3077
--- font size in pixels. 
 
3078
If the size is different from the size defined in the BDF font file, 
 
3079
the bitmap is enlarged or shrinked to yield the specified size.  
 
3080
This capability has effect for the VFlib functions @code{VF_GetBitmap2()}
 
3081
and @code{VF_GetMetric2()}.
 
3082
 
 
3083
example: @code{(pixel-size 24)}
 
3084
 
 
3085
@item @code{magnification} (optional)
 
3086
--- magnification factor.
 
3087
The font is magnified by this factor.
 
3088
 
 
3089
example: @code{(magnification 1.20)}
 
3090
 
 
3091
@item @code{character-set} (optional)
 
3092
--- This is used for code point conversion.
 
3093
Value of this capability gives an external view of a character set of a font.
 
3094
Code conversion (ccv) is determined by this value and
 
3095
the following three capabilities.
 
3096
 
 
3097
@item @code{encoding} (optional)
 
3098
--- This is used for code point conversion.
 
3099
Value of this capability gives an external view of an encoding of a font.
 
3100
 
 
3101
@item @code{font-character-set} (optional)
 
3102
--- This is used for code point conversion.
 
3103
Value of this capability gives an internal view of a character set of a font.
 
3104
Therefore, this value must match the character set of the font file
 
3105
given by @code{font-file} capability.
 
3106
 
 
3107
@item @code{font-encoding} (optional)
 
3108
--- This is used for code point conversion.
 
3109
Value of this capability gives an internal view of an encoding of a font.
 
3110
Therefore, this value must match the encoding of the font file
 
3111
given by @code{font-file} capability.
 
3112
 
 
3113
The following example defines a font named @code{iso8859_5-font}
 
3114
with ISO-8859-5 encoding by using a KOI8-R encoded font file.
 
3115
 
 
3116
@example
 
3117
(define-font iso8859_5-font
 
3118
  (font-class pcf)
 
3119
  (character-set "ISO8859-5")   (encoding "ISO")
 
3120
  (font-character-set "KOI8-R") (font-encoding "KOI8-R")
 
3121
  (font-file "koi8x13.pcf"))
 
3122
@end example
 
3123
 
 
3124
Code conversion is done by a subsystem named CCV.
 
3125
See @ref{Code conversion system} for detail.
 
3126
 
 
3127
@end table
 
3128
 
 
3129
 
 
3130
 
 
3131
@c    Node,           Next,           Previous,       Up
 
3132
@node PCF font class, HBF font class, BDF font class, Writing a vflibcap
 
3133
@section PCF font class
 
3134
@cindex PCF font class
 
3135
 
 
3136
@noindent
 
3137
@b{Font class name:} @code{pcf}
 
3138
@*
 
3139
 
 
3140
Other specification is the same as BDF font class
 
3141
except font class name is @code{pcf}.
 
3142
 
 
3143
 
 
3144
 
 
3145
@c    Node,           Next,                Previous,       Up
 
3146
@node HBF font class, TrueType font class, PCF font class, Writing a vflibcap
 
3147
@section HBF font class
 
3148
@cindex HBF font class
 
3149
 
 
3150
@noindent
 
3151
@b{Font class name:} @code{hbf}
 
3152
@*
 
3153
 
 
3154
Other specification is the same as BDF font class
 
3155
except font class name is @code{hbf}.
 
3156
 
 
3157
 
 
3158
 
 
3159
@c      Node,              Next,            Previous,              Up
 
3160
@node TrueType font class, Type1 font class, HBF font class, Writing a vflibcap
 
3161
@section TrueType font class
 
3162
@cindex TrueType font class
 
3163
 
 
3164
TrueType is a vector font font format.
 
3165
This font class supports implicit fonts but does not support
 
3166
compressed font files.
 
3167
@cindex FreeType
 
3168
TrueType font driver uses FreeType library version 1.2
 
3169
developed by David Turner, Robert Wilhelm, and Werner Lemberg.
 
3170
See @url{http://www.freetype.org/} for detail.
 
3171
@*
 
3172
 
 
3173
@noindent
 
3174
@b{Font class name:} @code{truetype}
 
3175
@*
 
3176
 
 
3177
@noindent
 
3178
@b{Capabilities for font class default:}
 
3179
@*
 
3180
 
 
3181
@table @asis
 
3182
@item @code{font-directories} (optional)
 
3183
--- A list of font directories.
 
3184
This driver supports font file search by kpathsea.
 
3185
To search a font file by kpathsea,
 
3186
use @code{TEXMF} for a directory name.
 
3187
 
 
3188
@item @code{point-size} (optional)
 
3189
 
 
3190
@item @code{pixel-size} (optional)
 
3191
 
 
3192
@item @code{dpi} (optional)
 
3193
 
 
3194
@item @code{dpi-x} (optional)
 
3195
 
 
3196
@item @code{dpi-y} (optional)
 
3197
 
 
3198
@item @code{aspect-ratio} (optional)
 
3199
 
 
3200
@c @item @code{writing-direction} (optional)
 
3201
 
 
3202
@item @code{hinting} (optional)
 
3203
--- If the value of capability @code{on}, "hinting" information is
 
3204
used to render characters. This is effective when small characters
 
3205
are rendered. If the value is @code{off}, hinting is disabled.
 
3206
Hinting information is used by default.
 
3207
 
 
3208
Note that enabling hinting has effect when obtaining bitmaps.
 
3209
It has no effect when you obtain and rasterize 
 
3210
outline data in VFlib format, 
 
3211
since VFlib outline format does not supports hinting information.
 
3212
 
 
3213
@item @code{platform-id} (optional)
 
3214
--- A TrueType font can have multiple character code - 
 
3215
glyph mapping tables.
 
3216
A mapping table is selected by specifying
 
3217
a pair of platform ID (@code{Microsoft}, @code{Macintosh}, etc) 
 
3218
and encoding ID (@code{Unicode}, @code{Shift-JIS}, etc).
 
3219
This capability is used to specify platform ID of a mapping table 
 
3220
to be selected.
 
3221
 
 
3222
Value of this capability is one of strings below:
 
3223
@table @asis
 
3224
@item @code{apple} 
 
3225
   Apple platform 
 
3226
@item @code{macintosh}, @code{mac}
 
3227
   Macintosh platform
 
3228
@item @code{ascii}, @code{iso}
 
3229
   ISO platform
 
3230
@item @code{microsoft}, @code{windows}, @code{ms}
 
3231
   Microsoft platform
 
3232
@item @code{any}, @code{?}, @code{*}
 
3233
   Any platform
 
3234
@end table
 
3235
 
 
3236
Default value for this capability is Microsoft platform.
 
3237
 
 
3238
example: @code{(platform-id "microsoft")}
 
3239
 
 
3240
@item @code{encoding-id} (optional)
 
3241
--- Together with platform id, this capability is used to specify
 
3242
a mapping table. 
 
3243
 
 
3244
When ISO platform is selected by the @code{encoding-id} 
 
3245
capability, 
 
3246
value of this @code{encoding-id} capability is one of strings below:
 
3247
@*
 
3248
 
 
3249
@table @asis
 
3250
@item @code{ascii} 
 
3251
   ASCII encoding.
 
3252
@item @code{iso10464} 
 
3253
   ISO 10464 encoding.
 
3254
@item @code{iso8859-1} 
 
3255
   ISO8859-1 encoding.
 
3256
@item @code{any}, @code{?}, @code{*}  
 
3257
   Any encoding.
 
3258
@end table
 
3259
@*
 
3260
 
 
3261
When Apple platform is selected by the @code{encoding-id} 
 
3262
capability, 
 
3263
value of this @code{encoding-id} capability is one of strings below:
 
3264
@*
 
3265
 
 
3266
@table @asis
 
3267
@item @code{unicode1.1} 
 
3268
   Unicode 1.1 encoding.
 
3269
@item @code{unicode2.0} 
 
3270
   Unicode 2.0 encoding.
 
3271
@item @code{iso10464} 
 
3272
   ISO 10464 encoding.
 
3273
@item @code{any}, @code{?}, @code{*}  
 
3274
   Any encoding
 
3275
@end table
 
3276
@*
 
3277
 
 
3278
When Microsoft platform is selected by the @code{encoding-id} 
 
3279
capability, 
 
3280
value of this @code{encoding-id} capability is one of strings below:
 
3281
@*
 
3282
 
 
3283
@table @asis
 
3284
@item @code{symbol} 
 
3285
@item @code{unicode} 
 
3286
  Unicode encoding.
 
3287
@item @code{shift-jis}, @code{sjis}, @code{ms-kanji}
 
3288
  Shift JIS encoding.
 
3289
@item @code{big5}
 
3290
  Big5 encoding.
 
3291
@item @code{rpc}
 
3292
@item @code{wansung}
 
3293
@item @code{johab}
 
3294
@item @code{any}, @code{?}, @code{*}  
 
3295
   Any encoding
 
3296
@end table
 
3297
@*
 
3298
 
 
3299
When Macintosh platform is selected by the @code{encoding-id} 
 
3300
capability, 
 
3301
value of this @code{encoding-id} capability is one of strings below:
 
3302
 
 
3303
@table @asis
 
3304
@item @code{roman} 
 
3305
@item @code{japanese} 
 
3306
@item @code{traditional-chinese}
 
3307
@item @code{korean}
 
3308
@item @code{arabic}
 
3309
@item @code{hebrew}
 
3310
@item @code{greek}
 
3311
@item @code{russian}
 
3312
@item @code{any}, @code{?}, @code{*}  
 
3313
   Any encoding
 
3314
@end table
 
3315
 
 
3316
example: @code{(encoding-id "any")}
 
3317
 
 
3318
@item @code{properties} (optional)
 
3319
 
 
3320
@item @code{variable-values} (optional)
 
3321
 
 
3322
@end table
 
3323
@*
 
3324
 
 
3325
 
 
3326
@noindent
 
3327
@b{Capabilities for font definition:}
 
3328
@*
 
3329
 
 
3330
@table @asis
 
3331
@item @code{font-class} (essential)
 
3332
This value must be "truetype".  
 
3333
 
 
3334
@item @code{font-directories} (optional)
 
3335
---  A list of font directories for searching font files.
 
3336
Recursive searching of font files is support.
 
3337
A font file is searched in the directories by this capability.
 
3338
If not found, then a font is searched in a directories 
 
3339
given by the class default.
 
3340
 
 
3341
To search a font file by kpathsea,
 
3342
use @code{TEXMF} for a directory name.
 
3343
 
 
3344
@item @code{font-file} (optional)
 
3345
 
 
3346
@item @code{point-size} (optional)
 
3347
 
 
3348
@item @code{pixel-size} (optional)
 
3349
 
 
3350
@item @code{dpi} (optional)
 
3351
 
 
3352
@item @code{dpi-x} (optional)
 
3353
 
 
3354
@item @code{dpi-y} (optional)
 
3355
 
 
3356
@item @code{magnification} (optional)
 
3357
 
 
3358
@item @code{aspect-ratio} (optional)
 
3359
 
 
3360
@c @item @code{writing-direction} (optional)
 
3361
 
 
3362
@item @code{hinting} (optional)
 
3363
 
 
3364
@item @code{font-number} (optional)
 
3365
 
 
3366
@item @code{encoding-force} (optional)
 
3367
--- In case encoding id data is broken in a TrueType font,
 
3368
its value can be overridden by this capability.
 
3369
 
 
3370
example @code{(encoding-force "unicode")}
 
3371
 
 
3372
@item @code{character-set} (optional)
 
3373
--- Together with @code{encoding} capability, this capability
 
3374
is used to change "external view" of a font.
 
3375
A font would be a font of a character set given by this capability
 
3376
and encoding given by @code{encoding} capability.
 
3377
Conversion of font internal character set and encoding to
 
3378
an external view is determined by these capability.
 
3379
Conversion is done by by code conversion system, called CCV.  
 
3380
@ref{Code conversion system}
 
3381
Code conversion files are specified in 
 
3382
@code{code-conversion-files} in @code{VFlib} font class default.
 
3383
See @ref{VFlib defaults}.
 
3384
 
 
3385
For example, a font of JIS X 0208 character set (a Japanese character set)
 
3386
in Shift-JIS encoding fonts can be accessed as a JIS encoding font.
 
3387
 
 
3388
@item @code{encoding} (optional)
 
3389
--- Together with @code{character-set} capability, 
 
3390
this capability defines a external view of a font.   
 
3391
@ref{Code conversion system}
 
3392
 
 
3393
@item @code{properties} (optional)
 
3394
 
 
3395
@item @code{jisx0212-row47-empty-sjis} (optional)
 
3396
--- This capability is used for an ad-hoc solution to handle 
 
3397
JIS X 0212 fonts with non-standard encoding such that 
 
3398
row 47 is empty and followed rows are shifted by one.
 
3399
(That is, Kanjis in row 48 of JIS X 0212 appeard in row 49 in such fonts.)
 
3400
JIS X 0212 fonts of Ricoh TrueTypeWorld ValueFont DX are such fonts.
 
3401
If @code{yes} is given to this capability,
 
3402
buggy encoding is virtually fixed.
 
3403
 
 
3404
This capability can apply to other products of buggy encoded 
 
3405
JIS X 0212 fonts whose internal encoding is Shift JIS.
 
3406
(Use @code{ftdump} utility of FreeType package to check 
 
3407
internal encoding scheme of fonts.)
 
3408
 
 
3409
@end table
 
3410
 
 
3411
 
 
3412
 
 
3413
@c      Node,              Next,            Previous,              Up
 
3414
@node Type1 font class, Zeit font class, TrueType font class, Writing a vflibcap
 
3415
@section Type1 font class
 
3416
@cindex Type1 font class
 
3417
 
 
3418
Type1 is a vector font font format used by PostScript.
 
3419
This font class supports implicit fonts but does not support
 
3420
compressed font files.
 
3421
@cindex T1Lib
 
3422
This Type1 font driver uses T1Lib library version 1.0 or later
 
3423
developed by Rainer Menzner.
 
3424
See 
 
3425
@url{http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib/t1lib.html}
 
3426
for detail.
 
3427
 
 
3428
Be careful, VFlib does not work with T1Lib 0.7.
 
3429
Obtain and install T1Lib 1.0 or later.
 
3430
 
 
3431
Currently, this font driver supports only 8-bit encoded fonts,
 
3432
i.e., it does not support for fonts of Japanese Kanji characters.
 
3433
 
 
3434
The function @code{VF_GetOutline()} for Type1 font files is 
 
3435
supported but the result is ugly.
 
3436
Since T1Lib does not have a function to obtain outline data of a 
 
3437
character in Type1 font, 
 
3438
this font driver creates an outline data from a bitmap
 
3439
(for compatibility). 
 
3440
Thus, it is very ugly.
 
3441
If your application software requires outline data, 
 
3442
you are recommended to use the same font in other font format,
 
3443
such as TrueType.
 
3444
Thus, the outline obtained @code{VF_GetOutline()} function for Type1 font
 
3445
should be used only when 
 
3446
the same font in other font format is not available.
 
3447
@*
 
3448
 
 
3449
@noindent
 
3450
@b{Font class name:} @code{type1}
 
3451
@*
 
3452
 
 
3453
@noindent
 
3454
@b{Capabilities for font class default:}
 
3455
@*
 
3456
 
 
3457
@table @asis
 
3458
 
 
3459
@item @code{font-directories} (optional)
 
3460
--- A list of directories of Type1 font files.
 
3461
This driver supports font file search by kpathsea.
 
3462
To search a font file by kpathsea,
 
3463
use @code{TEXMF} for a directory name.
 
3464
 
 
3465
@item @code{afm-directories} (optional)
 
3466
--- A list of directories of AFM files.
 
3467
Each element of this capability should not be a directory for
 
3468
recursive search (ending by @t{//}).
 
3469
This is why AFM files are searched by inside of T1Lib,
 
3470
although Type1 font files are searched by a file search subsystem of VFlib.
 
3471
 
 
3472
@item @code{encoding-vector-directories} (optional)
 
3473
--- A list of directories of encoding files.
 
3474
Each element of this capability should not be a directory for
 
3475
recursive search (ending by @t{//}).
 
3476
This is why encoding vector files are searched by inside of T1Lib.
 
3477
 
 
3478
By default, directories
 
3479
@code{/usr/local/share/VFlib/@var{x.y.z}/t1lib/} and 
 
3480
@code{/usr/local/share/VFlib/site/t1lib/} 
 
3481
are registered.
 
3482
Optional directories can be installed by this capability.
 
3483
 
 
3484
T1Lib adopts file format for encoding vector file.
 
3485
When we want to use encoding vector files supplied by @command{dvips}, 
 
3486
we must convert them into T1Lib format.
 
3487
To automate this, you can use a Unix Shell script @command{mkt1enc.sh} 
 
3488
which is in @code{/usr/local/share/VFlib/@var{x.y.z}/t1lib/} directory.
 
3489
Encoding vector files for @command{dvips} are converted 
 
3490
into T1Lib format and they are also installed in this directory.
 
3491
 
 
3492
@item @code{point-size} (optional)
 
3493
 
 
3494
@item @code{pixel-size} (optional)
 
3495
 
 
3496
@item @code{dpi} (optional)
 
3497
 
 
3498
@item @code{dpi-x} (optional)
 
3499
 
 
3500
@item @code{dpi-y} (optional)
 
3501
 
 
3502
@item @code{aspect-ratio} (optional)
 
3503
 
 
3504
@item @code{log-level} (optional)
 
3505
--- Select logfile output type of T1Lib.
 
3506
The filename of a logfile is @file{t1lib.log}.
 
3507
If this capability is not given, the logfile is not created.
 
3508
 
 
3509
@table @asis
 
3510
@item @code{error} 
 
3511
  Only error messages are written to the logfile.
 
3512
@item @code{warning} 
 
3513
  Warning messages and error messages are written to the logfile.
 
3514
@item @code{statistics} 
 
3515
  Statistics messages and above written to the logfile.
 
3516
@item @code{debug} 
 
3517
  Any messages useful for debugging and above are written to the logfile.
 
3518
@item @code{none} 
 
3519
  Never use a logfile.
 
3520
@end table
 
3521
 
 
3522
See users manual of T1Lib for detail.
 
3523
 
 
3524
@item @code{properties} (optional)
 
3525
 
 
3526
@item @code{variable-values} (optional)
 
3527
@end table
 
3528
@*
 
3529
 
 
3530
@noindent
 
3531
@b{Capabilities for font definition:}
 
3532
@*
 
3533
 
 
3534
@table @asis
 
3535
@item @code{font-class} (essential)
 
3536
This value must be "type1".  
 
3537
 
 
3538
@item @code{font-file} (optional)
 
3539
A list of font file names.
 
3540
Font file is searched in the listed order 
 
3541
until existing font files is found.
 
3542
 
 
3543
example: @code{(font-file "AvantGarde-Book" "a0100131.pfb")}
 
3544
 
 
3545
By this example, @file{AvantGarde-Book} is seached first.
 
3546
If it exists, it is opened.
 
3547
Otherwise,  @file{a0100131.pfb} is seached next.
 
3548
If it exists, it is opened.
 
3549
If it does not exist either, font open fails.
 
3550
 
 
3551
@item @code{encoding-vector} (optional)
 
3552
A file name for encoding vector.
 
3553
This file must be reside in a directoy listed by
 
3554
@code{encoding-vector-directories} capability for type1 font 
 
3555
class default. 
 
3556
 
 
3557
@item @code{point-size} (optional)
 
3558
 
 
3559
@item @code{pixel-size} (optional)
 
3560
 
 
3561
@item @code{dpi} (optional)
 
3562
 
 
3563
@item @code{dpi-x} (optional)
 
3564
 
 
3565
@item @code{dpi-y} (optional)
 
3566
 
 
3567
@item @code{magnification} (optional)
 
3568
 
 
3569
@item @code{aspect-ratio} (optional)
 
3570
 
 
3571
@item @code{slant-factor} (optional)
 
3572
--- Slant factor of a font.
 
3573
This value is tan(@var{th}), where @var{th} is slant angle of a font.
 
3574
Default value is 0, in case of @var{th} is 90 degree.
 
3575
 
 
3576
example: @code{(slant-factor 0.2)}
 
3577
 
 
3578
@c @item @code{character-set} (optional)
 
3579
@c --- Together with @code{encoding} capability, this capability
 
3580
@c is used to change "external view" of a font.
 
3581
@c A font would be a font of a character set given by this capability
 
3582
@c and encoding given by @code{encoding} capability.
 
3583
@c Conversion of font internal character set and encoding to
 
3584
@c an external view is determined by these capability.
 
3585
@c Conversion is done by by code conversion system, called CCV.  
 
3586
@c @ref{Code conversion system}
 
3587
@c Code conversion files are specified in 
 
3588
@c @code{code-conversion-files} in @code{VFlib} font class default.
 
3589
@c @xref{VFlib defaults}
 
3590
@c 
 
3591
@c For example, a font of JIS X 0208 character set (a Japanese character set)
 
3592
@c in Shift-JIS encoding fonts can be accessed as a JIS encoding font.
 
3593
@c 
 
3594
@c @item @code{encoding} (optional)
 
3595
@c --- Together with @code{character-set} capability, 
 
3596
@c this capability defines a external view of a font.   
 
3597
@c @ref{Code conversion system}
 
3598
 
 
3599
@item @code{properties} (optional)
 
3600
 
 
3601
@end table
 
3602
 
 
3603
 
 
3604
 
 
3605
@c    Node,           Next,           Previous,       Up
 
3606
@node Zeit font class, JG font class, Type1 font class, Writing a vflibcap
 
3607
@section Zeit font class
 
3608
@cindex Zeit font class
 
3609
 
 
3610
This font class supports @i{"Syotai Kurubu"} format;
 
3611
it is a vector font format for Japanese Kanji characters. 
 
3612
 
 
3613
Several free Japanese fonts in this file format are available.
 
3614
 
 
3615
@itemize @bullet
 
3616
@item 
 
3617
Umeda vector fonts
 
3618
@itemize @minus
 
3619
@item 
 
3620
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/umeda-vector/mincho.vf1.gz}
 
3621
@item 
 
3622
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/umeda-vector/mincho.vf2.gz}
 
3623
@item 
 
3624
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/umeda-vector-font/mincho.vf1.gz}
 
3625
@item 
 
3626
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/umeda-vector-font/mincho.vf2.gz}
 
3627
@end itemize
 
3628
@*
 
3629
 
 
3630
@item 
 
3631
Watanabe vector fonts
 
3632
@itemize @minus
 
3633
@item 
 
3634
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/watanabe-vector/mincho.vf1.gz}
 
3635
@item 
 
3636
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/watanabe-vector/mincho.vf2.gz}
 
3637
@item 
 
3638
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/watanabe-vector-font/mincho.vf1.gz}
 
3639
@item 
 
3640
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/watanabe-vector-font/mincho.vf2.gz}
 
3641
@end itemize
 
3642
@*
 
3643
 
 
3644
@item 
 
3645
Wadalab fonts
 
3646
@itemize @minus
 
3647
@item 
 
3648
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/wadalab-vector/}
 
3649
@item 
 
3650
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/wadalab-vector-font/}
 
3651
@item 
 
3652
See also @url{ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/} for Free Japanese Kanji
 
3653
fonts in Type 1 formats.
 
3654
@end itemize
 
3655
@end itemize
 
3656
 
 
3657
This font class does not support compressed font files nor implicit fonts.
 
3658
@*
 
3659
 
 
3660
@noindent
 
3661
@b{Font class name:} @code{zeit}
 
3662
@*
 
3663
 
 
3664
@noindent
 
3665
@b{Capabilities for font class default:}
 
3666
@*
 
3667
 
 
3668
@table @asis
 
3669
@item @code{font-directories} (optional)
 
3670
 
 
3671
@item @code{filename-extensions} (optional)
 
3672
--- Two file files form a font for this font class, e.g., @code{mincho.vf1}
 
3673
and @code{mincho.vf2}. Extension candidates without digit must be 
 
3674
the value for this capability.  
 
3675
 
 
3676
example: @code{(filename-extensions ".vf" ".VF")}
 
3677
 
 
3678
@item @code{point-size} (optional)
 
3679
 
 
3680
@item @code{pixel-size} (optional)
 
3681
 
 
3682
@item @code{dpi} (optional)
 
3683
 
 
3684
@item @code{dpi-x} (optional)
 
3685
 
 
3686
@item @code{dpi-y} (optional)
 
3687
 
 
3688
@item @code{aspect-ratio} (optional)
 
3689
 
 
3690
@item @code{writing-direction} (optional)
 
3691
--- Default writing direction. 
 
3692
@code{Horizontal} or @code{vertical}; default is @code{Horizontal}. 
 
3693
This is the same as 
 
3694
@code{(vector-to-bbx-upper-left 0.0 0.86)}
 
3695
and @code{(vector-to-next-ref-point 1.0 0.0)} if value of this
 
3696
capability is "horizontal". 
 
3697
Otherwise, it is the same as
 
3698
@code{(vector-to-bbx-upper-left -0.5 0.0)}
 
3699
and @code{(vector-to-next-ref-point 0.0 -1.0)}.
 
3700
 
 
3701
@item @code{vector-to-bbx-upper-left} (optional)
 
3702
--- Default value of a vector from the reference point of a character to
 
3703
upper-left bounding box. Right and up are positive directions.
 
3704
 
 
3705
example: @code{(vector-to-bbx-upper-left 0 0.86)}
 
3706
 
 
3707
@item @code{vector-to-next-ref-point} (optional)
 
3708
--- Default value of a vector from the reference
 
3709
point to next reference point. 
 
3710
 
 
3711
example: @code{(vector-to-next-ref-point 1.0 0.0)}
 
3712
 
 
3713
@item @code{properties} (optional)
 
3714
 
 
3715
@item @code{variable-values} (optional)
 
3716
 
 
3717
@end table
 
3718
@*
 
3719
 
 
3720
@noindent
 
3721
@b{Capabilities for font definition:}
 
3722
 
 
3723
@table @asis
 
3724
@item @code{font-class} (essential)
 
3725
--- A font class name. 
 
3726
 
 
3727
@item @code{font-name} (optional)
 
3728
--- Font file name without extensions.
 
3729
Together with vale and extension given by default description,
 
3730
font file names are formed.
 
3731
For example, if @code{mincho} is given for the @code{font-name} capability and
 
3732
@code{(".vf")} is given for the @code{filename-extensions} capability, then
 
3733
font files @code{mincho.vf1} and @code{mincho.vf2} are used.
 
3734
 
 
3735
example: @code{(font-name "mincho")}
 
3736
 
 
3737
@item @code{point-size} (optional)
 
3738
 
 
3739
@item @code{pixel-size} (optional)
 
3740
 
 
3741
@item @code{dpi} (optional)
 
3742
 
 
3743
@item @code{dpi-x} (optional)
 
3744
 
 
3745
@item @code{dpi-y} (optional)
 
3746
 
 
3747
@item @code{magnification} (optional)
 
3748
 
 
3749
@item @code{aspect-ratio} (optional)
 
3750
 
 
3751
@item @code{writing-direction} (optional)
 
3752
 
 
3753
@item @code{vector-to-bbx-upper-left} (optional)
 
3754
 
 
3755
example: @code{(vector-to-bbx-upper-left 0 0.86)}
 
3756
 
 
3757
@item @code{vector-to-next-ref-point} (optional)
 
3758
 
 
3759
example: @code{(vector-to-next-ref-point 1.0 0.0)}
 
3760
 
 
3761
@item @code{properties} (optional)
 
3762
@end table
 
3763
 
 
3764
 
 
3765
 
 
3766
@c    Node,          Next,          Previous,        Up
 
3767
@node JG font class, eKanji font class, Zeit font class, Writing a vflibcap
 
3768
@section JG font class
 
3769
@cindex JG font class
 
3770
 
 
3771
JG font format is a vector font format for Japanese character sets
 
3772
JIS X 0208. JG font driver is based on the work by Hideo Morishita.
 
3773
@*
 
3774
 
 
3775
@noindent
 
3776
@b{Font class name:} @code{jg}
 
3777
@*
 
3778
 
 
3779
@noindent
 
3780
@b{Capabilities for font class default:}
 
3781
@*
 
3782
 
 
3783
@table @asis
 
3784
@item @code{filename-extensions} (optional)
 
3785
--- Three files form a font for this font class, e.g., @code{mincho.fn0},
 
3786
@code{mincho.fn1}, and @code{mincho.fn2}. 
 
3787
Extension candidates without digit must be 
 
3788
the value for this capability.  
 
3789
 
 
3790
example: @code{(filename-extensions ".fn" ".FN")}
 
3791
@end table
 
3792
 
 
3793
(Other capabilities are the same as @code{zeit} font class.)
 
3794
 
 
3795
@b{Capability for font definition:}
 
3796
 
 
3797
Capabilities are the same as @code{zeit} font class.
 
3798
 
 
3799
 
 
3800
 
 
3801
@c    Node,          Next,          Previous,        Up
 
3802
@node eKanji font class, TeX default and TeX font mapping font class, JG font class, Writing a vflibcap
 
3803
@section eKanji font class
 
3804
@cindex eKanji font class
 
3805
 
 
3806
The eKanji font format is a bitmap font format for Kanji characters.
 
3807
The first character in an eKanji font file has code point 1, and
 
3808
the second character has code point 2.
 
3809
That is, characters in an eKanji font are numbered sequentially 
 
3810
starting from 1.
 
3811
(This encoding scheme can be changed by setting some capabilities.)
 
3812
 
 
3813
eKanji font files are distributed at the following URL:
 
3814
@url{http://www.zinbun.kyoto-u.ac.jp/~ekanji/}
 
3815
The distribution package contains the following font files.
 
3816
 
 
3817
@itemize @bullet
 
3818
 
 
3819
@item Unicode (@file{ekan0010.d24})
 
3820
@cindex Unicode
 
3821
 
 
3822
@item Kyoto University KangXi (@file{ekan0020.d24})
 
3823
@cindex KangXi
 
3824
 
 
3825
@item Morohashi DaiKanwa (@file{ekan0030.d24})
 
3826
@cindex Morohashi DaiKanwa
 
3827
 
 
3828
@item JIS X 0208 (@file{jisx9052.d24})
 
3829
 
 
3830
@end itemize
 
3831
 
 
3832
 
 
3833
@noindent
 
3834
@b{Font class name:} @code{ekanji}
 
3835
 
 
3836
@noindent
 
3837
@b{Capabilities for font class default:}
 
3838
 
 
3839
@table @asis
 
3840
@item @code{font-directories} (optional)
 
3841
 
 
3842
@item @code{font-dot-size} (optional)
 
3843
--- Dot size of characters in the font file.
 
3844
Default value is 24.
 
3845
 
 
3846
example: @code{(font-dot-size 24)}
 
3847
 
 
3848
@item @code{point-size} (optional)
 
3849
 
 
3850
@item @code{pixel-size} (optional)
 
3851
 
 
3852
@item @code{dpi} (optional)
 
3853
 
 
3854
@item @code{dpi-x} (optional)
 
3855
 
 
3856
@item @code{dpi-y} (optional)
 
3857
 
 
3858
@item @code{aspect-ratio} (optional)
 
3859
 
 
3860
@item @code{writing-direction} (optional)
 
3861
--- Default writing direction. 
 
3862
@code{Horizontal} or @code{vertical}; default is @code{Horizontal}. 
 
3863
This is the same as 
 
3864
@code{(vector-to-bbx-upper-left 0.0 0.92)}
 
3865
and @code{(vector-to-next-ref-point 1.0 0.0)} if value of this
 
3866
capability is "Horizontal". 
 
3867
Otherwise, it is the same as
 
3868
@code{(vector-to-bbx-upper-left -0.5 0.0)}
 
3869
and @code{(vector-to-next-ref-point 0.0 -1.0)}.
 
3870
 
 
3871
@item @code{vector-to-bbx-upper-left} (optional)
 
3872
--- Default value of a vector from the reference point of a character to
 
3873
upper-left bounding box. Right and up are positive directions.
 
3874
 
 
3875
example: @code{(vector-to-bbx-upper-left 0 0.90)}
 
3876
 
 
3877
@item @code{vector-to-next-ref-point} (optional)
 
3878
--- Default value of a vector from the reference
 
3879
point to next reference point. 
 
3880
 
 
3881
example: @code{(vector-to-next-ref-point 1.0 0.0)}
 
3882
 
 
3883
@item @code{properties} (optional)
 
3884
 
 
3885
@item @code{variable-values} (optional)
 
3886
 
 
3887
@end table
 
3888
@*
 
3889
 
 
3890
 
 
3891
@b{Capability for font definition:}
 
3892
 
 
3893
@table @asis
 
3894
@item @code{font-class} (essential)
 
3895
--- A font class name. 
 
3896
 
 
3897
@item @code{font-name} (optional)
 
3898
--- Font file name with extension.
 
3899
 
 
3900
@item @code{font-dot-size} (optional)
 
3901
--- Dot size of characters in the font file.
 
3902
 
 
3903
@item @code{point-size} (optional)
 
3904
 
 
3905
@item @code{pixel-size} (optional)
 
3906
 
 
3907
@item @code{dpi} (optional)
 
3908
 
 
3909
@item @code{dpi-x} (optional)
 
3910
 
 
3911
@item @code{dpi-y} (optional)
 
3912
 
 
3913
@item @code{magnification} (optional)
 
3914
 
 
3915
@item @code{aspect-ratio} (optional)
 
3916
 
 
3917
@item @code{character-set} (optional)
 
3918
@itemx @code{encoding} (optional)
 
3919
@itemx @code{font-character-set} (optional)
 
3920
@itemx @code{font-encoding} (optional)
 
3921
--- Select code conversion.
 
3922
If you want to access a eKanji font by ISO-2022 (JIS) encoding scheme, define 
 
3923
@code{eKanji} for @code{character-set}, 
 
3924
@code{ISO2022} for @code{encoding},
 
3925
@code{eKanji} for @code{font-character-set}, and
 
3926
@code{SEQUENTIAL2-1} for @code{encoding}.
 
3927
Then the first character in the eKanji font is accessed by code point 0x2121.
 
3928
 
 
3929
@item @code{mock-font-encoding} (optional)
 
3930
--- By this capability, encoding of an eKanji font file is virtually changed.
 
3931
This capability requires an argument and parameter.
 
3932
There are three keywords for an argument:
 
3933
 
 
3934
@itemize @bullet
 
3935
 
 
3936
@item @code{raw}
 
3937
No effect, i.e., font encoding is not changed.
 
3938
 
 
3939
@item @code{subblocks-94x94} @var{B}
 
3940
An eKanji font file is virtually divided by 94x94 sub blocks 
 
3941
(blocks of 94x94 = 8836 characters)
 
3942
and selects @var{B}-th block for this font definition. 
 
3943
This implies that an eKanji font file with this capability offers only
 
3944
8836 (= 94x94) characters among all the characters of an eKanji font file.
 
3945
The first sub block is numbered zero. 
 
3946
(A font with @var{B} = 0 for this capability selects the first sub block.)
 
3947
 
 
3948
Characters with character code from @math{8836*B+1} to @math{8836*B+8836}
 
3949
in an eKanji font file is accessed by character code 
 
3950
from 0x2121 to 0x7e7e.
 
3951
 
 
3952
@item @code{subblocks-94x60} @var{B}
 
3953
This is similar to the case for @code{subblocks-94x60}.
 
3954
An eKanji font file is virtually divided by 94x60 sub blocks 
 
3955
(blocks of 94x60 = 5640 characters)
 
3956
and selects @var{B}-th block for this font definition. 
 
3957
The first sub block is numbered zero. 
 
3958
 
 
3959
Characters with character code from @math{5640*B+1} to @math{5640*B+5640}
 
3960
in an eKanji font file is accessed by character code 
 
3961
from 0x3021 to 0x4e7e (first 30 rows) and 
 
3962
from 0x5021 to 0x6e7e (another 30 rows).
 
3963
(This division scheme is the same as Mojikyo scheme.)
 
3964
 
 
3965
@item @code{with-offset} @var{OFFS}
 
3966
An offset value @var{OFFS} is added to obtain 
 
3967
character code of a character in an eKanji font file.
 
3968
When @var{OFFS} is @code{-0x4dff}, 
 
3969
the first character in an eKanji font file is accessed by
 
3970
code number 0x4e00, since @math{0x4e00 + (-0x4dff) = 1}.
 
3971
 
 
3972
@end itemize
 
3973
 
 
3974
Theoretically, the same functionality shown above can be implemented within 
 
3975
the CCV subsystem framework @ref{Code conversion system},
 
3976
the eKanji font driver defines this capability, 
 
3977
since the eKanji font file format adopts curious character encoding scheme
 
3978
and it seems to be simpler and cleaner to define this capability.
 
3979
 
 
3980
@item @code{writing-direction} (optional)
 
3981
 
 
3982
@item @code{vector-to-bbx-upper-left} (optional)
 
3983
 
 
3984
example: @code{(vector-to-bbx-upper-left 0 0.86)}
 
3985
 
 
3986
@item @code{vector-to-next-ref-point} (optional)
 
3987
 
 
3988
example: @code{(vector-to-next-ref-point 1.0 0.0)}
 
3989
 
 
3990
@item @code{properties} (optional)
 
3991
 
 
3992
@end table
 
3993
 
 
3994
 
 
3995
 
 
3996
@c    Node,          Next,          Previous,      Up
 
3997
@node TeX default and TeX font mapping font class, PK font class, eKanji font class, Writing a vflibcap
 
3998
@section @TeX{} default and @TeX{} font mapping font class
 
3999
@cindex @TeX{} default and @TeX{} font mapping font class
 
4000
 
 
4001
This is a special font class to define common default values 
 
4002
of @TeX{}-related font classes.
 
4003
 
 
4004
This font class has a feature to map a requested font to another font. 
 
4005
Thus, this class is also called 
 
4006
@i{"@TeX{} font mapping class"} or @i{"@TeX{} font mapper"}.
 
4007
@TeX{}-related font classes include the followings:
 
4008
GF, PK, TFM, VF, ASCII Japanese TeX.
 
4009
 
 
4010
This font class supports only implicit fonts and
 
4011
explicit fonts is not supported. 
 
4012
Therefore, the driver name of this font class must be given in 
 
4013
@code{extension-hints} and/or @code{implicit-font-classes} capabilities
 
4014
in the @code{VFlib} default description 
 
4015
if you want to use the font mapping feature of this class.
 
4016
 
 
4017
Mapped font is recursively (recursively) requested to open and
 
4018
any operations such as obtaining bitmaps on the requested font are
 
4019
applied on the mapped font.
 
4020
@*
 
4021
 
 
4022
@noindent
 
4023
@b{Font class name:} @code{TeX}
 
4024
@*
 
4025
 
 
4026
@noindent
 
4027
@b{Capabilities for font class default:}
 
4028
@*
 
4029
 
 
4030
@table @asis
 
4031
 
 
4032
@item @code{dpi} (optional)
 
4033
--- Default device resolution for @TeX{}-related fonts.
 
4034
 
 
4035
@item @code{tfm-directories} (optional)
 
4036
--- A list of  directories of TFM files. 
 
4037
Directories listed by this capability is used for searching TFM files.
 
4038
If a directory name is @code{TEXMF}, kpathsea is invoked to
 
4039
search a file.
 
4040
 
 
4041
example: @code{(tfm-directories "TEXMF" "/usr/local/share/font/tfm//")}
 
4042
 
 
4043
@item @code{tfm-filename-extensions} (optional)
 
4044
--- A list of extensions of filenames for TFM files.
 
4045
This is used to construct a TFM file name, e.g., "cmr10.tfm"
 
4046
for a font "cmr10".
 
4047
 
 
4048
example: @code{(tfm-filename-extensions "tfm")}
 
4049
 
 
4050
@item @code{font-mapping} (optional)
 
4051
--- Font mapping rules are described in this capability.
 
4052
When a font is requested to open (as an implicit font),
 
4053
the font name is mapped to another name and specified 
 
4054
font driver is requested to open the mapped font.
 
4055
 
 
4056
Syntax of this capability is as follows:
 
4057
@example
 
4058
(font-mapping
 
4059
  ((@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS}) ... 
 
4060
   @var{FONT-NAME} @var{FONT-NAME} ...)
 
4061
  ((@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS}) ... 
 
4062
   @var{FONT-NAME} @var{FONT-NAME} ...)
 
4063
  ...) 
 
4064
@end example
 
4065
 
 
4066
Thus, value for this capability is a sequence of items 
 
4067
@code{((@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS}) ... 
 
4068
 @var{FONT-NAME} @var{FONT-NAME} ...)}, and this forms a mapping rule.
 
4069
@var{FONT-NAME} is a font name and this rule applies if
 
4070
requested font name matches @var{FONT-NAME}.
 
4071
(@var{FONT-NAME} is a name without directory and extension parts.
 
4072
A font name requested to open is compared with @var{FONT-NAME}
 
4073
by deleting directory and extension parts.)
 
4074
If @var{FONT-NAME} contains @code{*} character,
 
4075
it matches to the rest of requested font name.
 
4076
For example, @code{cm*} matches @code{cmr10} and @code{cmbx10}.
 
4077
Thus, in case @var{FONT-NAME} is @code{*}, all fonts matches and thus all fonts
 
4078
applies the rule.
 
4079
 
 
4080
The font name is mapped according to the format @var{MAPPING-FORMAT} and 
 
4081
mapped name is opened by calling a font driver @var{DRIVER-NAME}.
 
4082
@code{VF_OpenFont1()} and @code{VF_OpenFont2()} are not used.
 
4083
(As a special case, when @var{DRIVER-NAME} is @code{*},
 
4084
@code{VF_OpenFont1()} or @code{VF_OpenFont2()} is used to open 
 
4085
a mapped font.)
 
4086
 
 
4087
The syntax of @var{MAPPING-FORMAT} is similar to a format string of 
 
4088
@code{printf()} function in C library, 
 
4089
but conversion characters and semantics are different.
 
4090
Conversion specification is introduced by @code{%} character.
 
4091
Non-conversion characters are simply copied and 
 
4092
conversion specifications are substituted for the following:
 
4093
 
 
4094
@table @asis
 
4095
@item @code{%%}
 
4096
 @code{%} character
 
4097
@item @code{%f}
 
4098
 the requested font name without extension and directory parts.
 
4099
@item @code{%d}
 
4100
 font file resolution part in the extension of the requested font name
 
4101
@item @code{%e}
 
4102
 file format part in the extension of the requested font name
 
4103
@end table
 
4104
For instance, let @code{/foo/bar/qwe.300pk} is the requested font name.
 
4105
Then @code{%f} is @code{qwe}, @code{%d} is @code{300}, 
 
4106
and @code{%e} is @code{pk}.
 
4107
A conversion specification will be null string if 
 
4108
corresponding substring does not exist. 
 
4109
 
 
4110
In general, mapped fonts are opened with the same parameters 
 
4111
(device resolution, magnification factors, point or pixel size)
 
4112
of the requested font.
 
4113
Such parameters can be changed by optional @var{FONT-OPEN-OPTIONS} part.
 
4114
Following descriptions can be used for @var{FONT-OPEN-OPTIONS}:
 
4115
 
 
4116
We can specify multiple 
 
4117
@code{(@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS})}
 
4118
in a rule description.
 
4119
This is useful if we need to write multiple mapping rules 
 
4120
for the same set of fonts.
 
4121
 
 
4122
A font is opened by the following way.
 
4123
@enumerate
 
4124
@item
 
4125
For each rule (from the first one to the last one),
 
4126
the requested font name is checked if the rule applies to the font.
 
4127
If the rule does not apply, check next rule.
 
4128
 
 
4129
@item 
 
4130
For each (@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS})
 
4131
in the rule, the requested font is mapped and font open is attempted.
 
4132
If a mapped font is is successfully opened, it is used as a requested font.
 
4133
Otherwise, next mapping 
 
4134
(@var{DRIVER-NAME} @var{MAPPING-FORMAT} @var{FONT-OPEN-OPTIONS})
 
4135
is attempted.  This is repeated for a mapped font is opened.
 
4136
 
 
4137
@item 
 
4138
If mapped fonts are not opened, next rule is checked.
 
4139
This is repeated for all rules until a mapped font is opened.
 
4140
 
 
4141
@end enumerate
 
4142
 
 
4143
example:
 
4144
@example
 
4145
(font-mapping
 
4146
 ((ascii-jtex-kanji "%f.jtex")  
 
4147
  "min*" "goth*" "tmin*" "tgoth*")
 
4148
 ((type1 "%f.pfb" point-size-from-tfm (magnification-adjustment 1.0)) 
 
4149
  *)
 
4150
 ((pk "%f.%dpk") (gf "%f.%dgf") (tfm "%f.tfm")
 
4151
  *))
 
4152
@end example
 
4153
 
 
4154
For this example, suppose that @code{min10.300pk} is requested to open.
 
4155
 
 
4156
@enumerate
 
4157
 
 
4158
@item
 
4159
The first rule applies to the requested font since @code{min*} is in the
 
4160
font list.
 
4161
The @code{ascii-jtex-kanji} driver is invoked to open a mapped name 
 
4162
@code{min10.jtex}.  If it is opened, font open succeeds;
 
4163
@code{min10.jtex} is used as @code{min10.300pk} and font open finishes.
 
4164
If the font is not opened, continue to the next step.
 
4165
 
 
4166
@item 
 
4167
The second rule applies to the requested font since @code{*} is given in 
 
4168
the font list.
 
4169
The @code{type1} driver is invoked to open a mapped name @code{min10.pfb}.
 
4170
If it is opened, @code{min10.jtex} is used as @code{min10.300pk} 
 
4171
and font open finishes.
 
4172
If the font is not opened, continue to the next step.
 
4173
 
 
4174
@item 
 
4175
The second rule applies to the reqiested font since @code{*} is given in 
 
4176
the font list.
 
4177
@enumerate
 
4178
@item 
 
4179
The @code{pk} driver is invoked to open a mapped name @code{min10.300pk}.
 
4180
If it is not opened, next mapping is attempted.
 
4181
@item 
 
4182
The @code{gf} driver is invoked to open a mapped name @code{min10.300gf}.
 
4183
If it is not opened, next mapping is attempted.
 
4184
@item 
 
4185
The @code{tfm} driver is invoked to open a mapped name @code{min10.tfm}.
 
4186
@end enumerate
 
4187
 
 
4188
@end enumerate
 
4189
If everything above fails, font open for @code{cmr10.300pk} fails.
 
4190
 
 
4191
 
 
4192
@itemize @bullet
 
4193
@item @code{point-size-from-tfm} (optional)
 
4194
--- When a mapped font is opened (in mode 1, high resolution oriented mode),
 
4195
point size which is obtained from a TFM file is given.
 
4196
This is necessary when we use TrueType and/or Type1 fonts for mapped fonts.
 
4197
For example, "cmr10.ttf" and "cmr10.pfb" in the BaKoMa font set do not 
 
4198
have point size information,
 
4199
since TrueType and Type1 format fonts cannot have information on point size.
 
4200
 
 
4201
@item @code{(magnification-adjustment @var{mag})} (optional)
 
4202
--- Mapped fonts are opened with magnification factors magnified 
 
4203
by @var{mag}.  This can be used to adjust size of mapped fonts.
 
4204
But most of the case, this is not necessary.
 
4205
 
 
4206
@end itemize
 
4207
 
 
4208
As a restriction of fonts of this class,
 
4209
each font must have a TFM file.
 
4210
 
 
4211
@item @code{resolution-accuracy} (optional)
 
4212
@itemx @code{resolution-corrections} (optional)
 
4213
--- According to arithmetic errors, DPI value for font files and
 
4214
computed value (= device resolution times magnification value)
 
4215
may be different. 
 
4216
These two capabilities give correct resolution values for PK and GF fonts.
 
4217
 
 
4218
Syntax of these capabilities are as follows:
 
4219
@example
 
4220
(resolution-accuracy @var{ACCURACY})
 
4221
(resolution-corrections
 
4222
  (@var{DEVICE-RESOLUTION} @var{FONT-RESOLION} @var{FONT-RESOLION} ... )
 
4223
  (@var{DEVICE-RESOLUTION} @var{FONT-RESOLION} @var{FONT-RESOLION} ... )
 
4224
   ...)
 
4225
@end example
 
4226
@var{DEVICE-RESOLUTION} is the resolution of target device in DPI
 
4227
and @var{FONT-RESOLUTION} is a font resolution value.
 
4228
 
 
4229
To find a font file, font resolution is computed by
 
4230
device resolution times magnification factor.
 
4231
Then, this driver finds a list 
 
4232
@code{(@var{DEVICE-RESOLUTION} @var{FONT-RESOLUTION} 
 
4233
@var{FONT-RESOLUTION} ... )}
 
4234
such that @var{DEVICE-RESOLUTION} is the same as resolution of target device.
 
4235
(If there is no such list is the capability value, 
 
4236
font file resolution is not corrected and computed value is used.)
 
4237
 
 
4238
For each @var{FONT-RESOLUTION} in the list, the driver checks 
 
4239
if the computed font file resolution is in the range
 
4240
from @var{FONT-RESOLUTION} times (1-@var{ACCURACY})
 
4241
to   @var{FONT-RESOLUTION} times (1+@var{ACCURACY}).
 
4242
If the computed resolution is in the range, 
 
4243
font file resolution is changed to @var{FONT-RESOLUTION}.
 
4244
Then, a font file is searched by the corrected font file resolution.
 
4245
 
 
4246
example:
 
4247
@example
 
4248
(resolution-accuracy 0.02)
 
4249
(resolution-corrections
 
4250
 (300  ;; cx
 
4251
  300  329  360  432  518  622  746  896 1075 1290  240 270)
 
4252
 (600  ;; ljfour
 
4253
  600  657  720  864 1037 1244 1493 1792 2150 2580  480 540))
 
4254
@end example
 
4255
 
 
4256
Be careful not to map to the same name!
 
4257
Otherwise, font open will be an infinite loop.
 
4258
(VFlib restricts the depth of nested font open.
 
4259
Even if the font name is mapped to the same name, 
 
4260
VFlib will detects an error, anyway.)
 
4261
 
 
4262
@item @code{properties} (optional)
 
4263
 
 
4264
@item @code{variable-values} (optional)
 
4265
 
 
4266
@end table
 
4267
 
 
4268
 
 
4269
 
 
4270
@c    Node,          Next,          Previous,      Up
 
4271
@node PK font class, GF font class, TeX default and TeX font mapping font class, Writing a vflibcap
 
4272
@section PK font class
 
4273
@cindex PK font class
 
4274
 
 
4275
PK fonts are bitmap fonts used by @TeX{} system.
 
4276
PK font driver provides a logical view of PK fonts when a
 
4277
font is requested to open as an implicit font;
 
4278
if a given font filename is @code{cmr10.pk},
 
4279
requested device resolution is 300 and magnification is 1.2,
 
4280
then PK font driver looks for a font file @code{cmr10.360pk}.
 
4281
Thus, font names (for font open) should not be the same as 
 
4282
font filenames on filesystems.
 
4283
 
 
4284
To search a font file, the kpathsea library can be used.
 
4285
A special name @code{TEXMF} in a list of font directories 
 
4286
(capability @code{font-directories}) is used to search 
 
4287
a file by kpathsea.
 
4288
 
 
4289
To enable kpathsea, the value for @code{use-kpathsea} capability
 
4290
in @code{VFlib} class default must be @code{"Yes"}.
 
4291
 
 
4292
This font class supports compressed font files and implicit fonts.
 
4293
@*
 
4294
 
 
4295
@noindent
 
4296
@b{Font class name:} @code{pk}
 
4297
@*
 
4298
 
 
4299
@noindent
 
4300
@b{Capabilities for font class default:}
 
4301
@*
 
4302
 
 
4303
@table @asis
 
4304
@item @code{font-directories} (optional)
 
4305
--- A list of directory names for font files.
 
4306
This driver supports font file search by kpathsea.
 
4307
To search a font file by kpathsea,
 
4308
use @code{TEXMF} for a directory name.
 
4309
 
 
4310
@item @code{filename-extensions} (optional)
 
4311
--- A list of extensions of filenames for PK fonts.
 
4312
This is used to construct a font file name "cmr10.300pk"
 
4313
from "cmr10.pk" for 300 dpi fonts.
 
4314
 
 
4315
example: @code{(filename-extensions "pk")}
 
4316
 
 
4317
@item @code{make-missing-glyph} (optional)
 
4318
--- Generate a PK font file from Metafont source file by running METAFONT
 
4319
    on the fly, if a requested PK font file does not exist.
 
4320
example: @code{(make-missing-glyphs "yes")}
 
4321
 
 
4322
@item @code{point-size} (optional)
 
4323
 
 
4324
@item @code{pixel-size} (optional)
 
4325
 
 
4326
@item @code{dpi} (optional)
 
4327
 
 
4328
@item @code{properties} (optional)
 
4329
 
 
4330
@item @code{variable-values} (optional)
 
4331
 
 
4332
@end table
 
4333
@*
 
4334
 
 
4335
@noindent
 
4336
@b{Capabilities for font definition:}
 
4337
@*
 
4338
 
 
4339
@table @asis
 
4340
@item @code{font-class} (essential)
 
4341
--- A font class name. 
 
4342
 
 
4343
@item @code{font-file} (optional)
 
4344
--- a font filename.  An extension (e.g., @code{.300pk}) can be omitted.
 
4345
In case of this capability is not given, 
 
4346
font name is used as this capability value.
 
4347
 
 
4348
@item @code{point-size} (optional)
 
4349
 
 
4350
@item @code{pixel-size} (optional)
 
4351
 
 
4352
@item @code{dpi} (optional)
 
4353
 
 
4354
@item @code{properties} (optional)
 
4355
 
 
4356
@item @code{magnification} (optional)
 
4357
@end table
 
4358
 
 
4359
 
 
4360
@c    Node,          Next,           Previous,      Up
 
4361
@node GF font class, TFM font class, PK font class, Writing a vflibcap
 
4362
@section GF font class
 
4363
@cindex GF font class
 
4364
@*
 
4365
 
 
4366
@noindent
 
4367
@b{Font class name:} @code{gf}
 
4368
@*
 
4369
 
 
4370
Other capabilities are the same as ones for @code{pk} font class.
 
4371
 
 
4372
 
 
4373
 
 
4374
@c    Node,          Next,           Previous,      Up
 
4375
@node TFM font class, VF font class, GF font class, Writing a vflibcap
 
4376
@section TFM font class
 
4377
@cindex TFM font class
 
4378
 
 
4379
TFM files contains only metric information for typesetting @TeX{} documents.
 
4380
This font class provides fonts whose metrics are defined by TFM font files.
 
4381
Since TFM files do not have glyph,
 
4382
glyph of a font of this font class are (black or white) rectangles.
 
4383
Fonts of this font class can be used as substitutes of PK, GF, or VF files
 
4384
in case they are missing.
 
4385
 
 
4386
If the file is not found, it is searched by @code{font-directories}
 
4387
capability given in @code{TFM} font class default description.
 
4388
Note that the extension of font files (given by the 
 
4389
@code{filename-extensions} capability) has no effect 
 
4390
for searching by kpathsea library.
 
4391
The extension of font files must be ".tfm". 
 
4392
See kpathsea manual for detail.
 
4393
 
 
4394
This font class supports compressed font files and implicit fonts.
 
4395
@*
 
4396
 
 
4397
@noindent
 
4398
@b{Font class name:} @code{tfm}
 
4399
@*
 
4400
 
 
4401
@noindent
 
4402
@b{Capabilities for font class default:}
 
4403
@*
 
4404
 
 
4405
@table @asis
 
4406
@item @code{font-directories} (optional)
 
4407
--- A list of directory names for font files.
 
4408
This driver supports font file search by kpathsea.
 
4409
To search a font file by kpathsea,
 
4410
use @code{TEXMF} for a directory name.
 
4411
 
 
4412
@item @code{filename-extensions} (optional)
 
4413
 
 
4414
@item @code{glyph-style} (optional)
 
4415
--- Defines default glyph style: @code{empty} or @code{fill}.
 
4416
If @code{empty} is given, all glyph of a font are white rectangles.
 
4417
If @code{fill} is given, all glyph of a font are black rectangles.
 
4418
 
 
4419
@item @code{point-size} (optional)
 
4420
 
 
4421
@item @code{pixel-size} (optional)
 
4422
 
 
4423
@item @code{dpi} (optional)
 
4424
 
 
4425
@item @code{properties} (optional)
 
4426
 
 
4427
@item @code{variable-values} (optional)
 
4428
@end table
 
4429
 
 
4430
@noindent
 
4431
@b{Capabilities for font definition:}
 
4432
 
 
4433
@table @asis
 
4434
@item @code{font-class} (essential)
 
4435
 --- A font class name. 
 
4436
 
 
4437
@item @code{font-file} (optional)
 
4438
 
 
4439
@item @code{glyph-style} (optional)
 
4440
--- Defines glyph style: @code{empty} or @code{fill}.
 
4441
If @code{empty} is given, all glyph of a font are white rectangles.
 
4442
If @code{fill} is given, all glyph of a font are black rectangles.
 
4443
 
 
4444
@item @code{point-size} (optional)
 
4445
 
 
4446
@item @code{pixel-size} (optional)
 
4447
 
 
4448
@item @code{dpi} (optional)
 
4449
 
 
4450
@item @code{magnification} (optional)
 
4451
 
 
4452
@item @code{aspect-ratio} (optional)
 
4453
 
 
4454
@item @code{properties} (optional)
 
4455
 
 
4456
@end table
 
4457
 
 
4458
 
 
4459
@c    Node,          Next,                                Previous,       Up
 
4460
@node VF font class, ASCII Japanese TeX Kanji font class, TFM font class, Writing a vflibcap
 
4461
@section VF font class
 
4462
@cindex VF font class
 
4463
 
 
4464
This font class handles @i{Virtual Font} files.
 
4465
A virtual font consists of a font program and subfonts.
 
4466
A font program in a vf file is similar to DVI file formats.
 
4467
Glyph of a virtual font are constructed from a box instruction
 
4468
in a font program and glyph taken from subfonts.
 
4469
Therefore, this font class requires a font mapping rule to obtain
 
4470
glyph from subfonts.
 
4471
You can specify VFlib not to open subfonts of a virtual font
 
4472
in case of subfonts are unavailable.
 
4473
 
 
4474
@noindent
 
4475
@b{Font class name:} @code{vf}
 
4476
 
 
4477
@noindent
 
4478
@b{Capabilities for font class default:}
 
4479
 
 
4480
@table @asis
 
4481
@item @code{font-directories} (optional)
 
4482
--- A list of directory names for font files.
 
4483
This driver supports font file search by kpathsea library.
 
4484
To search a font file by kpathsea library,
 
4485
use @code{TEXMF} for a directory name.
 
4486
 
 
4487
@item @code{filename-extensions} (optional)
 
4488
--- A extension string for virtual font files.
 
4489
 
 
4490
example: @code{(filename-extensions "vf")}
 
4491
 
 
4492
@item @code{tfm-directories} (optional)
 
4493
 
 
4494
@item @code{tfm-filename-extensions} (optional)
 
4495
 
 
4496
@item @code{font-mapping} (optional)
 
4497
--- A set of rules for mapping for subfonts to open as an VFlib fonts. 
 
4498
This is the same as @TeX{} font mapper, i.e.,
 
4499
@code{font-mapping} capability for @code{TeX} font class 
 
4500
default description.
 
4501
 
 
4502
Be careful not to map to the same name!
 
4503
Otherwise, font open will be an infinite loop.
 
4504
(VFlib restricts the depth of nested font open.
 
4505
Even if the font name is mapped to the same name, 
 
4506
VFlib will detects an error, anyway.)
 
4507
 
 
4508
 
 
4509
@item @code{open-style} (optional)
 
4510
--- This capability specifies how subfonts are opened.
 
4511
@table @asis
 
4512
@item @code{none}
 
4513
--- Boxes are used instead of glyph of subfonts.
 
4514
Subfonts are not opened.
 
4515
@item @code{try}
 
4516
--- The virtual font driver tries to open each subfont.
 
4517
If subfonts are opened, glyph are taken from opened subfonts.
 
4518
If some subfonts are not opened, boxes are used instead of glyph of 
 
4519
such subfonts.  
 
4520
It is not an error even if all subfonts are not opened.
 
4521
@item @code{require}
 
4522
--- The virtual font driver tries to open each subfont.
 
4523
It is an error if every subfont is not opened.
 
4524
 
 
4525
@end table
 
4526
 
 
4527
@item @code{glyph-style} (optional)
 
4528
--- In case boxes are used instead of glyph of subfonts,
 
4529
this capability controls the looks of boxes.
 
4530
@table @asis
 
4531
@item @code{empty}
 
4532
--- Boxes are white, i.e., all pixels are value 0.
 
4533
@item @code{fill}
 
4534
--- Boxes are black, i.e., all pixels are value 1.
 
4535
@end table
 
4536
 
 
4537
@item @code{point-size} (optional)
 
4538
 
 
4539
@item @code{pixel-size} (optional)
 
4540
 
 
4541
@item @code{dpi} (optional)
 
4542
 
 
4543
@item @code{properties} (optional)
 
4544
 
 
4545
@item @code{variables} (optional)
 
4546
 
 
4547
@item @code{debug} (optional)
 
4548
 
 
4549
@end table
 
4550
 
 
4551
@noindent
 
4552
@b{Capabilities for font definition:}
 
4553
 
 
4554
@table @asis
 
4555
@item @code{font-file} (optional)
 
4556
--- File name of a virtual font.
 
4557
 
 
4558
@item @code{point-size} (optional)
 
4559
 
 
4560
@item @code{pixel-size} (optional)
 
4561
 
 
4562
@item @code{dpi} (optional)
 
4563
 
 
4564
@item @code{magnification} (optional)
 
4565
 
 
4566
@item @code{properties} (optional)
 
4567
 
 
4568
@end table
 
4569
 
 
4570
 
 
4571
 
 
4572
@c    Node,                  Next,                      Previous,      Up
 
4573
@node ASCII Japanese TeX Kanji font class, Japanese comic font class, VF font class, Writing a vflibcap
 
4574
@section ASCII Japanese @TeX{} Kanji font class
 
4575
@cindex ASCII Japanese @TeX{} Kanji font class
 
4576
 
 
4577
This is for @i{Kanji} fonts of Japanese @TeX{} localized by ASCII Co.
 
4578
This font driver provides @i{Kanji} fonts that can be accessed
 
4579
as if they were PK fonts by using another VFlib font.
 
4580
Font metrics of @i{Kanji} characters defined by ASCII j@TeX{} 
 
4581
may not match that of a @i{Kanji} font to be used.
 
4582
This case happens when @code{jiskan24.pcf} font is used 
 
4583
as a Japanese @i{Kanji} font for @TeX{}.
 
4584
This font driver works as a @emph{filter} that 
 
4585
modifies font metrics of another font.
 
4586
Change of font metrics is defined by an external file
 
4587
called @code{adjustment file}.
 
4588
See sample distribution of adjustment files for their syntax.
 
4589
(Not documented now...)
 
4590
 
 
4591
Font metrics of a font of this class is defined by a TFM font;
 
4592
a vector to the next reference point is taken from a TFM file.
 
4593
A vector to upper left corner of a bitmap is taken from subfont.
 
4594
Then, font metrics is modified according to an adjustment file.
 
4595
 
 
4596
This driver supports vertical writing. 
 
4597
In case fonts for vertical writing are not available,
 
4598
the driver rotates glyph of some characters, e,g, parenthesis,
 
4599
to yield (possible) correct glyph.
 
4600
 
 
4601
 
 
4602
@noindent 
 
4603
@b{Font class name:} @code{ascii-jtex}
 
4604
 
 
4605
@noindent
 
4606
@b{Capabilities for font class default:}
 
4607
 
 
4608
@table @asis
 
4609
 
 
4610
@item @code{implicit-font-mapping-suffix} (optional)
 
4611
--- A suffix to map a font name for searching an implicit font.
 
4612
Suppose a font is requested to open. 
 
4613
Then, font name is mapped in such a way that 
 
4614
extension is deleted and the suffix given by this 
 
4615
capability is added. Then, an vflibcap entry of the mapped name
 
4616
is searched. If such an entry exists, it is used for the implicit font
 
4617
and the font is opened as if it were an explicit font.
 
4618
(Note that a font of the mapped name must exist as an explicit font, 
 
4619
not as an implicit font.)
 
4620
 
 
4621
Suppose @code{min10.400pk} is requested to open as an implicit font and
 
4622
the value of this capability is @code{.jtex}.
 
4623
Then mapped name is @code{min10.jtex} and it is opened by this font
 
4624
driver internally. 
 
4625
 
 
4626
example: @code{(implicit-font-mapping-suffix ".jtex")}
 
4627
 
 
4628
@item @code{tfm-directories} (optional)
 
4629
 
 
4630
@item @code{tfm-filename-extensions} (optional)
 
4631
 
 
4632
@item @code{properties} (optional)
 
4633
 
 
4634
@item @code{variable-values} (optional)
 
4635
@end table
 
4636
 
 
4637
@noindent 
 
4638
@b{Capabilities for font definition:}
 
4639
 
 
4640
@table @asis
 
4641
@item @code{font-class} (essential)
 
4642
--- A font class name. 
 
4643
 
 
4644
@item @code{kanji-font} (optional)
 
4645
--- Font name for a subfont.
 
4646
 
 
4647
@item @code{kanji-font-point-size} (optional)
 
4648
--- Default point size of subfont.
 
4649
If point size is not explicitly given when a font is opened,
 
4650
This value is used. 
 
4651
  
 
4652
@item @code{kanji-font-pixel-size} (optional)
 
4653
--- Default pixel size of a subfont.
 
4654
If pixel size is not explicitly given when a font is opened,
 
4655
This value is used. 
 
4656
 
 
4657
@item @code{kanji-font-magnification} (optional)
 
4658
--- magnification factor for subfont.
 
4659
 
 
4660
@item @code{tfm-file} (optional)
 
4661
--- TFM file that defines font metrics of a font.
 
4662
 
 
4663
example: @code{(tfm-file "min10.tfm")}
 
4664
 
 
4665
@item @code{metric-adjustment-file} (optional)
 
4666
--- a file name for font metric adjustment file.
 
4667
 
 
4668
@item @code{properties} (optional)
 
4669
@end table
 
4670
 
 
4671
 
 
4672
@c      Node,                  Next,             Previous,              Up
 
4673
@node Japanese comic font class, Try font class, ASCII Japanese TeX Kanji font class, Writing a vflibcap
 
4674
@section Japanese comic font class
 
4675
@cindex Japanese comic font class
 
4676
 
 
4677
This font driver composes two Japanese @i{Kanji} fonts.
 
4678
According to code point (@i{Kana} or @i{kanji} character),
 
4679
one of two font is selected to obtain a bitmap or metric.
 
4680
This font class provides Japanese fonts
 
4681
that composes @i{Kana} and @i{Kanji} font. 
 
4682
 
 
4683
@noindent
 
4684
@b{Font class name:} @code{japanese-comic}
 
4685
 
 
4686
@noindent
 
4687
@b{Capabilities for font class default:}
 
4688
 
 
4689
@table @asis
 
4690
@item @code{point-size} (optional)
 
4691
@item @code{pixel-size} (optional)
 
4692
@item @code{dpi} (optional)
 
4693
@item @code{properties} (optional)
 
4694
@item @code{variable-values} (optional)
 
4695
@end table
 
4696
 
 
4697
@noindent
 
4698
@b{Capabilities for font definition:}
 
4699
 
 
4700
@table @asis
 
4701
@item @code{font-class} (essential)
 
4702
--- A font class name. 
 
4703
 
 
4704
@item @code{kanji-font} (optional)
 
4705
--- A VFlib font name for Kanji characters.
 
4706
For code points for Kanji characters,
 
4707
this font is used to obtain bitmaps and metrics.
 
4708
 
 
4709
@item @code{kana-font} (optional)
 
4710
--- A VFlib font name for Kana font
 
4711
(code point: 0x2121 ... 0x287f).
 
4712
For code points except Kanji characters,
 
4713
this font is used to obtain bitmaps and metrics.
 
4714
 
 
4715
@item @code{symbol-font} (optional)
 
4716
--- A VFlib font name for symbol characters
 
4717
(code point: 0x2121 ... 0x227f).
 
4718
If this capability is not given, a font given by @code{kana-font} is used
 
4719
for symbol characters.
 
4720
 
 
4721
@item @code{alpha-numeric-font} (optional)
 
4722
--- A VFlib font name for alphabet and numeric characters
 
4723
(code point: 0x2321 ... 0x237f).
 
4724
If this capability is not given, a font given by @code{kana-font} is used
 
4725
for alphabet and numeric characters.
 
4726
 
 
4727
@item @code{hirakana-font} (optional)
 
4728
--- A VFlib font name for Hirakana characters
 
4729
(code point: 0x2421 ... 0x247f).
 
4730
If this capability is not given, a font given by @code{kana-font} is used
 
4731
for Hirakana characters.
 
4732
 
 
4733
@item @code{katakana-font} (optional)
 
4734
--- A VFlib font name for Katakana characters
 
4735
(code point: 0x2521 ... 0x257f).
 
4736
If this capability is not given, a font given by @code{kana-font} is used
 
4737
for Katakana characters.
 
4738
 
 
4739
@item @code{greek-font} (optional)
 
4740
--- A VFlib font name for Greek characters
 
4741
(code point: 0x2621 ... 0x267f).
 
4742
If this capability is not given, a font given by @code{kana-font} is used
 
4743
for Greek characters.
 
4744
 
 
4745
@item @code{cyrillic-font} (optional)
 
4746
--- A VFlib font name for Cyrillic characters
 
4747
(code point: 0x2721 ... 0x277f).
 
4748
If this capability is not given, a font given by @code{kana-font} is used
 
4749
for Cyrillic characters.
 
4750
 
 
4751
@item @code{keisen-font} (optional)
 
4752
--- A VFlib font name for Keisen characters
 
4753
(code point: 0x2821 ... 0x287f).
 
4754
If this capability is not given, a font given by @code{kana-font} is used
 
4755
for Keisen characters.
 
4756
 
 
4757
 
 
4758
@item @code{point-size} (optional)
 
4759
@item @code{pixel-size} (optional)
 
4760
@item @code{dpi} (optional)
 
4761
@item @code{magnification} (optional)
 
4762
@item @code{properties} (optional)
 
4763
@end table
 
4764
 
 
4765
 
 
4766
 
 
4767
@c      Node,         Next,               Previous,                Up
 
4768
@node Try font class, Mojikyo font mapping class, Japanese comic font class, Writing a vflibcap
 
4769
@section Try font class
 
4770
@cindex Try font class
 
4771
 
 
4772
A font of this font class has a list of @emph{sub-fonts}.
 
4773
When a font of this class is requested open, 
 
4774
the try font driver tries to open the sub-fonts one after another until
 
4775
one of them is successfully opened.
 
4776
If all sub-fonts in the list are not opened, the font is failed to be opened.
 
4777
All font operation of the font is applied to an opened sub-font.
 
4778
 
 
4779
 
 
4780
@noindent
 
4781
@b{Font class name:} @code{try}
 
4782
 
 
4783
@noindent
 
4784
@b{Capabilities for font class default:}
 
4785
 
 
4786
@table @asis
 
4787
@item @code{properties} (optional)
 
4788
@item @code{variable-values} (optional)
 
4789
@end table
 
4790
 
 
4791
@noindent
 
4792
@b{Capabilities for font definition:}
 
4793
 
 
4794
@table @asis
 
4795
@item @code{font-class} (essential)
 
4796
--- A font class name. 
 
4797
This must be @code{try}.
 
4798
 
 
4799
@item @code{font-list} (optional)
 
4800
--- A list of sub-fonts.  
 
4801
These fonts are VFlib fonts, not a font file names.
 
4802
 
 
4803
@item @code{point-size} (optional)
 
4804
@item @code{pixel-size} (optional)
 
4805
@item @code{dpi} (optional)
 
4806
@item @code{magnification} (optional)
 
4807
@item @code{properties} (optional)
 
4808
@end table
 
4809
 
 
4810
 
 
4811
 
 
4812
@c      Node,         Next,               Previous,                Up
 
4813
@node Mojikyo font mapping class, Example vflibcap 1, Try font class, Writing a vflibcap
 
4814
@section Mojikyo font mapping class
 
4815
@cindex Mojikyo font mapping class
 
4816
 
 
4817
This font driver is specific to the Mojikyo font files, which 
 
4818
is a huge collection (more than 80 thousand) of Kanji characters.
 
4819
(Access @url{http://www.mojikyo.gr.jp/} for detail.)
 
4820
The Mojikyo font is supplied by a set of font files,
 
4821
since the number of characters is too huge to contain
 
4822
in a single font file.
 
4823
 
 
4824
The Mojikyo font defines its own character encoding, staring from 1
 
4825
and each character has its own character code.
 
4826
(Character codes are not the codes in a font file.)
 
4827
The Mojikyo font set is supplied by both TrueType and Type 1 formats.
 
4828
A single character space of the Mojikyo is
 
4829
divided into font file number and character code in a font file.
 
4830
This means that we must compute font file among many font files
 
4831
and code point in a font file to obtain a glyph of Mojikyo characters.
 
4832
To avoid such complex procedure, this font driver provides
 
4833
a virtual single font. 
 
4834
 
 
4835
Note that this font driver only delegates requested characters to
 
4836
other font driver (TrueType or Type 1).
 
4837
Therefore, TrueType and/or Type 1 font driver must be configured in VFlib
 
4838
and they must be propopery set up in a vflibcap file.
 
4839
 
 
4840
 
 
4841
@noindent
 
4842
@b{Font class name:} @code{mojikyo-mapper}
 
4843
 
 
4844
@noindent
 
4845
@b{Capabilities for font class default:}
 
4846
 
 
4847
@table @asis
 
4848
@item @code{properties} (optional)
 
4849
@item @code{variable-values} (optional)
 
4850
@end table
 
4851
 
 
4852
@noindent
 
4853
@b{Capabilities for font definition:}
 
4854
 
 
4855
@table @asis
 
4856
@item @code{font-class} (essential)
 
4857
--- A font class name. 
 
4858
This must be @code{mojikyo-mapper}.
 
4859
 
 
4860
@item @code{division-scheme} (optional)
 
4861
Mapping scheme from the Mojikyo character space to real font files
 
4862
is different by real font file format (TrueType/Type1).
 
4863
This capability defines which mapping scheme is used.
 
4864
 
 
4865
If @code{truetype} is given for this capability,
 
4866
underlaying font files are in TrueType format.
 
4867
If @code{type1} is given for this capability,
 
4868
underlaying font files are in Type 1 format.
 
4869
Default value for this capability is @code{truetype}.
 
4870
 
 
4871
Aliases of division scheme names are defined as follows:
 
4872
@code{ttf} is an alias of @code{truetype}, and
 
4873
@code{pfb} is an alias of @code{type1}.
 
4874
 
 
4875
@item @code{subfont-name-format} (optional)
 
4876
This capability defines format of font file names.
 
4877
If @code{truetype} is selected for @code{division-scheme} capability,
 
4878
@code{Mojik%d.ttf} is assumed for this capability by default.
 
4879
@code{%d} in @code{Mojik%d.ttf} is substituted by font number, 
 
4880
starting from 101.
 
4881
If @code{type1} is selected for @code{division-scheme} capability,
 
4882
@code{mo%dm%02d.pfb} is assumed for this capability by default.
 
4883
The first @code{%d} in @code{mo%dm%02d.pfb} is a major font number,
 
4884
starting from 101. 
 
4885
The second @code{%d} in @code{mo%dm%02d.pfb} is a minor font number,
 
4886
starting from 6.
 
4887
 
 
4888
In case you want to use a font name format other than described above,
 
4889
this capability should be defined.
 
4890
Note that format sting should contain exactly one @code{%d} 
 
4891
if you select @code{truetype} division scheme, 
 
4892
and exactly two @code{%d}s if you select @code{type1} division scheme. 
 
4893
 
 
4894
 
 
4895
@item @code{truetype-subfont-encoding} (optional)
 
4896
This capability has effect only when @code{truetype} division scheme 
 
4897
is selected.
 
4898
This capability selects character encoding scheme of underlaying 
 
4899
TrueType font files.
 
4900
If @code{unicode} is given to this capability,
 
4901
underlaying TrueType fonts are encoded in Unicode.
 
4902
If @code{iso-2022} (as aliases, @code{iso2022} or @code{jis} can
 
4903
be used) is given to this capability, underlaying TrueType fonts 
 
4904
are encoded in ISO 2022 (JIS).
 
4905
 
 
4906
Default value is @code{unicode}, which is the same as the 
 
4907
the Mojikyo font files in TrueType format.
 
4908
 
 
4909
@item @code{properties} (optional)
 
4910
 
 
4911
@end table
 
4912
 
 
4913
 
 
4914
 
 
4915
 
 
4916
@c    Node,               Next,               Previous,       Up
 
4917
@node Example vflibcap 1, Example vflibcap 2, Mojikyo font mapping class, Writing a vflibcap
 
4918
@section Example vflibcap 1
 
4919
 
 
4920
This example vflibcap is for general use.
 
4921
@c vflibcaps/vflibcaps (sniped)
 
4922
 
 
4923
@example
 
4924
;; -----------------------------------------------------------------
 
4925
;;   VFlib Default
 
4926
;; -----------------------------------------------------------------
 
4927
(define-default  VFlib
 
4928
  ;; hint to find font class from font name for fast font open
 
4929
  (extension-hints  (".bdf" bdf) (".pcf" pcf) (".hbf" hbf)
 
4930
                    (".ttf" truetype) (".ttc" truetype)
 
4931
                    (".pfa" type1) (".pfb" type1)
 
4932
                    ("pk" TeX) ("gf" gf) ("tfm" tfm))
 
4933
  ;; implicit font classes
 
4934
  (implicit-font-classes  pcf bdf hbf truetype type1 zeit jg gf tfm)
 
4935
 
 
4936
  ;; uncompression programs
 
4937
  (uncompression-programs  (".Z" "zcat") (".gz" "gzip -cd"))
 
4938
 
 
4939
  ;; a list of default values of variables
 
4940
  ;; *Note* "variable-values" must come before variable uses
 
4941
  (variable-values  (TeX_DPI               "300")
 
4942
                    (TeX_USE_KPATHSEA      "Yes")
 
4943
                    (TeX_KPATHSEA_MODE     "cx") 
 
4944
                    (TeX_KPATHSEA_PROGRAM  "/usr/local/bin/xldvi"))
 
4945
 
 
4946
  ;; kpathsea: enabled/disabled 
 
4947
  (use-kpathsea           $TeX_USE_KPATHSEA)
 
4948
  ;; kpathsea mode (e.g., "cx")
 
4949
  (kpathsea-mode          $TeX_KPATHSEA_MODE)
 
4950
  ;; kpathsea program name (e.g., "/usr/local/bin/xdvi")
 
4951
  (kpathsea-program-name  $TeX_KPATHSEA_PROGRAM)
 
4952
 
 
4953
  ;; encoding/charset conversion files
 
4954
  (code-conversion-files  
 
4955
   "iso8859-1_unicode.ccv" "iso8859-2_unicode.ccv" "iso8859-3_unicode.ccv"
 
4956
   "iso8859-4_unicode.ccv" "iso8859-5_unicode.ccv" "iso8859-6_unicode.ccv"
 
4957
   "iso8859-7_unicode.ccv" "iso8859-8_unicode.ccv" "iso8859-9_unicode.ccv"
 
4958
   "jisx0201_unicode.ccv" "jisx0208_unicode.ccv" "jisx0212_unicode.ccv"
 
4959
   "ksc5601_unicode.ccv"
 
4960
   "gb12345_unicode.ccv" "gb2312_unicode.ccv"
 
4961
   "big5_unicode.ccv" "cns11643_unicode.ccv"
 
4962
   "iso8859-5_koi8-r.ccv" "koi8-r_iso8859-5.ccv" "koi8-r_unicode.ccv"))
 
4963
 
 
4964
;; -----------------------------------------------------------------
 
4965
;;   BDF Font Class Default
 
4966
;; -----------------------------------------------------------------
 
4967
(define-default  bdf
 
4968
  ;; font directories
 
4969
  (font-directories  "/usr/local/share/fonts/X11//")
 
4970
  ;; extensions of compressed font files that this font class supports
 
4971
  (compression-extensions ".gz" ".Z")
 
4972
  ;; default values for fonts of this font class
 
4973
  (variable-values    (VAR1 ("PROP1" "VAL1"))  ; just for debugging...
 
4974
                      (VAR2 ("PROP2" "VAL2"))
 
4975
                      (VARX ("PROPX" "VFlib-VALX")) )
 
4976
  ;; properties for all fonts of this font class
 
4977
  (properties ("FONT_CLASS" "BDF")) )
 
4978
 
 
4979
;; -----------------------------------------------------------------
 
4980
;;   PCF Font Class Default
 
4981
;; -----------------------------------------------------------------
 
4982
(define-default  pcf
 
4983
  ;; font directories
 
4984
  (font-directories  "/usr/X11R6/lib/X11/fonts//"
 
4985
                     "/usr/local/X11R6/lib/X11/fonts//"
 
4986
                     "/usr/openwin/lib/X11/fonts//"
 
4987
                     "/usr/X386/lib/X11/fonts//"
 
4988
                     "/usr/XFree86/lib/X11/fonts//"
 
4989
                     "/usr/X11/lib/X11/fonts//"
 
4990
                     "/usr/local/lib/X11/fonts//"
 
4991
                     "/usr/X11R5/lib/X11/fonts//"
 
4992
                     "/usr/local/X11R5/lib/X11/fonts//"
 
4993
                     "/usr/local/share/fonts/X11//")
 
4994
  ;; extensions of compressed font files that this font class supports
 
4995
  (compression-extensions ".gz" ".Z")
 
4996
  ;; properties for all fonts of this font class
 
4997
  (properties ("FONT_CLASS" "PCF"))  )
 
4998
 
 
4999
;; -----------------------------------------------------------------
 
5000
;;   HBF Font Class Default
 
5001
;; -----------------------------------------------------------------
 
5002
(define-default  hbf
 
5003
  ;; font directories
 
5004
  (font-directories  "/usr/local/share/fonts/HBF//")
 
5005
  ;; extensions of compressed font files that this font class supports
 
5006
  (compression-extensions ".gz" ".Z")
 
5007
  ;; properties for all fonts of this font class
 
5008
  (properties ("FONT_CLASS" "HBF"))  )
 
5009
 
 
5010
;; -----------------------------------------------------------------
 
5011
;; TrueType Font Class Default
 
5012
;; -----------------------------------------------------------------
 
5013
(define-default  truetype
 
5014
  ;; font directories
 
5015
  (font-directories  "TEXMF"  ; - a special name to search by `kpathsea'
 
5016
                     "/usr/local/share/fonts/bakoma/ttf/"
 
5017
                     "/usr/local/share/fonts/FontCity2//"
 
5018
                     "/usr/local/share/fonts/DynaFont-Premium30/win95//"
 
5019
                     "/usr/local/share/fonts/DynaFont-SpecialPack1/win95//"
 
5020
                     "/usr/local/share/fonts/TrueTypeWorld-ValueFont141//"
 
5021
                     "/usr/local/share/fonts/FontAsia//"
 
5022
                     "/usr/local/share/fonts/FontGarden/ttf//"  )
 
5023
  ;; debugging flags   ('*' selects all)
 
5024
  (debug "")
 
5025
  ;; properties for all fonts of this font class
 
5026
  (properties ("FONT_CLASS" "TrueType"))  )
 
5027
  
 
5028
;; -----------------------------------------------------------------
 
5029
;; Type1 Font Class Default
 
5030
;; -----------------------------------------------------------------
 
5031
(define-default type1
 
5032
  ;; font (pfa, pfb) directories
 
5033
  (font-directories "TEXMF"  ; - a special name to search by `kpathsea'
 
5034
                    "/usr/local/share/fonts/bakoma/pfb/")
 
5035
  ;; AFM directories
 
5036
  (afm-directories "TEXMF"   ; - a special name to search by `kpathsea'
 
5037
                   "/usr/local/share/fonts/bakoma/afm/")
 
5038
  ;; T1Lib logfile output level: "none", "error", "warning", "stat", "debug"
 
5039
  (log-level "none"))
 
5040
 
 
5041
;; -----------------------------------------------------------------
 
5042
;;   Syotrai Club Font Class Default
 
5043
;; -----------------------------------------------------------------
 
5044
(define-default  zeit
 
5045
  ;; filename extensions ("vf" for "mincho.vf@{1,2@}")
 
5046
  (filename-extensions  ".vf")
 
5047
  ;; font directories
 
5048
  (font-directories   "/usr/local/share/fonts/Watanabe//"
 
5049
                      "/usr/local/share/fonts/WadaLab//")
 
5050
  ;; properties for all fonts of this font class
 
5051
  (properties  ("FONT_CLASS" "ZEIT")
 
5052
               ("CHARSET_REGISTRY" "jisx0208.1983")
 
5053
               ("CHARSET_ENCODING" "0") ))
 
5054
 
 
5055
;; -----------------------------------------------------------------
 
5056
;;   JG Font Class Default
 
5057
;; -----------------------------------------------------------------
 
5058
(define-default  jg
 
5059
  ;; filename extensions ("fn" for "zkyo0by.fn@{0,1,2@}")
 
5060
  (filename-extensions ".fn")
 
5061
  ;; font directories
 
5062
  (font-directories  "/usr/local/share/fonts/JG-Fonts//")
 
5063
  ;; properties for all fonts of this font class
 
5064
  (properties  ("FONT_CLASS" "JG")
 
5065
               ("CHARSET_REGISTRY" "jisx0208.1983")
 
5066
               ("CHARSET_ENCODING" "0")))
 
5067
 
 
5068
;; -----------------------------------------------------------------
 
5069
;;   TeX-related Font Class Default and TeX Font Mapper
 
5070
;; -----------------------------------------------------------------
 
5071
(define-default  TeX
 
5072
  ;; TFM file directories
 
5073
  (tfm-directories  "TEXMF"
 
5074
                    "/usr/local/share/fonts/bakoma/tfm/")
 
5075
  ;; possible extensions of TFM files
 
5076
  (tfm-filename-extensions  ".tfm")
 
5077
  ;; font name mapping rules
 
5078
  (font-mapping
 
5079
   ((ascii-jtex-kanji "%f.jtex")  "min*" "goth*" "tmin*" "tgoth*")
 
5080
   ((type1 "%f.pfb" point-size-from-tfm (magnification-adjustment 1.0)) 
 
5081
     *)
 
5082
   ((pk "%f.%dpk") (gf "%f.%dgf")  *)
 
5083
   ((tfm "%f.%dtfm")  *))
 
5084
  ;; accuracy of device resolutions, used with 'resolution-corrections'
 
5085
  (resolution-accuracy 0.02)
 
5086
  ;; font resolution values for each device resolutions.
 
5087
  (resolution-corrections
 
5088
   (240  ;; sparcptr
 
5089
    240  263  288  312  346  415  498  597)
 
5090
   (300  ;; cx
 
5091
    300  329  360  432  518  622  746  896 1075 1290  240 270)
 
5092
   (400  ;; sparcptr
 
5093
    400  438  480  576  691  829  995 1194 1433 1720  320 360)
 
5094
   (600  ;; ljfour
 
5095
    600  657  720  864 1037 1244 1493 1792 2150 2580  480 540))
 
5096
  ;; default device resolution
 
5097
  (dpi $TeX_DPI))
 
5098
 
 
5099
;; -----------------------------------------------------------------
 
5100
;;   TeX GF Font Class Default
 
5101
;; -----------------------------------------------------------------
 
5102
(define-default  gf
 
5103
  ;; font directories
 
5104
  (font-directories  "TEXMF" 
 
5105
                     "/usr/local/TeX/gf//")
 
5106
  ;; properties for all fonts of this font class
 
5107
  (properties  ("FONT_CLASS" "GF")) )
 
5108
 
 
5109
;; -----------------------------------------------------------------
 
5110
;;   TeX PK Font Class Default
 
5111
;; -----------------------------------------------------------------
 
5112
(define-default  pk
 
5113
  ;; font directories
 
5114
  (font-directories  "TEXMF"
 
5115
                     "/usr/local/TeX/pk//")
 
5116
  ;; properties for all fonts of this font class
 
5117
  (properties  ("FONT_CLASS" "PK")) )
 
5118
 
 
5119
;; -----------------------------------------------------------------
 
5120
;;   TeX TFM Font Class Default
 
5121
;; -----------------------------------------------------------------
 
5122
(define-default  tfm
 
5123
  ;; font directories
 
5124
  (font-directories  "TEXMF"
 
5125
                     "/usr/local/TeX/tfm//")
 
5126
  ;; glyph style: "fill" (all pixels black) or "empty" (all pixels white)
 
5127
  (glyph-style  "fill")
 
5128
  ;; properties for all fonts of this font class
 
5129
  (properties  ("FONT_CLASS" "TFM")) )
 
5130
 
 
5131
;; -----------------------------------------------------------------
 
5132
;;   ASCII-jTeX Kanji Font Class Default
 
5133
;; -----------------------------------------------------------------
 
5134
(define-default  ascii-jtex-kanji
 
5135
  ;; TFM file directories
 
5136
  (tfm-directories  "TEXMF")
 
5137
  ;; possible extensions of TFM files
 
5138
  (tfm-filename-extensions ".tfm")
 
5139
  ;; Suffix for name mapping
 
5140
  ;; (e.g., implicit font "min10.300pk" is mapped to "min10.jtex")
 
5141
  (implicit-font-mapping-suffix ".jtex"))
 
5142
 
 
5143
;; -----------------------------------------------------------------
 
5144
;;   Japanese Comic Font Class Default
 
5145
;; -----------------------------------------------------------------
 
5146
(define-default  japanese-comic
 
5147
  ;; debugging flags   ('*' selects all)
 
5148
  (debug "f")
 
5149
  ;; properties for all fonts of this font class
 
5150
  (properties  ("FONT_CLASS" "JAPANESE-COMIC")
 
5151
               ("CHARSET_REGISTRY" "jisx0208.1983")
 
5152
               ("CHARSET_ENCODING" "0")))
 
5153
 
 
5154
 
 
5155
;; -----------------------------------------------------------------
 
5156
;;  sample font definitions for Japanese TeX
 
5157
 
 
5158
(define-font jtex-min    (font-class pcf) (font-file "jiskan24.pcf"))
 
5159
(define-font jtex-goth   (font-class pcf) (font-file "jiskan24.pcf"))
 
5160
(define-font jtex-tmin   (font-class pcf) (font-file "jiskan24.pcf"))
 
5161
(define-font jtex-tgoth  (font-class pcf) (font-file "jiskan24.pcf"))
 
5162
 
 
5163
;; Definitions for "min10" fonts. These fonts are used by
 
5164
;; 'name mapping' feature of ascii-jtex-kanji driver.
 
5165
;; (e.g., "min10.400pk" is mapped to "min10.jtex")
 
5166
(define-macro min-common
 
5167
  (font-class ascii-jtex-kanji) (kanji-font jtex-min)
 
5168
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24.adj"))
 
5169
(define-macro goth-common
 
5170
  (font-class ascii-jtex-kanji) (kanji-font jtex-goth)
 
5171
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24.adj"))
 
5172
(define-macro tmin-common
 
5173
  (font-class ascii-jtex-kanji) (kanji-font jtex-tmin)  
 
5174
  (kanji-font-magnification 0.85) 
 
5175
  (metric-adjustment-file "jiskan24v.adj"))
 
5176
(define-macro tgoth-common
 
5177
  (font-class ascii-jtex-kanji) (kanji-font jtex-tgoth)
 
5178
  (kanji-font-magnification 0.85) 
 
5179
  (metric-adjustment-file "jiskan24v.adj"))
 
5180
(define-font min5.jtex     (kanji-font-point-size  5)  min-common)
 
5181
(define-font min6.jtex     (kanji-font-point-size  6)  min-common)
 
5182
(define-font min7.jtex     (kanji-font-point-size  7)  min-common)
 
5183
(define-font min8.jtex     (kanji-font-point-size  8)  min-common)
 
5184
(define-font min9.jtex     (kanji-font-point-size  9)  min-common)
 
5185
(define-font min10.jtex    (kanji-font-point-size 10)  min-common)
 
5186
(define-font goth5.jtex    (kanji-font-point-size  5)  goth-common)
 
5187
(define-font goth6.jtex    (kanji-font-point-size  6)  goth-common)
 
5188
(define-font goth7.jtex    (kanji-font-point-size  7)  goth-common)
 
5189
(define-font goth8.jtex    (kanji-font-point-size  8)  goth-common)
 
5190
(define-font goth9.jtex    (kanji-font-point-size  9)  goth-common)
 
5191
(define-font goth10.jtex   (kanji-font-point-size 10)  goth-common)
 
5192
(define-font tmin5.jtex    (kanji-font-point-size  5)  tmin-common)
 
5193
(define-font tmin6.jtex    (kanji-font-point-size  6)  tmin-common)
 
5194
(define-font tmin7.jtex    (kanji-font-point-size  7)  tmin-common)
 
5195
(define-font tmin8.jtex    (kanji-font-point-size  8)  tmin-common)
 
5196
(define-font tmin9.jtex    (kanji-font-point-size  9)  tmin-common)
 
5197
(define-font tmin10.jtex   (kanji-font-point-size 10)  tmin-common)
 
5198
(define-font tgoth5.jtex   (kanji-font-point-size  5)  tgoth-common)
 
5199
(define-font tgoth6.jtex   (kanji-font-point-size  6)  tgoth-common)
 
5200
(define-font tgoth7.jtex   (kanji-font-point-size  7)  tgoth-common)
 
5201
(define-font tgoth8.jtex   (kanji-font-point-size  8)  tgoth-common)
 
5202
(define-font tgoth9.jtex   (kanji-font-point-size  9)  tgoth-common)
 
5203
(define-font tgoth10.jtex  (kanji-font-point-size 10)  tgoth-common)
 
5204
 
 
5205
;; -----------------------------------------------------------------
 
5206
;; EOF
 
5207
@end example
 
5208
 
 
5209
 
 
5210
@c      Node,             Next,               Previous,           Up
 
5211
@node Example vflibcap 2, Example vflibcap 3, Example vflibcap 1, Writing a vflibcap
 
5212
@section Example vflibcap 2
 
5213
 
 
5214
This vflibcap file is an example for @TeX{} DVI drivers.
 
5215
This vflibcap file provides a set of fonts of the form
 
5216
@code{@var{NAME}.@var{DVI}pk} and @code{@var{NAME}.pk}.
 
5217
For example, @code{cmr10.300pk} and @code{cmr10.pk}.
 
5218
 
 
5219
For Japanese Kanji character fonts 
 
5220
@code{min5} ... @code{min10}, @code{goth5} ... @code{goth10}, 
 
5221
@code{tmin5} .. @code{tmin10}, @code{tgoth5} ... @code{tgoth10}, 
 
5222
X Window PCF format font @code{jiskan24.pcf} is used via
 
5223
@code{ascii-jtex-kanji} font driver.
 
5224
 
 
5225
Other fonts are solved in PK and GF format fonts.
 
5226
If a font is not available in these formats, a TFM font
 
5227
is used to produce a "black" box.
 
5228
(TFM files are metrics files and do not conatin glyph. 
 
5229
But TFM driver in VFlib produces a "box" glyph as it ware font files.)
 
5230
 
 
5231
Parameters of device resolution and magnification factor for
 
5232
the function @code{VF_OpenFont1()} determines the font size 
 
5233
and font metrics to be opened.
 
5234
 
 
5235
To use VFlib with this vflibcap file, 
 
5236
I recommend to open font by
 
5237
@code{VF_OpenFont1(@var{name}.pk, @var{dpi}, @var{dpi}, -1, @var{mag}, @var{mag})},
 
5238
where 
 
5239
@code{@var{name}.pk} is a font name (e.g., @code{cmr10.pk}),
 
5240
@var{dpi} is the device resolution in dpi (e.g., @code{300}), 
 
5241
and @var{mag} is the magnification factor (e.g., @code{1.2} for
 
5242
magstep 1 fonts).
 
5243
 
 
5244
@c vflibcaps/vflibcap-tex (sniped)
 
5245
@example
 
5246
;; -----------------------------------------------------------------
 
5247
;;   VFlib Default
 
5248
;; -----------------------------------------------------------------
 
5249
(define-default VFlib
 
5250
  (extension-hints  ("pk" TeX))
 
5251
  (implicit-font-classes)
 
5252
  (uncompression-programs  (".Z" "zcat") (".gz" "gzip -cd"))
 
5253
  (variable-values  (TeX_USE_KPATHSEA      "Yes")
 
5254
                    (TeX_DPI               "300")  ;; or "600"
 
5255
                    (TeX_KPATHSEA_MODE     "cx")   ;; or "ljfour"
 
5256
                    (TeX_KPATHSEA_PROGRAM  "/usr/local/bin/xldvi"))
 
5257
  (use-kpathsea           $TeX_USE_KPATHSEA)
 
5258
  (kpathsea-mode          $TeX_KPATHSEA_MODE)
 
5259
  (kpathsea-program-name  $TeX_KPATHSEA_PROGRAM)
 
5260
  (code-conversion-files  
 
5261
   "iso8859-1_unicode.ccv" "iso8859-2_unicode.ccv" "iso8859-3_unicode.ccv"
 
5262
   "iso8859-4_unicode.ccv" "iso8859-5_unicode.ccv" "iso8859-6_unicode.ccv"
 
5263
   "iso8859-7_unicode.ccv" "iso8859-8_unicode.ccv" "iso8859-9_unicode.ccv"
 
5264
   "jisx0201_unicode.ccv" "jisx0208_unicode.ccv" "jisx0212_unicode.ccv"
 
5265
   "ksc5601_unicode.ccv"
 
5266
   "gb12345_unicode.ccv" "gb2312_unicode.ccv"
 
5267
   "big5_unicode.ccv" "cns11643_unicode.ccv"
 
5268
   "iso8859-5_koi8-r.ccv" "koi8-r_iso8859-5.ccv" "koi8-r_unicode.ccv"))
 
5269
 
 
5270
;; -----------------------------------------------------------------
 
5271
;;   TeX-related Font Class Default and TeX Font Mapper
 
5272
;; -----------------------------------------------------------------
 
5273
(define-default  TeX
 
5274
  (tfm-directories  "TEXMF")
 
5275
  (tfm-filename-extensions  ".tfm")
 
5276
  (font-mapping
 
5277
   ((ascii-jtex-kanji "%f.jtex")  "min*" "goth*" "tmin*" "tgoth*")
 
5278
   ((pk "%f.%dpk") (gf "%f.%dgf")  *)
 
5279
   ((tfm "%f.%dtfm") *))
 
5280
  (resolution-accuracy 0.02)
 
5281
  (resolution-corrections
 
5282
   (240  ;; sparcptr
 
5283
    240  263  288  312  346  415  498  597)
 
5284
   (300  ;; cx
 
5285
    300  329  360  432  518  622  746  896 1075 1290  240 270)
 
5286
   (400  ;; sparcptr
 
5287
    400  438  480  576  691  829  995 1194 1433 1720  320 360)
 
5288
   (600  ;; ljfour
 
5289
    600  657  720  864 1037 1244 1493 1792 2150 2580  480 540))
 
5290
  (dpi $TeX_DPI))
 
5291
 
 
5292
;; -----------------------------------------------------------------
 
5293
;;   GF Font Class Default
 
5294
;; -----------------------------------------------------------------
 
5295
(define-default gf
 
5296
  (font-directories  "TEXMF"))
 
5297
 
 
5298
;; -----------------------------------------------------------------
 
5299
;;   PK Font Class Default
 
5300
;; -----------------------------------------------------------------
 
5301
(define-default pk
 
5302
  (font-directories  "TEXMF"))
 
5303
 
 
5304
;; -----------------------------------------------------------------
 
5305
;;   VF Font Class Default
 
5306
;; -----------------------------------------------------------------
 
5307
(define-default vf
 
5308
  (font-directories  "TEXMF")
 
5309
  (font-mapping
 
5310
   ((type1 "%f.pfb" point-size-from-tfm)  *) )
 
5311
  (open-style "try")     ;; "none", "try", or "require"
 
5312
  (glyph-style "fill"))  ;; "fill", or "empty"
 
5313
 
 
5314
;; -----------------------------------------------------------------
 
5315
;;   TFM Font Class Default
 
5316
;; -----------------------------------------------------------------
 
5317
(define-default tfm
 
5318
  (glyph-style  "fill"))
 
5319
 
 
5320
;; -----------------------------------------------------------------
 
5321
;;   ASCII-JTeX Kanji fonts
 
5322
;; -----------------------------------------------------------------
 
5323
(define-default  ascii-jtex-kanji
 
5324
  (tfm-directories  "TEXMF")
 
5325
  (implicit-font-mapping-suffix ".jtex"))
 
5326
 
 
5327
;; -----------------------------------------------------------------
 
5328
;; Type1 Font Class Default
 
5329
;; -----------------------------------------------------------------
 
5330
(define-default type1
 
5331
  (font-directories  "TEXMF")
 
5332
  (afm-directories   "TEXMF")
 
5333
  (log-level "none")
 
5334
  (dpi $TeX_DPI))
 
5335
 
 
5336
;; -----------------------------------------------------------------
 
5337
;; TrueType Font Class Default
 
5338
;; -----------------------------------------------------------------
 
5339
(define-default truetype
 
5340
  (font-directories  "TEXMF")
 
5341
  (platform-id "microsoft")
 
5342
  (dpi $TeX_DPI))
 
5343
  
 
5344
;; -----------------------------------------------------------------
 
5345
;;   PCF Font Class Default
 
5346
;; -----------------------------------------------------------------
 
5347
(define-default  pcf
 
5348
  (font-directories  "/usr/X11R6/lib/X11/fonts//"
 
5349
                     "/usr/local/X11R6/lib/X11/fonts//"
 
5350
                     "/usr/openwin/lib/X11/fonts//"
 
5351
                     "/usr/X386/lib/X11/fonts//"
 
5352
                     "/usr/XFree86/lib/X11/fonts//"
 
5353
                     "/usr/X11/lib/X11/fonts//"
 
5354
                     "/usr/local/lib/X11/fonts//"
 
5355
                     "/usr/X11R5/lib/X11/fonts//"
 
5356
                     "/usr/local/X11R5/lib/X11/fonts//"
 
5357
                     "/usr/local/share/fonts/X11//")
 
5358
  (compression-extensions ".gz" ".Z")
 
5359
  (dpi $TeX_DPI))
 
5360
 
 
5361
 
 
5362
;; -----------------------------------------------------------------
 
5363
;;  Japanese Kanji fonts using standard X11 PCF fonts
 
5364
(define-font jtex-min    (font-class pcf) (font-file "jiskan24.pcf"))
 
5365
(define-font jtex-goth   (font-class pcf) (font-file "jiskan24.pcf"))
 
5366
(define-font jtex-tmin   (font-class pcf) (font-file "jiskan24.pcf"))
 
5367
(define-font jtex-tgoth  (font-class pcf) (font-file "jiskan24.pcf"))
 
5368
 
 
5369
(define-macro min-common
 
5370
  (font-class ascii-jtex-kanji) (kanji-font jtex-min)
 
5371
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24.adj"))
 
5372
(define-macro goth-common
 
5373
  (font-class ascii-jtex-kanji) (kanji-font jtex-goth)
 
5374
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24.adj"))
 
5375
(define-macro tmin-common
 
5376
  (font-class ascii-jtex-kanji) (kanji-font jtex-tmin)
 
5377
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24v.adj"))
 
5378
(define-macro tgoth-common
 
5379
  (font-class ascii-jtex-kanji) (kanji-font jtex-tgoth)
 
5380
  (kanji-font-magnification 0.85) (metric-adjustment-file "jiskan24v.adj"))
 
5381
 
 
5382
(define-font min5.jtex     (kanji-font-point-size  5)  min-common)
 
5383
(define-font min6.jtex     (kanji-font-point-size  6)  min-common)
 
5384
(define-font min7.jtex     (kanji-font-point-size  7)  min-common)
 
5385
(define-font min8.jtex     (kanji-font-point-size  8)  min-common)
 
5386
(define-font min9.jtex     (kanji-font-point-size  9)  min-common)
 
5387
(define-font min10.jtex    (kanji-font-point-size 10)  min-common)
 
5388
(define-font goth5.jtex    (kanji-font-point-size  5)  goth-common)
 
5389
(define-font goth6.jtex    (kanji-font-point-size  6)  goth-common)
 
5390
(define-font goth7.jtex    (kanji-font-point-size  7)  goth-common)
 
5391
(define-font goth8.jtex    (kanji-font-point-size  8)  goth-common)
 
5392
(define-font goth9.jtex    (kanji-font-point-size  9)  goth-common)
 
5393
(define-font goth10.jtex   (kanji-font-point-size 10)  goth-common)
 
5394
(define-font tmin5.jtex    (kanji-font-point-size  5)  tmin-common)
 
5395
(define-font tmin6.jtex    (kanji-font-point-size  6)  tmin-common)
 
5396
(define-font tmin7.jtex    (kanji-font-point-size  7)  tmin-common)
 
5397
(define-font tmin8.jtex    (kanji-font-point-size  8)  tmin-common)
 
5398
(define-font tmin9.jtex    (kanji-font-point-size  9)  tmin-common)
 
5399
(define-font tmin10.jtex   (kanji-font-point-size 10)  tmin-common)
 
5400
(define-font tgoth5.jtex   (kanji-font-point-size  5)  tgoth-common)
 
5401
(define-font tgoth6.jtex   (kanji-font-point-size  6)  tgoth-common)
 
5402
(define-font tgoth7.jtex   (kanji-font-point-size  7)  tgoth-common)
 
5403
(define-font tgoth8.jtex   (kanji-font-point-size  8)  tgoth-common)
 
5404
(define-font tgoth9.jtex   (kanji-font-point-size  9)  tgoth-common)
 
5405
(define-font tgoth10.jtex  (kanji-font-point-size 10)  tgoth-common)
 
5406
;; -----------------------------------------------------------------
 
5407
;; EOF
 
5408
@end example
 
5409
 
 
5410
 
 
5411
@c      Node,         Next, Previous,  Up
 
5412
@node Example vflibcap 3, , Example vflibcap 2, Writing a vflibcap 
 
5413
@section Example vflibcap 3
 
5414
 
 
5415
This is an example for @TeX{} DVI drivers.
 
5416
This vflibcap desgnates VFlib to use PK files.
 
5417
For missing PK files, black "boxes" by TFM fonts are used 
 
5418
as substitutes of glyphs of PK files
 
5419
 
 
5420
@c vflibcaps/vflibca-tex-pk
 
5421
@example
 
5422
;; -----------------------------------------------------------------
 
5423
;;   VFlib Default
 
5424
;; -----------------------------------------------------------------
 
5425
(define-default VFlib
 
5426
  (extension-hints  ("pk" TeX) ("gf" TeX))
 
5427
  (implicit-font-classes)
 
5428
  (uncompression-programs  (".Z" "zcat") (".gz" "gzip -cd"))
 
5429
  (variable-values  (TeX_USE_KPATHSEA      "Yes")
 
5430
                    (TeX_DPI               "300")  ;; or "600"
 
5431
                    (TeX_KPATHSEA_MODE     "cx")   ;; or "ljfour"
 
5432
                    (TeX_KPATHSEA_PROGRAM  "/usr/local/bin/xldvi"))
 
5433
  (use-kpathsea           $TeX_USE_KPATHSEA)
 
5434
  (kpathsea-mode          $TeX_KPATHSEA_MODE)
 
5435
  (kpathsea-program-name  $TeX_KPATHSEA_PROGRAM))
 
5436
 
 
5437
;; -----------------------------------------------------------------
 
5438
;;   TeX-related Font Class Default and TeX Font Mapper
 
5439
;; -----------------------------------------------------------------
 
5440
(define-default  TeX
 
5441
  (tfm-directories  "TEXMF"
 
5442
                    "/usr/local/lib/jtex/fonts"
 
5443
                    "/usr/local/lib/tex/fonts")
 
5444
  (tfm-filename-extensions  ".tfm")
 
5445
  (font-mapping
 
5446
   ((pk "%f.%dpk") *)
 
5447
   ((tfm "%f.%dtfm") *))
 
5448
  (resolution-accuracy 0.02)
 
5449
  (resolution-corrections
 
5450
   (240  ;; sparcptr
 
5451
    240  263  288  312  346  415  498  597)
 
5452
   (300  ;; cx
 
5453
    300  329  360  432  518  622  746  896 1075 1290  240 270)
 
5454
   (400  ;; sparcptr
 
5455
    400  438  480  576  691  829  995 1194 1433 1720  320 360)
 
5456
   (600  ;; ljfour
 
5457
    600  657  720  864 1037 1244 1493 1792 2150 2580  480 540))
 
5458
  (dpi $TeX_DPI))
 
5459
 
 
5460
;; -----------------------------------------------------------------
 
5461
;;   PK Font Class Default
 
5462
;; -----------------------------------------------------------------
 
5463
(define-default pk
 
5464
  (font-directories "TEXMF"))
 
5465
 
 
5466
;; -----------------------------------------------------------------
 
5467
;;   TFM Font Class Default
 
5468
;; -----------------------------------------------------------------
 
5469
(define-default tfm
 
5470
  (glyph-style  "fill"))
 
5471
 
 
5472
;; -----------------------------------------------------------------
 
5473
;EOF
 
5474
@end example
 
5475
 
 
5476
 
 
5477
 
 
5478
 
 
5479
@c ------------------------------------------------------------------------
 
5480
@c    Node,                 Next,                   Previous,           Up
 
5481
@node Debugging a vflibcap, Code conversion system, Writing a vflibcap, Top
 
5482
@chapter Debugging a vflibcap
 
5483
 
 
5484
There is no utility programs that checks syntax of a vflibcap file.
 
5485
But VFlib checks syntax of vflibcap file when a font driver is
 
5486
initialized or a font is opened.
 
5487
 
 
5488
VFlib prints a message to inform a user 
 
5489
if syntax is illegal, undefined capability is used 
 
5490
(this may be a typographical error),
 
5491
essential capability is missing,
 
5492
an undefined macro is used, or 
 
5493
forms of capability values are illegal.
 
5494
 
 
5495
The following Unix environment variables are used
 
5496
to print debugging messages.
 
5497
 
 
5498
@table @asis
 
5499
@item @code{VFLIB_DEBUG_FONT_OPEN}
 
5500
  --- If this environment variable is defined, 
 
5501
  the processes of font opens are printed.
 
5502
 
 
5503
@item @code{VFLIB_DEBUG_FONT_SEARCH}  
 
5504
  --- If this variable is defined,
 
5505
  the processes of font opens are printed
 
5506
 
 
5507
@item @code{VFLIB_DEBUG_VFLIBCAP}
 
5508
  --- If this variable is defined,
 
5509
  the process of reading of vflibcap file is printed.
 
5510
 
 
5511
@item @code{VFLIB_DEBUG_PARAMETERS}
 
5512
  --- If this variable is defined,
 
5513
  VFlib prints 
 
5514
  how parameters (variables) in vflibcap file are substituted.
 
5515
 
 
5516
@item @code{VFLIB_DEBUG_CCV}
 
5517
  --- If this variable is defined,
 
5518
  the process of reading CCV files is printed.
 
5519
 
 
5520
@item @code{VFLIB_DEBUG_CCV_MAPPING}
 
5521
  --- If this variable is defined,
 
5522
  encoding conversions by CCV are printed.
 
5523
 
 
5524
@end table
 
5525
 
 
5526
 
 
5527
 
 
5528
 
 
5529
 
 
5530
@c ------------------------------------------------------------------------
 
5531
@c    Node,                   Next,            Previous,              Up
 
5532
@node Code conversion system, Utility programs, Debugging a vflibcap, Top
 
5533
@chapter Code conversion system
 
5534
 
 
5535
@cindex CCV
 
5536
@cindex code conversion system
 
5537
@cindex code-conversion-files
 
5538
 
 
5539
Code conversion system (CCV) is used to convert 
 
5540
from a character set and an encoding to another.
 
5541
For example, a font of Unicode character set and Unicode encoding
 
5542
can be accessed as ISO 8859-2 character set of ISO encoding
 
5543
by encoding conversion.
 
5544
TrueType font class makes use of this feature to hide 
 
5545
invisible internal font encoding scheme and 
 
5546
provides desired external view to users.
 
5547
 
 
5548
Conversion rule is given by one of the following two methods
 
5549
@itemize @bullet
 
5550
@item Internal functions in VFlib (written in C)
 
5551
  These functions are hardcoded and new conversions rules cannot be 
 
5552
  added without modifying source code.
 
5553
@item External files, called CCV files.
 
5554
  A list of CCV files to be used is specified in 
 
5555
  @code{code-conversion-files} 
 
5556
  capability of @code{VFlib} default.
 
5557
@end itemize
 
5558
 
 
5559
 
 
5560
@section How CCV works
 
5561
 
 
5562
Each conversion rule has the following information.
 
5563
 
 
5564
@itemize @bullet
 
5565
@item EXTERNAL charset name
 
5566
@item EXTERNAL encoding name
 
5567
@item INTERNAL charset name
 
5568
@item INTERNAL encoding name
 
5569
@item other info such as format and size of conversion table... 
 
5570
@end itemize
 
5571
 
 
5572
On invocation of VFlib, 
 
5573
these information is read from each CCV files.
 
5574
(CCV files are not fully loaded at initialization of VFlib;
 
5575
VFlib just checks relation of conversion.
 
5576
Conversion tables, which can be large, are loaded on demand.)
 
5577
In addition, when VFlib is initialized, 
 
5578
internal CCV functions are installed and 
 
5579
these information is given for each conversion function.
 
5580
 
 
5581
"EXTERNAL" means external view (i.e., user side encoding) and 
 
5582
"INTERNAL" means  internal view (i.e., font encoding).
 
5583
Users can define arbitrary charset and encoding names, except
 
5584
that some font driver may predefined names for internal use.
 
5585
(TrueType font driver uses some predefined names, such as "unicode".)
 
5586
 
 
5587
CCV system has a conversion table searching mechanism.  
 
5588
Table is searched by source charset/encoding names and destination 
 
5589
charset/encoding names.  If there is a CCV file listed in 
 
5590
@code{code_conversion_files} capability of @code{VFlib} defaults
 
5591
entry in vflibcap that matches charset and encoding name, 
 
5592
the CCV file is dynamically loaded and used for code conversion.
 
5593
 
 
5594
For example, a CCV file @t{iso8859-1_unicode.ccv} has the following
 
5595
charset/encoding names:
 
5596
 
 
5597
@itemize  @bullet
 
5598
@item EXTERNAL charset name:      @t{ISO8859-1}
 
5599
@item EXTERNAL charset encoding:  @t{ISO}
 
5600
@item INTERNAL charset name:      @t{UNICODE}
 
5601
@item INTERNAL charset encoding:  @t{UNICODE}
 
5602
@end itemize
 
5603
 
 
5604
By this CCV file, a unicode font can be viewed as a ISO
 
5605
encoding of ISO 8859-1 charset. (It is very important to note
 
5606
that names are just symbols and not have any meaning; 
 
5607
in the above example, conversion to ISO encoding is implemented
 
5608
by conversion table body in CCV file.)
 
5609
 
 
5610
In the current implementation, 
 
5611
BDF, PCF, HBF, and TrueType font drivers use CCV system. 
 
5612
In the following, how TrueType font driver uses CCV is described.
 
5613
 
 
5614
  Each TrueType font has information about charset name and encoding 
 
5615
name of the font.  When a font entry is defined in vflibcap file
 
5616
and @code{encoding} and @code{character-set} capability is defined,
 
5617
say, @var{E} and @var{C} respectively. According to internal charset
 
5618
and encoding information of TrueType font, the driver searches
 
5619
a CCV table, when the VFlib font is opened, that matches  
 
5620
the following conversion relation. 
 
5621
 
 
5622
@itemize @bullet
 
5623
@item EXTERNAL charset name:      @var{E}
 
5624
@item EXTERNAL charset encoding:  @var{C}
 
5625
@item INTERNAL charset name:      possibly, @t{UNICODE} (from font file info)
 
5626
@item INTERNAL charset encoding:  possibly, @t{UNICODE} (from font file info)
 
5627
@end itemize
 
5628
 
 
5629
If not found, conversion is impossible. If found, a CCV file found
 
5630
is used.  After a font is opened, CCV table is used 
 
5631
for converting code points for VFlib operation such as 
 
5632
@code{VF_GetBitmap1()}.
 
5633
 
 
5634
 
 
5635
@section The internal (hardcoded) CCV functions
 
5636
VFlib has several hardcoded CCV functions.
 
5637
Followings CCV functions are implemented.
 
5638
 
 
5639
@itemize @bullet
 
5640
 
 
5641
@item from ISO-2022 (@code{ISO2022}) to Shift JIS (@code{SJIS})
 
5642
 
 
5643
@item from Shift JIS (@code{SJIS}) to ISO 2022 (@code{ISO2022})
 
5644
 
 
5645
@item from EUC (@code{EUC}) to ISO 2022 (@code{ISO2022})
 
5646
 
 
5647
@item from Row-Cell (@code{Row-Cell}) to ISO 2022 (@code{ISO2022})
 
5648
 
 
5649
@item from ISO-2022 (@code{ISO2022}) to Row-Cell (@code{Row-Cell})
 
5650
 
 
5651
@item from ISO-2022 (@code{ISO2022}) to WanSung (@code{WanSung})
 
5652
 
 
5653
@item from Row-Cell (@code{Row-Cell}) to WanSung (@code{WanSung})
 
5654
 
 
5655
@item from ISO-2022 (@code{ISO2022}) to Sequential Numbering
 
5656
(@code{Sequential2-0} and @code{Sequential2-1})
 
5657
 
 
5658
By these encoding schemes, characters are numbered sequentially
 
5659
starting from 0 (@code{Sequential2-0}) or 1 (@code{Sequential2-1}).
 
5660
That is, @code{Sequential2-0} encoding is an encoding such that 
 
5661
code of the first character is 0, 
 
5662
code of the second is 1, ..., and 
 
5663
code of the i-th character is (i-1). 
 
5664
@code{Sequential2-1} encoding is an encoding such that 
 
5665
code of the first character is 1, 
 
5666
code of the second is 2, ..., and 
 
5667
code of the i-th is (i).
 
5668
External code point must be encoded two-byte, i.e., 0x2121...7e7e.
 
5669
These values are converted to 0...8835 or 1...8836.
 
5670
 
 
5671
@end itemize 
 
5672
 
 
5673
Encoding name @code{JIS} is defined as an alias of @code{ISO2022}.
 
5674
Encoding name @code{Ku-Ten} is defined as an alias of @code{Row-Cell}.
 
5675
Note that these aliases are defined only for hardcorded CCV functions.
 
5676
 
 
5677
All of these are implemented simple arithmetic and 
 
5678
large conversion tables are not necessary in memory.
 
5679
 
 
5680
 
 
5681
@section The syntax of CCV files
 
5682
 
 
5683
The syntax of CCV files is lisp-like notation, similar to vflibcap files.
 
5684
The CCV file defines its own directive set, explained below.
 
5685
A code conversion table is divided in several sub-tables to reduce
 
5686
the file size (and memory size when the file is loaded into memory).
 
5687
The sub-tables are called `blocks'.  
 
5688
 
 
5689
@table @code
 
5690
@item (charset-external-name @var{from-cs-name})
 
5691
@itemx (charset-external-encoding @var{from-cs-enc})
 
5692
@itemx (charset-internal-name @var{to-cs-name})
 
5693
@itemx (charset-internal-encoding @var{to-cs-enc})
 
5694
--- These four directives describes character set and encoding information 
 
5695
of conversion.
 
5696
 
 
5697
@item (table-type @var{type})
 
5698
@var{type} must be one of the following:
 
5699
@itemize @asis
 
5700
@item @code{array}
 
5701
@item @code{random-arrays}
 
5702
@end itemize
 
5703
 
 
5704
@item  (c1-min @var{c1min})
 
5705
@itemx (c1-max @var{c1max})
 
5706
@itemx (c2-min @var{c2min})
 
5707
@itemx (c2-max @var{c2max})
 
5708
@itemx (block-size @var{size})
 
5709
@itemx (nblocks @var{nblocks})
 
5710
@itemx (block @var{block} @var{code0} @var{code1} ...)
 
5711
@end table
 
5712
 
 
5713
Let @var{c} be a code point of a character to be converted 
 
5714
by this CCV file.
 
5715
 
 
5716
It is converted as follows.
 
5717
Let @var{c1} be @var{c}/@var{size} and @var{c2} be @var{c} modulo @var{size}.
 
5718
The block number @var{b} that should be referred to is @var{c1}-@var{c1min}.
 
5719
The position @var{i} in the block @var{b} is @var{c2}-@var{c2min}.
 
5720
Thus, the value of @var{i}-th entry of a block numbered @var{b} is 
 
5721
converted code point.
 
5722
 
 
5723
@var{c1max}, @var{c2max} and @var{nblocks} are used 
 
5724
internally to determine the necessary memory area to load the table.
 
5725
 
 
5726
Theoretically, @code{array} is enough for the value for 
 
5727
@code{table-type} directive.
 
5728
But in case that there are many blocks that do not have conversion entries.
 
5729
This is happen in the case of CNS11643 character set
 
5730
(a Hanji character set in Taiwan).
 
5731
To reduce the table size, some of blocks can be omitted by giving
 
5732
@code{random-array} for @code{table-type} directive.
 
5733
 
 
5734
In case of @code{array}, lookup for code conversion is 
 
5735
implemented by indexing an entire array, which is very fast. 
 
5736
In case of @code{random-array}, lookup for code conversion 
 
5737
takes time to find a corresponding sub-table (block), since
 
5738
the table is not linear.
 
5739
 
 
5740
 
 
5741
 
 
5742
@section Example of a CCV file 1
 
5743
 
 
5744
The following example is a CCV file that virtually provides 
 
5745
a ISO 8859-1 character set font using a Unicode font.
 
5746
That is, a Unicode font can be used as if it were a ISO 8859-1 font
 
5747
by the CCV file.
 
5748
This file is distributed with VFlib and installed
 
5749
by the name @code{iso8859-1_unicode.ccv}.
 
5750
 
 
5751
This file is a table indexed by code points of ISO 8859-1; 
 
5752
contents of table entries are Unicode code points. 
 
5753
 
 
5754
 
 
5755
@c iso8859-1_unicode.ccv
 
5756
@example
 
5757
; Conversion table: ISO8859-1 ==> UNICODE
 
5758
(charset-external-name ISO8859-1)
 
5759
(charset-external-encoding ISO)
 
5760
(charset-internal-name UNICODE)
 
5761
(charset-internal-encoding UNICODE)
 
5762
(table-type array)
 
5763
; Code point C is converted to C' by the following formula:
 
5764
;   C' = Table[(c1 - c1min)*M + (c2 - c2min)],
 
5765
;   where c1 = C/B and c2 = C%B, and M = c2max - c2min + 1.
 
5766
;   B is a block size given by the 'block-size:' parameter.
 
5767
(c1-min 0x0)
 
5768
(c1-max 0x0)
 
5769
(c2-min 0x20)
 
5770
(c2-max 0xff)
 
5771
(block-size 256)
 
5772
(nblocks 1)
 
5773
; 0x0020 ... 0x00ff
 
5774
(block 0
 
5775
    0x0020 0x0021 0x0022 0x0023 0x0024 0x0025 0x0026 0x0027 
 
5776
    0x0028 0x0029 0x002a 0x002b 0x002c 0x002d 0x002e 0x002f 
 
5777
    0x0030 0x0031 0x0032 0x0033 0x0034 0x0035 0x0036 0x0037 
 
5778
    0x0038 0x0039 0x003a 0x003b 0x003c 0x003d 0x003e 0x003f 
 
5779
    0x0040 0x0041 0x0042 0x0043 0x0044 0x0045 0x0046 0x0047 
 
5780
    0x0048 0x0049 0x004a 0x004b 0x004c 0x004d 0x004e 0x004f 
 
5781
    0x0050 0x0051 0x0052 0x0053 0x0054 0x0055 0x0056 0x0057 
 
5782
    0x0058 0x0059 0x005a 0x005b 0x005c 0x005d 0x005e 0x005f 
 
5783
    0x0060 0x0061 0x0062 0x0063 0x0064 0x0065 0x0066 0x0067 
 
5784
    0x0068 0x0069 0x006a 0x006b 0x006c 0x006d 0x006e 0x006f 
 
5785
    0x0070 0x0071 0x0072 0x0073 0x0074 0x0075 0x0076 0x0077 
 
5786
    0x0078 0x0079 0x007a 0x007b 0x007c 0x007d 0x007e -1     
 
5787
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5788
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5789
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5790
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5791
    0x00a0 0x00a1 0x00a2 0x00a3 0x00a4 0x00a5 0x00a6 0x00a7 
 
5792
    0x00a8 0x00a9 0x00aa 0x00ab 0x00ac 0x00ad 0x00ae 0x00af 
 
5793
    0x00b0 0x00b1 0x00b2 0x00b3 0x00b4 0x00b5 0x00b6 0x00b7 
 
5794
    0x00b8 0x00b9 0x00ba 0x00bb 0x00bc 0x00bd 0x00be 0x00bf 
 
5795
    0x00c0 0x00c1 0x00c2 0x00c3 0x00c4 0x00c5 0x00c6 0x00c7 
 
5796
    0x00c8 0x00c9 0x00ca 0x00cb 0x00cc 0x00cd 0x00ce 0x00cf 
 
5797
    0x00d0 0x00d1 0x00d2 0x00d3 0x00d4 0x00d5 0x00d6 0x00d7 
 
5798
    0x00d8 0x00d9 0x00da 0x00db 0x00dc 0x00dd 0x00de 0x00df 
 
5799
    0x00e0 0x00e1 0x00e2 0x00e3 0x00e4 0x00e5 0x00e6 0x00e7 
 
5800
    0x00e8 0x00e9 0x00ea 0x00eb 0x00ec 0x00ed 0x00ee 0x00ef 
 
5801
    0x00f0 0x00f1 0x00f2 0x00f3 0x00f4 0x00f5 0x00f6 0x00f7 
 
5802
    0x00f8 0x00f9 0x00fa 0x00fb 0x00fc 0x00fd 0x00fe 0x00ff )
 
5803
@end example
 
5804
 
 
5805
 
 
5806
@section Example of a CCV file 2
 
5807
 
 
5808
The following example is a CCV file that virtually provides 
 
5809
a CNS 11643 Plane 1 character set font using a Unicode font.
 
5810
This file is distributed with VFlib and installed
 
5811
by the name @code{cns11643-1_unicode.ccv}.
 
5812
 
 
5813
This file is an example of CCV files
 
5814
that have @code{random-arrays} for @code{table-type} directive.
 
5815
 
 
5816
@example
 
5817
; Conversion table: CNS11643-1 ==> UNICODE
 
5818
(charset-external-name CNS11643-1)
 
5819
(charset-external-encoding ISO2022)
 
5820
(charset-internal-name UNICODE)
 
5821
(charset-internal-encoding UNICODE)
 
5822
(table-type random-arrays)
 
5823
; Code point C is converted to C' by the following formula:
 
5824
;   C' = Table[(c1 - c1min)*M + (c2 - c2min)],
 
5825
;   where c1 = C/B and c2 = C%B, and M = c2max - c2min + 1.
 
5826
;   B is a block size given by the 'block-size:' parameter.
 
5827
(c1-min 0x121)
 
5828
(c1-max 0xe67)
 
5829
(c2-min 0x21)
 
5830
(c2-max 0x7e)
 
5831
(block-size 256)
 
5832
(nblocks 218)
 
5833
; 0x12121 ... 0x1217e
 
5834
(block 0
 
5835
    0x3000 0xff0c 0x3001 0x3002 0xff0e 0x30fb 0xff1b 0xff1a 
 
5836
    0xff1f 0xff01 0xfe30 0x2026 0x2025 0xfe50 0xfe51 0xfe52 
 
5837
    0x00b7 0xfe54 0xfe55 0xfe56 0xfe57 0xfe31 0x2014 0xfe32 
 
5838
    0x2013 -1     -1     -1     -1     0xff08 0xff09 0xfe35 
 
5839
    0xfe36 0xff5b 0xff5d 0xfe37 0xfe38 0x3014 0x3015 0xfe39 
 
5840
    0xfe3a 0x3010 0x3011 0xfe3b 0xfe3c 0x300a 0x300b 0xfe3d 
 
5841
    0xfe3e 0x3008 0x3009 0xfe3f 0xfe40 0x300c 0x300d 0xfe41 
 
5842
    0xfe42 0x300e 0x300f 0xfe43 0xfe44 0xfe59 0xfe5a 0xfe5b 
 
5843
    0xfe5c 0xfe5d 0xfe5e 0x2018 0x2019 0x201c 0x201d 0x301d 
 
5844
    0x301e 0x2032 0x2035 0xff03 0xff06 0xff0a 0x203b 0x00a7 
 
5845
    0x3003 0x25cb 0x25cf 0x25b3 0x25b2 0x25ce 0x2606 0x2605 
 
5846
    0x25c7 0x25c6 0x25a1 0x25a0 0x25bd 0x25bc )
 
5847
; 0x12221 ... 0x1227e
 
5848
(block 1
 
5849
    0x32a3 0x2105 0x203e -1     0xff3f -1     0xfe49 0xfe4a 
 
5850
    0xfe4d 0xfe4e 0xfe4b 0xfe4c 0xfe5f 0xfe60 0xfe61 0xff0b 
 
5851
    0xff0d 0x00d7 0x00f7 0x00b1 0x221a 0xff1c 0xff1e 0xff1d 
 
5852
    0x2266 0x2267 0x2260 0x221e 0x2252 0x2261 0xfe62 0xfe63 
 
5853
    0xfe64 0xfe66 0xfe65 0x223c 0x2229 0x222a 0x22a5 0x2220 
 
5854
    0x221f 0x22bf 0x33d2 0x33d1 0x222b 0x222e 0x2235 0x2234 
 
5855
    0x2640 0x2642 0x2641 0x2609 0x2191 0x2193 0x2192 0x2190 
 
5856
    0x2196 0x2197 0x2199 0x2198 0x2016 0xff5c 0xff0f 0xff3c 
 
5857
    0x2215 0xfe68 0xff04 0xffe5 0x3012 0xffe0 0xffe1 0xff05 
 
5858
    0xff20 0x2103 0x2109 0xfe69 0xfe6a 0xfe6b 0x33d5 0x339c 
 
5859
    0x339d 0x339e 0x33ce 0x33a1 0x338e 0x338f 0x33c4 0x00b0 
 
5860
    0x5159 0x515b 0x515e 0x515d 0x5161 0x5163 )
 
5861
; 0x12321 ... 0x1237e
 
5862
(block 2
 
5863
    0x55e7 0x74e9 0x7cce 0x2581 0x2582 0x2583 0x2584 0x2585 
 
5864
    0x2586 0x2587 0x2588 0x258f 0x258e 0x258d 0x258c 0x258b 
 
5865
    0x258a 0x2589 0x253c 0x2534 0x252c 0x2524 0x251c 0x2594 
 
5866
    0x2500 0x2502 0x2595 0x250c 0x2510 0x2514 0x2518 0x256d 
 
5867
    0x256e 0x2570 0x256f 0x2550 0x255e 0x256a 0x2561 0x25e2 
 
5868
    0x25e3 0x25e5 0x25e4 0x2571 0x2572 0x2573 -1     -1     
 
5869
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5870
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5871
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5872
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5873
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5874
    -1     -1     -1     -1     -1     -1     )
 
5875
 
 
5876
@var{... it's very long, snip, snip, snip ...}
 
5877
 
 
5878
; 0xe6621 ... 0xe667e
 
5879
(block 3397
 
5880
    0x7bd0 0x7c2f 0x7c32 0x7c42 0x7c4e 0x7c68 0x7ca9 0x7ced 
 
5881
    0x7dd0 0x7e07 0x7dd3 0x7e64 0x7f40 -1     0x8041 0x8063 
 
5882
    0x80bb 0x6711 0x6725 0x8248 0x8310 0x8362 0x8312 0x8421 
 
5883
    0x841e 0x84e2 0x84de 0x84e1 0x8573 0x85d4 0x85f5 0x8637 
 
5884
    0x8645 0x8672 0x874a 0x87a9 0x87a5 0x87f5 0x8834 0x8850 
 
5885
    0x8887 0x8954 0x8984 0x8b03 0x8c52 0x8cd8 0x8d0c 0x8d18 
 
5886
    0x8db0 0x8ebc 0x8ed5 0x8faa 0x909c -1     0x915c 0x922b 
 
5887
    0x9221 0x9273 0x92f4 0x92f5 0x933f 0x9342 0x9386 0x93be 
 
5888
    0x93bc 0x93bd 0x93f1 0x93f2 0x93ef 0x9422 0x9423 0x9424 
 
5889
    0x9467 0x9466 0x9597 0x95ce 0x95e7 0x973b 0x974d 0x98e4 
 
5890
    0x9942 0x9b1d 0x9b98 -1     0x9d49 0x6449 0x5e71 0x5e85 
 
5891
    0x61d3 0x990e 0x8002 0x781e -1     -1     )
 
5892
; 0xe6721 ... 0xe677e
 
5893
(block 3398
 
5894
    0x5528 0x5572 0x55ba 0x55f0 0x55ee 0x56b8 0x56b9 0x56c4 
 
5895
    0x8053 0x92b0 -1     -1     -1     -1     -1     -1     
 
5896
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5897
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5898
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5899
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5900
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5901
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5902
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5903
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5904
    -1     -1     -1     -1     -1     -1     -1     -1     
 
5905
    -1     -1     -1     -1     -1     -1     )
 
5906
@end example
 
5907
 
 
5908
 
 
5909
 
 
5910
 
 
5911
@c ------------------------------------------------------------------------
 
5912
@c      Node,            Next,                                       Previous,         Up
 
5913
@node   Utility programs, Sample programs, Code conversion system, Top
 
5914
 
 
5915
@chapter Utility programs
 
5916
 
 
5917
@menu
 
5918
* vflmkcaptex::
 
5919
* vflpp::
 
5920
* vflmkfdb::
 
5921
* vfldrvs::
 
5922
@end menu
 
5923
 
 
5924
 
 
5925
@node vflmkcaptex, vflpp, , Utility programs
 
5926
@section vflmkcaptex
 
5927
 
 
5928
@pindex vflmkcaptex
 
5929
 
 
5930
@command{vflmkcaptex} is a utility program 
 
5931
to generate vflibcap file for @TeX{} DVI driver software
 
5932
automatically. 
 
5933
With simple command line arugments,
 
5934
a vflibcap that uses PK, GF, Virtual Font, Type 1
 
5935
fonts with complex @TeX{} font mapping rules.
 
5936
 
 
5937
@noindent
 
5938
@b{Usage:} @t{vflmkcaptex} [ @var{OPTIONS...} ] [ @var{CLASS...} ] 
 
5939
 
 
5940
@noindent
 
5941
@b{Usage:} @t{vflmkcaptex} [ @var{SHORTCUT} ] [ @var{OPTIONS...} ] 
 
5942
 
 
5943
@option{@var{CLASS...}} is a list of font class names 
 
5944
to support by vflibcap file to be generated.
 
5945
@option{@var{OPTIONS...}} is option list to customize default settings.
 
5946
@option{@var{SHORTCUT}} is a shortcut name to typical options 
 
5947
and class name list.
 
5948
 
 
5949
@noindent
 
5950
@b{Shortcut:}
 
5951
 
 
5952
@table @asis
 
5953
 
 
5954
@item @t{minimum}
 
5955
This is the same as command line option @t{pk}.
 
5956
Use PK fonts only. 
 
5957
 
 
5958
@item @t{simple}
 
5959
This is the same as command line option @t{-g pk tfm}.
 
5960
Use PK fonts. 
 
5961
If PK font file is missing, it is generated on-the-fly.
 
5962
If font cannot be created, black square is displayed
 
5963
instead of character glyph (as long as corresponding TFM file exists).
 
5964
 
 
5965
@item @t{standard}
 
5966
This is the same as command line option @t{-t1 -g}.
 
5967
Use default class list @t{type1 vf pk tfm}.
 
5968
Missing PK font is created on-the-fly.
 
5969
 
 
5970
@item @t{simple-ja}
 
5971
This is the same as command line option @t{-g pk tfm -jtex -jisx0212 -jpcf}.
 
5972
(Japanese support for @t{simple} shortcut.)
 
5973
 
 
5974
@item @t{standard-ja}
 
5975
This is the same as command line option @t{-t1 -g -jtex -jisx0212 -jpcf}.
 
5976
(Japanese support for @t{standard} shortcut.)
 
5977
 
 
5978
@end table
 
5979
 
 
5980
 
 
5981
@noindent
 
5982
@b{Font class list:}
 
5983
 
 
5984
@table @asis
 
5985
 
 
5986
@item @t{gf}
 
5987
Enables to use GF font files.
 
5988
For searching font files, kpathsea is used.
 
5989
That is, font files are searched under @TeX{} @file{texmf} directory
 
5990
 (typically, @file{/usr/local/share/texmf}).
 
5991
 
 
5992
@item @t{pk}
 
5993
Enables to use PK font files.
 
5994
For searching font files, kpathsea is used.
 
5995
 
 
5996
@item @t{vf}
 
5997
Enables to use Virtual Font files.
 
5998
For searching font files, kpathsea is used.
 
5999
 
 
6000
@item @t{tfm}
 
6001
Enables to use TFM files.
 
6002
This option enables to display black square instead of glyph.
 
6003
The size of square obeys font metric of each character.
 
6004
This is useful when glyph file (e.g., PK, Type1) is missing.
 
6005
 
 
6006
@item @t{type1}
 
6007
Enables to use Type 1 fonts.
 
6008
(Currently, it supports Roman fonts. CJK fonts are not supported.)
 
6009
For searching font files, kpathsea is used.
 
6010
 
 
6011
By this option, font definitions for PostScript fonts used in @TeX{} 
 
6012
DVI files are generated by reading @file{psfonts.map} of @command{dvips}.
 
6013
Each PostScript font listed in @file{psfonts.map} is checked 
 
6014
if it exists. 
 
6015
(For PostScript fonts, this program automatically searchs 
 
6016
Adobe Acrobat 3 and 4 font directories.)
 
6017
If a PostScript font in question is not found, 
 
6018
@command{Ghostscript} font definition file @file{Fontmap} 
 
6019
is checked to substitute the font by a font in
 
6020
@command{Ghostscript} font directory.
 
6021
 
 
6022
This feature is very useful for displaying and printing @TeX{} 
 
6023
DVI files with PostScript fonts. 
 
6024
So, I recommned obtain Adobe Acrobat 3 and 4 for Type 1 PostScript fonts.
 
6025
(Linux version are freely available.)
 
6026
 
 
6027
@end table
 
6028
 
 
6029
When a font is requested to open,
 
6030
the font is tried to open by font classes by the order 
 
6031
in the command line.
 
6032
 
 
6033
So, by a @file{vflibcap} generated by the following example,
 
6034
font in PK format is rearched first. 
 
6035
If a font in PK format is not found, 
 
6036
font in Type 1 format is searched next.
 
6037
@example
 
6038
vflmkcaptex pk type1
 
6039
@end example
 
6040
 
 
6041
Therefore, the order of font classes decides the priority of 
 
6042
font file formats to search.
 
6043
 
 
6044
 
 
6045
@noindent
 
6046
@b{Options:}
 
6047
 
 
6048
@table  @asis
 
6049
 
 
6050
@item @t{--help}
 
6051
Print a list of command line options and exit.
 
6052
 
 
6053
@item @t{--version} 
 
6054
Print version number of this program and exit.
 
6055
 
 
6056
@item @t{-p @var{PROG}} 
 
6057
Application program name. This is used by kpathsea 
 
6058
for font file search. Default is @t{xgdvi}, which is
 
6059
a DVI previewer in the @TeX{}-Guy package.
 
6060
 
 
6061
@item @t{-n @var{MODE}} 
 
6062
Device mode name for font file search, used by kpathsea.
 
6063
Default is @t{cx}
 
6064
  
 
6065
@item @t{-r @var{DPI}} 
 
6066
Device resolution in DPI. Default is 300.
 
6067
 
 
6068
If this option is not given, @command{vflmkcaptex} reads @file{mode.mf},
 
6069
which is a device mode definition file for METAFONT,
 
6070
and obtains revice resolution automatically.
 
6071
 
 
6072
@item @t{-g} 
 
6073
Configure @file{vflibcap} to generate non-existing PK files
 
6074
on-the-fly.
 
6075
 
 
6076
@item @t{-pk} 
 
6077
When @option{@var{CLASS...}} is not given, 
 
6078
default font class set is assumed by default.
 
6079
For such case, generate a @file{vflibcap} to search PK font file
 
6080
before searching Type 1 font by this option. 
 
6081
 
 
6082
@item @t{-t1} 
 
6083
When @option{@var{CLASS...}} is not given, 
 
6084
generate a @file{vflibcap} to search Type 1 font file
 
6085
before searching PK font file by this option. 
 
6086
 
 
6087
@end table
 
6088
 
 
6089
@noindent
 
6090
@b{Options for Japanese @TeX{} support:}
 
6091
 
 
6092
@table  @asis
 
6093
@item @t{-jtex} 
 
6094
Generate font definitions for JIS X0208 character set
 
6095
used by Japanese @TeX{}.
 
6096
By default, a @file{vflibcap} to be generated uses
 
6097
Japanese Kanji character in PCF format (in X11 font directory).
 
6098
See also @option{-jpcf}, @option{-jekanji} and @option{-jttf} options.
 
6099
 
 
6100
@item @t{-jisx0212} 
 
6101
Generate font definitions for JIS X0208 character set
 
6102
used by Japanese @TeX{}. 
 
6103
Note that generated font names are not standard.
 
6104
It is used for private use of the author.
 
6105
 
 
6106
@item @t{-jpcf} 
 
6107
Switch to use PCF fonts for Japanese Kanji characters.
 
6108
(This is the default.)
 
6109
 
 
6110
@item @t{-jekanji} 
 
6111
Switch to use eKanji fonts for Japanese Kanji characters.
 
6112
See @ref{eKanji font class} for detail about eKanji fonts.
 
6113
 
 
6114
@item @t{-jttf} 
 
6115
Switch to use TrueType fonts for Japanese Kanji characters.
 
6116
 
 
6117
@item @t{-jpfd @var{DIR}} 
 
6118
Add a PCF font directory.
 
6119
@command{vflmkcaptex} checks typical X11 PCF font directories 
 
6120
and existing directories are added to PCF font directory list.
 
6121
This option should be used when
 
6122
you want to add optional (and not automatically detected) 
 
6123
PCF font directory.
 
6124
This option can be used multiple times.
 
6125
 
 
6126
@item @t{-jefd @var{DIR}} 
 
6127
Add a eKanji font directory.
 
6128
This option can be used multiple times.
 
6129
 
 
6130
@item @t{-jtfd @var{DIR}} 
 
6131
Add a TrueType font directory.
 
6132
This option can be used multiple times.
 
6133
 
 
6134
 
 
6135
@item @t{-jtdb @var{FILE}}
 
6136
By this option, an external definition database file @var{FILE}
 
6137
is read for generating definitions of non-standard @TeX{} Japanese fonts
 
6138
using Japanese TrueType font files.
 
6139
Each line in @var{FILE} is a pair of 
 
6140
(1) font name used in @TeX{} and
 
6141
(2) TrueType font file name.
 
6142
Following is an example: 
 
6143
 
 
6144
@example
 
6145
dfailpaa dcail5.ttc
 
6146
dfainpaa dcai5.ttc
 
6147
dfaispaa dcais5.ttc
 
6148
dfbrrsaa dfbrr7.ttc
 
6149
dfbrrzaa dfbrrc.ttc
 
6150
dfbrspaa dfbrs5.ttc
 
6151
dfbrsvaa dfbrs9.ttc
 
6152
dfbrszaa dfbrsc.ttc
 
6153
@end example
 
6154
 
 
6155
See files in a directory @file{ascii-jtex/} for detail.
 
6156
 
 
6157
@end table
 
6158
 
 
6159
 
 
6160
@command{vflmkcaptex} is a Unix Shell script. 
 
6161
It uses following programs to generate a @file{vflibcap} file.
 
6162
Descriptions the followng programs are ommited since 
 
6163
most of users never use them directly.
 
6164
For details,
 
6165
invoke each program with @option{--help} option to see how to use it.
 
6166
 
 
6167
@table @asis 
 
6168
@item @command{vflmkvfl} 
 
6169
  A generator for VFlib defaults.
 
6170
  (See @ref{VFlib defaults}.)
 
6171
@item @command{vflmktex} 
 
6172
  A generator for TeX mapping class.
 
6173
  (See @ref{TeX default and TeX font mapping font class}.)
 
6174
@item @command{vflmkpk} 
 
6175
  A generator for PK class.
 
6176
  (See @ref{PK font class}.)
 
6177
@item @command{vflmkgf} 
 
6178
  A generator for GF class.
 
6179
  (See @ref{GF font class}.)
 
6180
@item @command{vflmkvf} 
 
6181
  A generator for Virtual Font class.
 
6182
  (See @ref{VF font class}.)
 
6183
@item @command{vflmktfm} 
 
6184
  A generator for TFM class.
 
6185
  (See @ref{TFM font class}.)
 
6186
@item @command{vflmkt1} 
 
6187
  A generator for Type 1 class.
 
6188
  (See @ref{Type1 font class}.)
 
6189
@item @command{vflmkekan} 
 
6190
  A generator for eKanji class.
 
6191
  (See @ref{eKanji font class}.)
 
6192
@item @command{vflmkajt} 
 
6193
  A generator for ASCII Japanese @TeX{} class.
 
6194
  (See @ref{ASCII Japanese TeX Kanji font class}.)
 
6195
@end table
 
6196
 
 
6197
 
 
6198
 
 
6199
 
 
6200
@node vflpp, vflmkfdb, vflmkcaptex, Utility programs
 
6201
@section vflpp
 
6202
@pindex vflpp
 
6203
 
 
6204
@command{vflpp} prettyprints (i.e., grinds) a vflibcap file.
 
6205
It eliminate all comment strings and unnecessary space and newline characters.
 
6206
 
 
6207
@noindent 
 
6208
@b{Usage:} @t{vflpp} [ @var{vflibcap-file} ]
 
6209
 
 
6210
A program
 
6211
@command{vflpp} prettyprints a file @var{vflibcap} to standard output.
 
6212
If no argument is given, @command{vflpp} reads from standard input.
 
6213
 
 
6214
 
 
6215
 
 
6216
@node vflmkfdb, vfldrvs, vflpp, Utility programs
 
6217
@section vflmkfdb
 
6218
 
 
6219
@pindex vflmkfdb
 
6220
 
 
6221
@noindent 
 
6222
@b{Usage:} @t{vflmkfdb} @var{font-directory} [ ... ]
 
6223
 
 
6224
A program
 
6225
@command{vflmkfdb} makes a font file hint database (FDB for short) 
 
6226
in a font directories given in the command line argument.
 
6227
 
 
6228
It is used in a font file search module in VFlib.
 
6229
In case there are many font files in many directories, search a font file
 
6230
consumes much time to traverse directory hierarchy.
 
6231
FDB file contains pairs of file name and path name to the file
 
6232
in a single file. By reading FDB file, a font file can be found
 
6233
without traversing directories.
 
6234
 
 
6235
@cindex VFlib.fdb
 
6236
For each @var{font-directory}, a FDB file named @file{VFlib.fdb}
 
6237
is created in the directory.
 
6238
 
 
6239
 
 
6240
@node vfldrvs, , vflmkfdb, Utility programs
 
6241
@section vfldrvs
 
6242
 
 
6243
@pindex vfldrvs
 
6244
 
 
6245
@noindent 
 
6246
@b{Usage:} @t{vfldrvs}
 
6247
 
 
6248
A program
 
6249
@command{vfldrvs} prints a list of pre-installed 
 
6250
font drivers in VFlib.
 
6251
 
 
6252
 
 
6253
 
 
6254
@c ------------------------------------------------------------------------
 
6255
@c      Node,            Next,                                       Previous,         Up
 
6256
@node   Sample programs, Difference between VFlib version 3.6 and 2, Utility programs, Top
 
6257
@chapter Sample programs
 
6258
 
 
6259
@menu
 
6260
* vflserver::
 
6261
* vfltest::
 
6262
* vflx11::
 
6263
* vfldisol::
 
6264
* ctext2pgm::
 
6265
@end menu
 
6266
 
 
6267
@node vflserver, vfltest, , Sample programs
 
6268
@section vflserver
 
6269
 
 
6270
@pindex vflserver
 
6271
@command{vflserver} is a font server that provides 
 
6272
the functionality of VFlib via network.
 
6273
 
 
6274
@command{vflserver} can be invokes from command line or via network.
 
6275
 
 
6276
 
 
6277
@menu
 
6278
* Using vflserver from command line::
 
6279
* Using vflserver via network::
 
6280
* The protocol of vflserver::
 
6281
@end menu
 
6282
 
 
6283
@node Using vflserver from command line, Using vflserver via network, , vflserver
 
6284
@subsection Using vflserver from command line
 
6285
 
 
6286
@noindent 
 
6287
@b{Usage:} @t{vflserver} [@t{-v} @var{vflibcap}] [@t{-s} @var{shrink}] [@var{cmd-file ...}]
 
6288
 
 
6289
@command{vflserver} receives a command, executes it, and return a result.
 
6290
This is repeated until connection is closed or quit command is executed.
 
6291
@command{vflserver} reads a sequence of command from 
 
6292
standard input if @var{cmd-file} option is not given.
 
6293
 
 
6294
@noindent
 
6295
Options:
 
6296
 
 
6297
@table @asis
 
6298
 
 
6299
@item @t{-v} @var{vflibcap}
 
6300
A file name of vflibcap to be used. If this option is not given,
 
6301
default vflibcap file is used. (Possibly, default vflibcap is
 
6302
@file{/usr/local/share/VFlib/3.6.12/vflibcap}.)
 
6303
  
 
6304
@item @t{-s} @var{shrink}
 
6305
@command{vflserver} has a feature to print obtained bitmaps in
 
6306
ASCII-art style for debugging purpose. 
 
6307
When this feature is enabled, bitmaps are shrinked by this factor.
 
6308
This is effective when obtained bitmaps are huge.
 
6309
 
 
6310
@item @var{cmd-file ...}
 
6311
A sequence of commands can be read from files.
 
6312
Commands in files @var{cmd-file ...} are executed in given order.
 
6313
After executing all files, @command{vflserver} reads a sequence of 
 
6314
commands from standard input.
 
6315
Thus, quit command may be explicitly given in @var{cmd-file}.
 
6316
This option is effective in the process of font driver development 
 
6317
to do the same commands many times.
 
6318
 
 
6319
@end table
 
6320
 
 
6321
 
 
6322
@node Using vflserver via network, The protocol of vflserver, Using vflserver from command line, vflserver
 
6323
@subsection Using vflserver via network
 
6324
 
 
6325
Before using @command{vflserver} via network, 
 
6326
it must be installed to be invoked by @command{inetd}.
 
6327
You must be a root to do the following procedures.
 
6328
 
 
6329
@noindent
 
6330
First, edit @file{/etc/services}:
 
6331
 
 
6332
@itemize @bullet
 
6333
@item Network service name: vflserver
 
6334
@item Well known port: 4681
 
6335
@item Protocol: tcp
 
6336
@end itemize
 
6337
 
 
6338
@noindent
 
6339
Add the following line to @file{/etc/inetd.conf}. 
 
6340
 
 
6341
@example
 
6342
vflserver stream tcp nowait nobody /usr/local/bin/vflserver vflserver 
 
6343
@end example
 
6344
 
 
6345
If you need to explicitly specify a vflibcap file to be used,
 
6346
you must give @option{-v} option as follows:
 
6347
 
 
6348
@example
 
6349
vflserver stream tcp nowait nobady /usr/local/bin/vflserver vflserver -v /foo/vflibcap
 
6350
@end example
 
6351
 
 
6352
@noindent
 
6353
To force inetd to re-read @file{inetd.conf},
 
6354
send a HUP signal to inetd.
 
6355
 
 
6356
We finished installing vflserver to use via network.
 
6357
Now, use @command{telnet} to check if @command{vflserver} 
 
6358
is correctly installed to network service.
 
6359
The following an example interaction. 
 
6360
 
 
6361
@example
 
6362
% telnet localhost vflserver
 
6363
Trying 127.0.0.1...
 
6364
Connected to localhost.
 
6365
Escape character is '^]'.
 
6366
; This is a font server VFLSERVER Version 2.0 Fri Mar 13 11:58:42 JST 1998
 
6367
  ...
 
6368
 
 
6369
; Type `HELP' for description of the protocol.
 
6370
 
 
6371
(100 "vflserver ready.")
 
6372
 
 
6373
open1 timR14.pcf
 
6374
(100 0 "timR14.pcf")
 
6375
debug bitmap on
 
6376
(100 "Ascii-art bitmap on.")
 
6377
bitmap1 0 0x67
 
6378
(100 8 13 0 9 9 0
 
6379
 "3eccc4c4cc78407c7f83c1e27c"
 
6380
"
 
6381
 89012345678901
 
6382
 +------------+
 
6383
9|            |9
 
6384
0| ..@@@@@@@@@@.   |0
 
6385
1| @@@@..@@@@..   |1
 
6386
2| @@@@...@@..   |2
 
6387
3| @@@@...@@..   |3
 
6388
4| @@@@..@@@@..   |4
 
6389
5| .@@@@@@@@...   |5
 
6390
6| .@@......   |6
 
6391
7| .@@@@@@@@@@..   |7
 
6392
8| .@@@@@@@@@@@@@@   |8
 
6393
9| +.....@@@@ o |9
 
6394
0| @@@@.....@@   |0
 
6395
1| @@@@@@...@@.   |1
 
6396
2| .@@@@@@@@@@..   |2
 
6397
3|            |3
 
6398
 +------------+
 
6399
 89012345678901
 
6400
")
 
6401
quit
 
6402
(100 "Happy Hacking")
 
6403
Connection closed by foreign host.
 
6404
@end example
 
6405
 
 
6406
 
 
6407
@node The protocol of vflserver, , Using vflserver via network, vflserver
 
6408
@subsection The protocol of vflserver
 
6409
 
 
6410
@subsubsection Introduction
 
6411
The VFLSERVER Protocol is a communication protocol between a 
 
6412
server which offers font service and a client which uses
 
6413
fonts. 
 
6414
 
 
6415
  The character set assumed by this protocol is ASCII character
 
6416
set. A line is a sequence of character terminated by a newline
 
6417
character and communication between a server and a client is
 
6418
line-oriented.
 
6419
     
 
6420
 
 
6421
@subsubsection Reply Format of a Server
 
6422
 
 
6423
Each request to a server by a client takes a form of a line.
 
6424
The following are examples of client's requests.
 
6425
 
 
6426
@example
 
6427
OPEN1 timR24.pcf
 
6428
DEBUG BITMAP ON
 
6429
BITMAP1 1 33
 
6430
@end example
 
6431
 
 
6432
A reply by a server to a client is an S-expression, 
 
6433
(lisp-like notation).
 
6434
The following are examples of server's response.
 
6435
 
 
6436
@example
 
6437
(100 0 "timR14.pcf")
 
6438
(100 "Ascii-art bitmap on.")
 
6439
(100 8 13 0 9 9 0 "3eccc4c4cc78407c7f83c1e27c")
 
6440
@end example
 
6441
 
 
6442
The first number of the response of each reply 
 
6443
by a server are formed by decimal digits and these three digits
 
6444
indicates the status of an execution of client's request.
 
6445
Thus, this three digits is a status code.
 
6446
 
 
6447
The first digit is one of @samp{1}, @samp{2}, ...., @samp{5}. 
 
6448
If this digit is @samp{1}, it there is no error at all. 
 
6449
If it is @samp{5}, there are some errors to achieve a request. 
 
6450
According to the degree of fatalness, the digit is decided; 
 
6451
It is @samp{1} if no error is detected and is @samp{5}
 
6452
if some fatal errors are detected
 
6453
and it is impossible to continue to execute a server.
 
6454
If it is not @samp{5}, a client can receive some result.
 
6455
 
 
6456
@subsubsection The Protocol
 
6457
 
 
6458
The following defines commands and their arguments by a client, 
 
6459
and corresponding responses by a server. Command name is 
 
6460
case-insensitive, but arguments are case-sensitive.
 
6461
In the description of command format, arguments enclosed by [ ]
 
6462
can be omitted, while arguments that are not enclosed by [ ] are
 
6463
essential arguments and cannot be omitted.
 
6464
 
 
6465
 
 
6466
@table @asis
 
6467
 
 
6468
@item @t{OPEN1} @var{font_name} [ @var{point_size} [ @var{mag_x} @var{mag_y} [ @var{dpi_x} @var{dpi_y} ]]]
 
6469
Open a font in mode 1 (high resolution device oriented mode).
 
6470
This corresponds to @code{VF_OpenFont1()} function.
 
6471
If it succeeds opening the font, a font identifier is returned.  
 
6472
After a font is opened, any request for a font is specified by 
 
6473
font identifier (not font name).
 
6474
 
 
6475
@noindent 
 
6476
@b{Response:}
 
6477
@table @asis
 
6478
@item When the command is successful: @t{( @var{status} @var{fontid} @var{message} )}
 
6479
    @var{fontid} is a font id represented by non-negative integer in decimal. 
 
6480
@item When the command failed: @t{( @var{status} @var{message} )}
 
6481
     @var{status} indicates that an error occurred.
 
6482
@end table
 
6483
 
 
6484
 
 
6485
@item @t{OPEN2} @var{font_name} [ @var{pixel_size} [ @var{mag_x} @var{mag_y} ]]
 
6486
Open a font in mode 2 (low resolution device oriented mode).
 
6487
This corresponds to @code{VF_OpenFont2()} function.
 
6488
If it succeeds opening the font, a font identifier is returned.  
 
6489
After a font is opened, any request for a font is specified by 
 
6490
font identifier (not font name).
 
6491
 
 
6492
@noindent 
 
6493
@b{Response:} Response is the same as one for @command{OPEN1} command.
 
6494
 
 
6495
 
 
6496
@item @t{CLOSE} @var{font_id}
 
6497
Closed a font.
 
6498
 
 
6499
@noindent
 
6500
@b{Response:} @t{( @var{status} @var{message} )}
 
6501
 
 
6502
 
 
6503
@item @t{BITMAP1} @var{font_id} @var{code_point} [ @var{mag_x} @var{mag_y} ]
 
6504
Obtain a bitmap. 
 
6505
@var{font_id} is a font id. 
 
6506
This command corresponds to @code{VF_GetBitmap1()} function of VFlib.
 
6507
 
 
6508
@noindent
 
6509
@b{Response:}
 
6510
@table @asis
 
6511
@item When the command is successful: @t{( @var{status} @var{width} @var{height} @var{offx} @var{offy} @var{mvx} @var{mvy} @var{bitmap} )}
 
6512
@var{width} and @var{height} is a size of bitmap in pixels.
 
6513
@var{bitmap} is encoded as a sequence of hexadecimal number. 
 
6514
Eight pixels are encoded to two hexadecimal number and the 
 
6515
weight of the i-th @math{(0 <= i < 8)} pixel from the leftmost 
 
6516
pixel is @t{0x80 >> i}.
 
6517
@var{bitmap} is a sequence of encoded of rasters; the first 
 
6518
raster begins from the upper left corner to upper right corner.
 
6519
Then, it is followed by next raster (one pixel down from the 
 
6520
first raster). One raster is @math{(width+7)/8} bytes, and @var{bitmap} 
 
6521
contains an encoded bitmap of @math{((width+7)/8)*height} bytes. 
 
6522
Thus, the length of @var{bitmap} is @math{2*((width+7)/8)*height}.
 
6523
@item When the command failed: @t{( @var{status} @var{message} )} 
 
6524
     @var{status} indicates that an error occurred.
 
6525
@end table
 
6526
 
 
6527
 
 
6528
@item @t{BITMAP2} @var{font_id} @var{code_point} [ @var{pixel_size} [ @var{mag_x} @var{mag_y} ]]
 
6529
Obtain a bitmap. This command corresponds to @code{VF_GetBitmap2()} function.
 
6530
Response is the same as @command{BITMAP1} command.
 
6531
 
 
6532
 
 
6533
@item @t{METRIC1} @var{font_id} @var{code_point} [ @var{point_size} [ @var{mag_x} @var{mag_y} ]]
 
6534
Obtain a metric information of a font.
 
6535
This command corresponds to @code{VF_GetMetric1()} function.
 
6536
 
 
6537
@noindent
 
6538
@b{Response:}
 
6539
@table @asis
 
6540
@item When the command is successful: @t{( @var{status} @var{width} @var{height} @var{offx} @var{offy} @var{mvx} @var{mvy} )}
 
6541
Each element of the response is the same as return 
 
6542
values for @command{BITMAP1} command except for their units are points.
 
6543
@item When the command failed: @t{( @var{status} @var{message} )}
 
6544
     @var{status} indicates that an error occurred.
 
6545
@end table
 
6546
 
 
6547
 
 
6548
@item @t{METRIC2} @var{font_id} @var{code_point} [ @var{pixel_size} [ @var{mag_x} @var{mag_y} ]]
 
6549
Obtain a metric information of a font.
 
6550
This command corresponds to @code{VF_GetMetric2()} function.
 
6551
 
 
6552
@noindent
 
6553
@b{Response:} Same as METRIC1 command except for units are points.
 
6554
 
 
6555
 
 
6556
@item @t{FONTBBX1} @var{font_id} [ @var{mag_x} @var{mag_y} ]
 
6557
Obtain font bounding information of a given font @var{font_id} opened
 
6558
in mode 1. 
 
6559
The argument @var{mag_x} @var{mag_y} are magnification factor
 
6560
to be scaled.
 
6561
This command corresponds to @code{VF_GetFontBoundingBox1()} function.
 
6562
 
 
6563
@noindent
 
6564
@b{Response:}
 
6565
@table @asis
 
6566
@item When the command is successful: @t{( @var{status} @var{width} @var{height} @var{xoff} @var{yoff} )}
 
6567
@var{width} and @var{height} are width and height
 
6568
of bounding box, respectively.
 
6569
@var{xoff} and @var{yoff} are the largest 
 
6570
horizontal and vertical displacement of lower left corner of 
 
6571
bounding box from reference points.
 
6572
Note that these values does not guarantee the minimality;
 
6573
they only guarantee that all characters can be contained in
 
6574
a box described by them.
 
6575
Units of return values are point.
 
6576
 
 
6577
@item When the command failed: @t{( @var{status} @var{message} )}
 
6578
     @var{status} indicates that an error occurred.
 
6579
@end table
 
6580
 
 
6581
 
 
6582
@item @t{FONTBBX2} @var{font_id} [ @var{mag_x} @var{mag_y} ]
 
6583
Arguments and return values are the same except
 
6584
@var{font_id} must be in mode 2 and
 
6585
units of return values are pixel.
 
6586
 
 
6587
 
 
6588
@item @t{PROPERTY} @var{font_id} @var{property_name}
 
6589
Obtain a property named @var{property_name} of a font @var{font_id}.
 
6590
@noindent
 
6591
 
 
6592
@b{Response:}
 
6593
@table @asis
 
6594
@item When the command is successful: @t{( @var{status} @var{value} )}
 
6595
@item When the command failed: @t{( @var{status} @var{message} )}
 
6596
     @var{status} indicates that an error occurred.
 
6597
@end table
 
6598
 
 
6599
 
 
6600
@item @t{MINIMIZE-BBX} [ @var{flag} ]
 
6601
Select a mode whether a bitmap sent from a server
 
6602
should be minimized or not. If @var{flag} is @code{ON}, bounding boxes of
 
6603
bitmaps sent from a server is minimized not to contain white 
 
6604
pixels as possible. 
 
6605
If @var{flag} is @code{OFF}, bitmaps sent from a 
 
6606
server is not guaranteed to be minimized bounding boxes.
 
6607
If @var{flag} is not given, current mode is returned. 
 
6608
Initial mode is @code{OFF}.
 
6609
 
 
6610
@noindent
 
6611
@b{Response:} The current mode is returned even if the operation fails or succeeds.
 
6612
@table @asis
 
6613
@item When the command is successful: @t{( @var{status-code} @var{mode} )}
 
6614
      @var{Mode} is one of @code{ON} or @code{OFF}.
 
6615
@item When the command failed: @t{( @var{status-code} @var{mode} )}
 
6616
      @var{Mode} is one of @code{ON} or @code{OFF}.
 
6617
@end table
 
6618
 
 
6619
 
 
6620
@item @t{QUIT}
 
6621
Finish interaction between a server and a client.
 
6622
This operation always succeeds.
 
6623
 
 
6624
@noindent 
 
6625
@b{Response:}   @t{( @var{status} @var{message} )}
 
6626
 
 
6627
@end table
 
6628
 
 
6629
 
 
6630
 
 
6631
@node vfltest, vflx11, vflserver, Sample programs
 
6632
@section vfltest
 
6633
 
 
6634
@pindex vfltest
 
6635
 
 
6636
@command{vfltest} displays glyph of a given font and characters
 
6637
by ASCII-art form on a character terminal.
 
6638
It does not requires X Window System, but the font of the terminal must be
 
6639
a fixed-width font, since bitmaps are printed by ASCII-art form.
 
6640
 
 
6641
@noindent 
 
6642
@b{Usage:} @t{vfltest} [ @var{OPTIONS...} ] @var{FONT_NAME} @var{CHAR_LIST}
 
6643
 
 
6644
@noindent
 
6645
@b{Options:}
 
6646
 
 
6647
@table  @asis
 
6648
@item @t{-mode1}
 
6649
A font is opened in mode 1 (high resolution device oriented mode).
 
6650
 
 
6651
@item @t{-mode2}
 
6652
A font is opened in mode 2 (low resolution device oriented mode).
 
6653
 
 
6654
@item @t{-ol}
 
6655
Bitmaps are obtained by @code{VF_GetOutline()}
 
6656
and then @code{VF_OutlineToBitmap()}.
 
6657
This option is effective only when a font is opened in mode 1.
 
6658
 
 
6659
@item @t{-v} @var{vflibcap}
 
6660
A file name of vflibcap to be used. If this option is not given,
 
6661
default vflibcap file is used. (Possibly, default vflibcap is
 
6662
@file{/usr/local/share/VFlib/3.6.12/vflibcap}.)
 
6663
  
 
6664
@item @t{-p} @var{point} or @t{-p} @var{pixel}
 
6665
Specify point or pixel size of characters.
 
6666
If this option is not given, size of characters
 
6667
are original size of a font.
 
6668
 
 
6669
@item @t{-d} @var{dpi}
 
6670
Give a device resolution in DPI. 
 
6671
This option is effective only when a font is opened in mode 1.
 
6672
 
 
6673
@item @t{-m} @var{mag}
 
6674
Specify vertical and horizontal magnification factor.
 
6675
If this option is not given, magnification factor is 1.0.
 
6676
 
 
6677
@item @t{-mx} @var{mag_h}
 
6678
Specify horizontal magnification factor.
 
6679
If this option is not given, horizontal magnification factor is 1.0.
 
6680
 
 
6681
@item @t{-my} @var{mag_v}
 
6682
Specify vertical magnification factor.
 
6683
If this option is not given, vertical magnification factor is 1.0.
 
6684
 
 
6685
@item @t{--help}
 
6686
Print command line arguments and key operations on a window.
 
6687
 
 
6688
@end table
 
6689
 
 
6690
A list of character is a sequence of the following forms.
 
6691
 
 
6692
@table @asis
 
6693
 
 
6694
@item @var{code}
 
6695
A character is given by character code.
 
6696
Decimal (e.g., @samp{34}) and  Hexa-decimal (e.g., @samp{0x67}) 
 
6697
numbers can be used.
 
6698
 
 
6699
@item @var{from} @t{-} @var{to}
 
6700
This form specifies characters by a range of character code, 
 
6701
from @var{from} to @var{to}  (e.g., @samp{0x20 - 0x7e}).
 
6702
Space characters are necessary before and after minus sign (@code{-}).
 
6703
 
 
6704
@item @t{=}@var{charlist}
 
6705
This form specifies characters by a list of 1-byte characters, 
 
6706
e.g., @samp{=abcdefg}.
 
6707
 
 
6708
@end table
 
6709
 
 
6710
 
 
6711
@node vflx11, vfldisol, vfltest, Sample programs
 
6712
@section vflx11
 
6713
 
 
6714
@pindex vflx11
 
6715
 
 
6716
@command{vflx11} displays glyph of a given font in a window.  
 
6717
It requires X11R5 or X11R6. 
 
6718
 
 
6719
@noindent 
 
6720
@b{Usage:} @t{vflx11} [ @var{OPTIONS...} ] @var{FONT_NAME}
 
6721
 
 
6722
@noindent
 
6723
@b{Options:}
 
6724
 
 
6725
@table @asis
 
6726
@item @t{-mode1}
 
6727
A font is opened in mode 1 (high resolution device oriented mode).
 
6728
 
 
6729
@item @t{-ol}
 
6730
Bitmaps are obtained by @code{VF_GetOutline()}
 
6731
 and then @code{VF_OutlineToBitmap()}.
 
6732
This is effective when a font is opened in mode 1.
 
6733
 
 
6734
@item @t{-mode2}
 
6735
A font is opened in mode 2 (low resolution device oriented mode).
 
6736
 
 
6737
@item @t{-v} @var{vflibcap}
 
6738
A file name of vflibcap to be used. If this option is not given,
 
6739
default vflibcap file is used. (Possibly, default vflibcap is
 
6740
@file{/usr/local/share/VFlib/3.6.12/vflibcap}.)
 
6741
  
 
6742
@item @t{-p} @var{point} or @t{-p} @var{pixel}
 
6743
Specify point or pixel size of characters.
 
6744
If this option is not given, size of characters
 
6745
are original size of a font.
 
6746
 
 
6747
@item @t{-m} @var{mag}
 
6748
Specify vertical and horizontal magnification factor.
 
6749
If this option is not given, magnification factor is 1.0.
 
6750
 
 
6751
@item @t{-mx} @var{mag_h}
 
6752
Specify horizontal magnification factor.
 
6753
If this option is not given, horizontal magnification factor is 1.0.
 
6754
 
 
6755
@item @t{-my} @var{mag_v}
 
6756
Specify vertical magnification factor.
 
6757
If this option is not given, vertical magnification factor is 1.0.
 
6758
 
 
6759
@item @t{--help}
 
6760
Print command line arguments and key operations on a window.
 
6761
 
 
6762
@end table
 
6763
 
 
6764
@noindent 
 
6765
Following operations are defined on a @command{vflx11} window. 
 
6766
 
 
6767
@table @asis
 
6768
 
 
6769
@item @key{q} 
 
6770
Finish @command{vflx11}
 
6771
 
 
6772
@item  @key{b}
 
6773
Go to previous page.
 
6774
 
 
6775
@item  @key{SPC}
 
6776
Go to next page.
 
6777
 
 
6778
@item  @key{[}
 
6779
Go to previous 4 page.
 
6780
 
 
6781
@item  @key{]}
 
6782
Go to next 4 page.
 
6783
 
 
6784
@item  @key{@{}
 
6785
Go to previous 16 page.
 
6786
 
 
6787
@item  @key{@}}
 
6788
Go to next 16 page.
 
6789
 
 
6790
@item  @key{+}
 
6791
Enlarge the window.
 
6792
 
 
6793
@item  @key{-}
 
6794
Shrink the window.
 
6795
 
 
6796
@item  @key{<}
 
6797
Go to the first page.
 
6798
 
 
6799
@item  @key{>}
 
6800
Go to the last page.
 
6801
 
 
6802
@item  @key{m}
 
6803
Mark the current page.
 
6804
 
 
6805
@item  @key{g}
 
6806
Goto the marked page.
 
6807
 
 
6808
@end table
 
6809
 
 
6810
 
 
6811
 
 
6812
@node vfldisol, ctext2pgm, vflx11, Sample programs
 
6813
@section vfldisol
 
6814
 
 
6815
@pindex vfldisol
 
6816
@command{vfldisol} displays `disassembled lists' 
 
6817
of vector data of a given font and code points.
 
6818
 
 
6819
@noindent 
 
6820
@b{Usage:} @t{vfldisol} [ @var{OPTIONS...} ] @var{FONT_NAME} @var{CODE} ...
 
6821
 
 
6822
@noindent
 
6823
@b{Options:}
 
6824
 
 
6825
@table @asis
 
6826
 
 
6827
@item @t{-v @var{VFLIBCAP}} 
 
6828
A file name of vflibcap to be used. If this option is not given,
 
6829
default vflibcap file is used. (Possibly, default vflibcap is
 
6830
@file{/usr/local/share/VFlib/3.6.12/vflibcap}.)
 
6831
 
 
6832
@item @t{-d @var{DPI}}
 
6833
Resolution of device in dpi.
 
6834
If this option is not given, default resolution of a font is used.
 
6835
 
 
6836
@item @t{-p @var{POINT}}
 
6837
Point size of characters.
 
6838
If this option is not given, default point size of a font is used.
 
6839
 
 
6840
@item @t{-x}
 
6841
Print hexadecimal dump of outline data instead of disassembled list.
 
6842
 
 
6843
@end table
 
6844
 
 
6845
 
 
6846
@node ctext2pgm, , vfldisol, Sample programs
 
6847
@section ctext2pgm
 
6848
 
 
6849
@pindex ctext2pgm
 
6850
@cindex PGM
 
6851
@cindex PBM
 
6852
@command{ctext2pgm} creates an image file in PGM or PBM format
 
6853
from a multilingual text file encoded by compound text format.
 
6854
It also supports various text encodings such as 
 
6855
Chinese, Japanese, Korean EUCs and Shift-JIS.
 
6856
PGM and PBM formats are portable formats, image files can be
 
6857
easily converted to another image format such as GIF, TIFF.
 
6858
@cindex EUC
 
6859
@cindex Japanese EUC
 
6860
@cindex Korean EUC
 
6861
@cindex Chinese EUC
 
6862
 
 
6863
It supports various character sets and left-to-right
 
6864
and right-to-left directionalities.
 
6865
@cindex right-to-left directionality
 
6866
@cindex left-to-right directionality
 
6867
 
 
6868
@table @asis
 
6869
 
 
6870
@cindex ISO 8859
 
6871
@cindex Hebrew
 
6872
@cindex Cyrillic
 
6873
@item ISO 8859-1,2,3,4,5,7,8,9
 
6874
--- Latin character sets, 
 
6875
including Hebrew which is written from right to left.
 
6876
 
 
6877
@cindex Arabic
 
6878
@cindex Mule
 
6879
@item Mule Arabic
 
6880
--- An Arabic script, written from right to left. 
 
6881
This character set is used by the multilingual editor Mule.
 
6882
 
 
6883
@cindex JIS X 0201
 
6884
@cindex JIS X 0208
 
6885
@cindex JIS X 0212
 
6886
@item JIS X 0201, JIS X 0208, JIS X 0212
 
6887
--- Japanese character sets.
 
6888
 
 
6889
@cindex GB 2312
 
6890
@item GB 2312
 
6891
--- A Chinese character set.
 
6892
 
 
6893
@cindex CNS 11641
 
6894
@item CNS 11641-1, CNS 11641-2
 
6895
--- Chinese character sets.
 
6896
 
 
6897
@cindex KSC 5601
 
6898
@item KSC 5601
 
6899
--- A Hangle character set.
 
6900
 
 
6901
@end table
 
6902
 
 
6903
 
 
6904
@subsection Running ctext2pgm
 
6905
 
 
6906
@noindent 
 
6907
@b{Usage:} @t{ctext2pgm} [ @var{OPTIONS...} ] [ @var{file} ]
 
6908
 
 
6909
@noindent 
 
6910
--- @command{ctext2pgm} reads @var{file} (if not given, reads standard input)
 
6911
and prints image file to standard output.
 
6912
 
 
6913
@b{Example:}
 
6914
@example
 
6915
% ctext2pgm -pgm -ctext -16 -times DOC-10.txt  > IMAGE.pgm
 
6916
@end example
 
6917
(Never forget to redirect the output.)
 
6918
 
 
6919
 
 
6920
@noindent
 
6921
@b{Options for VFlib:}
 
6922
 
 
6923
@table @asis
 
6924
@item @t{-v @var{f}}
 
6925
--- a vflibcap file to be used by @command{ctext2pgm}.
 
6926
Default value is @file{vflibcap-ctext2pgm}.
 
6927
@end table
 
6928
 
 
6929
 
 
6930
@noindent
 
6931
@b{Options for input encoding and script:}
 
6932
 
 
6933
@table @asis
 
6934
@item @t{-ctext}
 
6935
--- Assume that an encoding of input file. 
 
6936
(This is the default input encoding.)
 
6937
Default writing directionality is set to left-to-right.
 
6938
 
 
6939
By this encoding, multiple character set can be used in an input text
 
6940
by escape sequences.
 
6941
Mixture of scripts of left-to-right and right-to-left directionalities
 
6942
is also supported.
 
6943
 
 
6944
@item @t{-iso-8859-1} or @t{-latin-1}
 
6945
--- Assume that input file is encoded by iso-8859-1.
 
6946
Escape sequence is not allowed in input file.
 
6947
Default writing directionality is set to left-to-right.
 
6948
 
 
6949
@item @t{-iso-8859-2} or @t{-latin-2}
 
6950
--- Assume that input file is encoded by iso-8859-2.
 
6951
Escape sequence is not allowed in input file.
 
6952
Default writing directionality is set to left-to-right.
 
6953
 
 
6954
@item @t{-iso-8859-3} or @t{-latin-3}
 
6955
--- Assume that input file is encoded by iso-8859-3.
 
6956
Escape sequence is not allowed in input file.
 
6957
Default writing directionality is set to left-to-right.
 
6958
 
 
6959
@item @t{-iso-8859-4} or @t{-latin-4}
 
6960
--- Assume that input file is encoded by iso-8859-4.
 
6961
Escape sequence is not allowed in input file.
 
6962
Default writing directionality is set to left-to-right.
 
6963
 
 
6964
@item @t{-iso-8859-5}, @t{-cyrillic} or @t{-russian}
 
6965
--- Assume that input file is encoded by iso-8859-5.
 
6966
Escape sequence is not allowed in input file.
 
6967
Default writing directionality is set to left-to-right.
 
6968
 
 
6969
@item @t{-iso-8859-7} or @t{-greek}
 
6970
--- Assume that input file is encoded by iso-8859-7.
 
6971
Escape sequence is not allowed in input file.
 
6972
Default writing directionality is set to left-to-right.
 
6973
 
 
6974
@item @t{-iso-8859-8} or @t{-hebrew}
 
6975
--- Assume that input file is encoded by iso-8859-7.
 
6976
Escape sequence is not allowed in input file.
 
6977
Default writing directionality is set to right-to-left.
 
6978
 
 
6979
@item @t{-iso-8859-9} or @t{-latin-5}
 
6980
--- Assume that input file is encoded by iso-8859-9.
 
6981
Escape sequence is not allowed in input file.
 
6982
Default writing directionality is set to left-to-right.
 
6983
 
 
6984
@item @t{-euc-jp} or @t{-euc-jp1}
 
6985
--- Assume that input file is encoded by Japanese EUC.
 
6986
Default writing directionality is set to left-to-right.
 
6987
 
 
6988
JIS X 0201 Roman character set is used for code set 0, 
 
6989
JIS X 0208 is used for code set 1, 
 
6990
JIS X 0201 Kana is used for code set 2, and
 
6991
JIS X 0212 is used for code set 3.
 
6992
 
 
6993
@item @t{-euc-jp2}
 
6994
--- Same as @t{-euc-jp1} except 
 
6995
ASCII character set is used for code set 0.
 
6996
 
 
6997
@item @t{-euc-kr}
 
6998
--- Assume that input file is encoded by Korean EUC.
 
6999
Default writing directionality is set to left-to-right.
 
7000
 
 
7001
ASCII character set is used for code set 0 and
 
7002
KSC 5601 is used for code set 1. 
 
7003
 
 
7004
@item @t{-euc-cn} or @t{-euc-gb}
 
7005
--- Assume that input file is encoded by Chinese EUC by simplified Hanzi.
 
7006
Default writing directionality is set to left-to-right.
 
7007
 
 
7008
ASCII character set is used for code set 0, and
 
7009
GB 2312 is used for code set 1.
 
7010
 
 
7011
@item @t{-euc-cns}
 
7012
--- Assume that input file is encoded by Chinese EUC by traditional Hanzi.
 
7013
Default writing directionality is set to left-to-right.
 
7014
 
 
7015
ASCII character set is used for code set 0, 
 
7016
CNS 11643-1 is used for code set 1, and
 
7017
CNS 11643-2 is used for code set 3.
 
7018
 
 
7019
@cindex Shift JIS
 
7020
@item @t{-sjis}
 
7021
--- Assume that input file is encoded by Shift-JIS.
 
7022
Escape sequence is not allowed in input file.
 
7023
Default writing directionality is set to left-to-right.
 
7024
 
 
7025
ASCII character set is used for code set 0, 
 
7026
JIS X 0208 is used for code set 1, and
 
7027
 
 
7028
@end table
 
7029
 
 
7030
 
 
7031
@noindent
 
7032
@b{Options for directionality:}
 
7033
 
 
7034
@table @asis
 
7035
@item @t{-l2r}
 
7036
--- Select left-to-right directionality for typesetting.
 
7037
@item @t{-r2l}
 
7038
--- Select right-to-left directionality for typesetting.
 
7039
@end table
 
7040
 
 
7041
 
 
7042
@noindent
 
7043
@b{Options for font selection:}
 
7044
 
 
7045
@table @asis
 
7046
 
 
7047
@item @t{-fixed}, @t{-times}, @t{-helv} or @t{-cour}
 
7048
--- Select a font family: Fixed, Times, Helvetia, or Courier, respectively.
 
7049
Default font family is Times.
 
7050
 
 
7051
@item @t{-bold} or @t{-italic}
 
7052
--- Select a font face: bold or italic (or oblique), respectively.
 
7053
Default face is normal.
 
7054
 
 
7055
@item @t{-14}, @t{-16}, @t{-18} or @t{-24}
 
7056
--- Select a font set of 14-, 16-, 18-, or 24-dot, respectively.
 
7057
Default font size if 16.
 
7058
 
 
7059
@item @t{-scale @var{n}}
 
7060
--- Select a scalable font set and scales the font to @i{n} dot.
 
7061
 
 
7062
@item @t{-m @var{m}}
 
7063
--- Specify vertical and horizontal magnification factors.
 
7064
Default value is 1.
 
7065
 
 
7066
@item @t{-mx @var{m}}
 
7067
--- Specify horizontal magnification factor.
 
7068
 
 
7069
@item @t{-my @var{m}}
 
7070
--- Specify vertical magnification factor.
 
7071
 
 
7072
@item @t{-font-list}
 
7073
--- Print all installed character sets and font names. Then exit the program.
 
7074
 
 
7075
@end table
 
7076
 
 
7077
 
 
7078
@noindent
 
7079
@b{Options for typesetting:}
 
7080
 
 
7081
@table @asis
 
7082
@item @t{-b @var{s}}
 
7083
--- Specify factor of baseline skip. 
 
7084
Baseline of a text is moved this value times dot-size of a selected font set.
 
7085
Default value is 1.2.
 
7086
 
 
7087
@item @t{-center-line}
 
7088
--- Each line is centered.
 
7089
Output image is vertically and horizontally centered.
 
7090
 
 
7091
@item @t{-flush-left}
 
7092
--- Each line is flushed left.
 
7093
This is default mode if writing directionality is left-to-right.
 
7094
Output image is flushed left.
 
7095
 
 
7096
@item @t{-left-line}
 
7097
--- Each line is flushed left, but image is not flushed left.
 
7098
 
 
7099
@item @t{-flush-right}
 
7100
--- Each line is flushed to right.
 
7101
This is the default mode if writing directionality is right-to-left.
 
7102
(Note that options @option{-flush-right} and @option{-r2l} are different
 
7103
--- consider an English text including Arabic words in the same line.)
 
7104
Output image is flushed right.
 
7105
 
 
7106
@item @t{-right-line}
 
7107
--- Each line is flushed right, but image is not flushed right.
 
7108
 
 
7109
@end table
 
7110
 
 
7111
It is important to notice that the difference 
 
7112
of @option{-flush-left} and @option{-left-line} options 
 
7113
(and @option{-flush-right} and @option{-right-line} options).
 
7114
By @option{-flush-left} option, input text is typeset to flush each line left
 
7115
and typeset result is placed in the left of an output image.
 
7116
By @option{-left-line} option, input text is typeset to flush each line left
 
7117
and does not specify how to put the typeset result in an output image.
 
7118
The difference appears when the horizontal size of output image is 
 
7119
explicitly given by @option{-pw} option.
 
7120
 
 
7121
 
 
7122
 
 
7123
@noindent
 
7124
@b{Options for output:}
 
7125
 
 
7126
@table @asis
 
7127
 
 
7128
@item @t{-pgm} or @t{-pgm-raw}
 
7129
--- Select binary PGM format for image output.
 
7130
 
 
7131
@item @t{-pgm-ascii}
 
7132
--- Select ascii PGM format for image output.
 
7133
This is the default output mode.
 
7134
 
 
7135
@item @t{-pbm} or @t{-pbm-ascii}
 
7136
--- Select ascii PBM format for output an image.
 
7137
 
 
7138
@item @t{-ascii-art} or @t{-ascii-art-v}
 
7139
--- An image is printed as an ASCII art. (Vertical mode)
 
7140
Baseline is vertical; thus this mode is similar 
 
7141
to the @command{banner} command
 
7142
on Unix.
 
7143
 
 
7144
@item @t{-ascii-art-h} 
 
7145
--- An image is printed as an ASCII art. (Horizontal mode)
 
7146
Baseline is horizontal.
 
7147
 
 
7148
@item @t{-eps}
 
7149
--- Select EPS format for image output.
 
7150
By default, 16-dot font is printed by 12-point in EPS file.
 
7151
To change the point size, use the @t{-eps-ptsize} option described below.
 
7152
 
 
7153
@item @t{-eps-ptsize @var{pt}}
 
7154
--- Select point size of characters for EPS output.
 
7155
If this option is given, point size of each character is 
 
7156
scaled to @var{pt} point regardless dot size of fonts. 
 
7157
 
 
7158
@item @t{-none}
 
7159
--- An image is not shipped out.
 
7160
 
 
7161
@item @t{-r}
 
7162
--- Reverse the black and white of output image.
 
7163
(This option does not have effect when EPS is selected
 
7164
for image output format.)
 
7165
 
 
7166
@item @t{-s @var{n}}
 
7167
--- Shrink factor for anti-aliased output.
 
7168
@var{n} by @var{n} pixels are shrinked together and forms one pixel 
 
7169
in an output image. 
 
7170
This option has effect when output format is PGM and EPS.
 
7171
Default value is 1.
 
7172
 
 
7173
@item @t{-pw @var{w}}
 
7174
--- Specify width of output image (in pixels).
 
7175
If this option is not given, the width of output image is the 
 
7176
smallest width to contain the glyph of all characters.
 
7177
 
 
7178
@item @t{-ph}
 
7179
--- Specify height of output image (in pixels).
 
7180
If this option is not given, the height of output image is the 
 
7181
smallest height to contain the glyph of all characters.
 
7182
 
 
7183
@item @t{-g}
 
7184
--- Specify horizontal and vertical margins of output image (in pixels).
 
7185
Default margin is zero pixel.
 
7186
 
 
7187
@item @t{-gx}
 
7188
--- Specify horizontal margin of output image (in pixels).
 
7189
Default margin is zero pixel.
 
7190
 
 
7191
@item @t{-gy}
 
7192
--- Specify vertical margin of output image (in pixels).
 
7193
Default margin is zero pixel.
 
7194
 
 
7195
@item @t{-center-image}
 
7196
--- An image of typeset text is horizontaly and vertically centered.
 
7197
 
 
7198
@item @t{-h-center-image}
 
7199
--- An image of typeset text is horizontaly centered.
 
7200
 
 
7201
@item @t{-v-center-image}
 
7202
--- An image of typeset text is vertically centered.
 
7203
 
 
7204
@item @t{-left-image}
 
7205
--- An image of typeset text is flushed left.
 
7206
 
 
7207
@item @t{-right-image}
 
7208
--- An image of typeset text is flushed right.
 
7209
 
 
7210
@item @t{-top-image}
 
7211
--- An image of typeset text is flushed top.
 
7212
 
 
7213
@item @t{-bottom-image}
 
7214
--- An image of typeset text is flushed bottom.
 
7215
 
 
7216
@end table
 
7217
 
 
7218
 
 
7219
 
 
7220
@subsection Making input files for ctext2pgm
 
7221
 
 
7222
Any text editor can be used to prepare input files for @command{ctext2pgm}.
 
7223
Input files are plain texts. 
 
7224
If you want to create an image containing multiple character sets,
 
7225
save the files by @emph{compound text} encoding.
 
7226
@cindex compound text
 
7227
If you want to make images of Arabic text, use the @command{Mule} editor.
 
7228
(@command{Mule} is an extension of @command{GNU Emacs} 
 
7229
for multilingual text processing.)
 
7230
For making images of Arabic script, @command{ctext2pgm} only supports 
 
7231
a text created by Mule, ISO-8859-6 is not supported.
 
7232
@cindex Mule
 
7233
@cindex GNU Emacs
 
7234
@cindex Emacs
 
7235
 
 
7236
Unlike @TeX{} and HTML, 
 
7237
newlines of input files are @emph{not} ignored and 
 
7238
a newline character in input text breaks line.
 
7239
Thus, input text is typeset like  `verbatim' environment of La@TeX{} or
 
7240
`<PRE> ... </PRE>' tag of HTML.
 
7241
 
 
7242
 
 
7243
@subsection Commands in input text
 
7244
 
 
7245
Several commands can be embedded in text files such as font switch.
 
7246
Command sequence starts by a backslash (@code{\}) followed by one character
 
7247
which represents command name.
 
7248
If you want to display a backslash character itself, use 
 
7249
double backslashes @code{\\}. 
 
7250
 
 
7251
Following commands are defined:
 
7252
 
 
7253
@table @asis
 
7254
 
 
7255
@item @code{\f}, @code{\t}, @code{\h}, @code{\c}
 
7256
--- Change of font families. 
 
7257
Current font family is changed to 
 
7258
fixed, times, Helvetia, courier, respectively.
 
7259
 
 
7260
@item @code{\d}
 
7261
--- Current font family is changed to the default font family.
 
7262
The default font family can be specified by a command line option.
 
7263
 
 
7264
@item @code{\N}, @code{\B}, @code{\I}
 
7265
--- Change of font faces. 
 
7266
Current font face is changed to normal, bold, italic, respectively.
 
7267
 
 
7268
@item @code{\D}
 
7269
--- Current font face is changed to the default font face.
 
7270
The default font face can be specified by a command line option.
 
7271
 
 
7272
@item @code{\.}
 
7273
--- Same as @code{\d} followed by @code{\D}.
 
7274
 
 
7275
@item @code{\(}
 
7276
--- Black and white of glyph of following characters are reversed.
 
7277
This command is recommended @emph{only} for fixed-width fonts.
 
7278
(For the reason of current implementation,
 
7279
 resulting bitmap is ugly for proportional fonts and you cannot 
 
7280
 read the text in an image.)
 
7281
 
 
7282
Nesting of @code{\(} has no effect.
 
7283
 
 
7284
@item @code{\)}
 
7285
--- End of reversing black and white.
 
7286
 
 
7287
@item @code{\\}
 
7288
--- Print backslash itself.
 
7289
 
 
7290
@end table
 
7291
 
 
7292
 
 
7293
@subsection Trouble shooting
 
7294
 
 
7295
In case you failed to obtain a desired image output, 
 
7296
the following command line options for debugging may be useful.
 
7297
(Debugging messages are printed to standard output.
 
7298
The @option{-none} option is useful to suppress printing binary image
 
7299
to your terminal. Otherwise, debugging message and image file
 
7300
are printed together on your terminal!)
 
7301
 
 
7302
@table @asis
 
7303
@item @t{-ds}
 
7304
--- Print the state transition of the parser for compound text.
 
7305
@item @t{-dr2l}
 
7306
--- Print the state transition of bi-directionality handling.
 
7307
@item @t{-df}
 
7308
--- Print font name to be opened.
 
7309
@item @t{-dbc}
 
7310
--- Print each character glyph in ascii-art form.
 
7311
@item @t{-dbl}
 
7312
--- Print each line image by in ascii-art form.
 
7313
@item @t{-dbp}
 
7314
--- Print entire page image in ascii-art form.
 
7315
@item @t{-dall}
 
7316
--- Selects all debugging options above.
 
7317
@end table
 
7318
 
 
7319
 
 
7320
 
 
7321
@c ------------------------------------------------------------------------
 
7322
@c      Node,                                       Next,  Previous,        Up
 
7323
@node   Difference between VFlib version 3.6 and 2, Concept index, Sample programs, Top
 
7324
@chapter Difference between VFlib version 3.6 and 2
 
7325
 
 
7326
VFlib version 3.6 and version 2 are quite different and 
 
7327
you should forget about VFlib version 2.
 
7328
 
 
7329
@table @asis
 
7330
 
 
7331
@item VFlib 2 was designed only for Japanese Kanji fonts
 
7332
   VFlib 3.6 can handle fonts for multilingual text printing.
 
7333
 
 
7334
@item Font metric is introduced in VFlib 3.6
 
7335
   VFlib 2 does not concepts on font metrics since it assumes
 
7336
   all characters are the same metrics.
 
7337
   Font metrics is introduced in VFlib 3.6 and proportional fonts
 
7338
   can be used.
 
7339
 
 
7340
@item Syntax of vflibcap file
 
7341
   Syntax of vflibcap file is quite different.
 
7342
   VFlib 2 adopted termcap-like notation, but now
 
7343
   VFlib 3.6 adopts lisp-like notation.
 
7344
 
 
7345
@item Arguments and return values of function are changed
 
7346
   In VFlib 2, bitmaps of characters are written in a frame buffer
 
7347
   which is given by argument.
 
7348
   But in VFlib 3.6, a bitmap object is returned.
 
7349
 
 
7350
@end table
 
7351
 
 
7352
 
 
7353
 
 
7354
@c ------------------------------------------------------------------------
 
7355
@c    Node, Next, Previous,                                Up
 
7356
@node Acknowledgments, Concept index, Difference between VFlib version 3.6 and 2, Top
 
7357
@unnumbered Acknowledgments
 
7358
 
 
7359
Since I released VFlib version 1, so many people helped me 
 
7360
to improve VFlib.
 
7361
I am grateful for all of them.
 
7362
Special gratitude is due to Satoru Tomura, Ken'ichi Handa,
 
7363
Werner Lemberg, and Ichiro Matsuda.
 
7364
 
 
7365
 
 
7366
 
 
7367
@c ------------------------------------------------------------------------
 
7368
@c    Node, Next, Previous,                                Up
 
7369
@node Concept index, Data type index, Acknowledgments, Top
 
7370
@unnumbered Concept index
 
7371
 
 
7372
@printindex cp
 
7373
 
 
7374
 
 
7375
@c ------------------------------------------------------------------------
 
7376
@c    Node,            Next,           Previous,      Up
 
7377
@node Data type index, Function index, Concept index, Top
 
7378
@unnumbered Data type index
 
7379
 
 
7380
@printindex tp
 
7381
 
 
7382
 
 
7383
@c ------------------------------------------------------------------------
 
7384
@c    Node,            Next,           Previous,      Up
 
7385
@node Function index, Program index, Data type index, Top
 
7386
@unnumbered Function index
 
7387
 
 
7388
@printindex fn
 
7389
 
 
7390
 
 
7391
@c ------------------------------------------------------------------------
 
7392
@c    Node,        Next,      Previous,      Up
 
7393
@node Program index, Acknowledgments,  Function index, Top
 
7394
@unnumbered Program index
 
7395
@printindex pg
 
7396
 
 
7397
 
 
7398
 
 
7399
@c ------------------------------------------------------------------------
 
7400
@summarycontents
 
7401
@contents
 
7402
 
 
7403
@c ------------------------------------------------------------------------
 
7404
@bye