1
\input texinfo @c -*-texinfo-*-
3
@setfilename VFlib-36.info
10
@c @dircategory Miscellaneous
12
@c * VFlib: (VFlib-36.info). A font library VFlib version 3.6.12
15
@c ------------------------------------------------------------------------
21
@hyphenation{set-scrunch set-write-pos}
30
@c ------------------------------------------------------------------------
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
37
@c ------------------------------------------------------------------------
41
@c ------------------------------------------------------------------------
42
@c Node, Next, Previous, Up
47
This is a TeXinfo version of
50
@c echo "VFlib 3.6.12" | ctext2pgm -18 -times -ascii-art-h
52
VVVVV VVVV FFFFFFFFF ll ii bb
53
VVV VV FF FF lll ii 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
68
User's Manual by Hirotsugu Kakugawa
69
Final Revision: 1 Nov 2001
81
* Programming with VFlib::
82
* Writing a vflibcap::
83
* Debugging a vflibcap::
84
* Code conversion system::
87
* Difference between VFlib version 3.6 and 2::
94
@c ------------------------------------------------------------------------
96
@c ------------------------------------------------------------------------
97
@c Node, Next, Previous, Up
98
@node Copyright, Copying, , Top
103
@cindex GNU Library General Public License
105
Copyright (C) 1996-2001 Hirotsugu Kakugawa.
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.
122
@c ------------------------------------------------------------------------
123
@c Node, Next, Previous, Up
124
@node Copying, Introduction, Copyright, Top
127
@center GNU LIBRARY GENERAL PUBLIC LICENSE
128
@center Version 2, June 1991
131
Copyright @copyright{} 1991 Free Software Foundation, Inc.
132
675 Mass Ave, Cambridge, MA 02139, USA
134
Everyone is permitted to copy and distribute verbatim copies
135
of this license document, but changing it is not allowed.
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.]
141
@unnumberedsec Preamble
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
231
@unnumberedsec GNU LIBRARY GENERAL PUBLIC LICENSE
232
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
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
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.
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".)
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.
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.
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
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
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:
289
The modified work must itself be a software library.
292
You must cause the files modified to carry prominent notices
293
stating that you changed the files and the date of any change.
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.
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.
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.)
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
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.)
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.
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.
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
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.)
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.
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.
442
Verify that the user has already received a copy of these
443
materials or that you have already sent this user a copy.
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
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
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:
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
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.
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.
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.
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
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.
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.
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
539
This section is intended to make thoroughly clear what is believed to
540
be a consequence of the rest of this License.
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.
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.
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.
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.
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.
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
608
@heading END OF TERMS AND CONDITIONS
611
@center END OF TERMS AND CONDITIONS
615
@unnumberedsec Appendix: How to Apply These Terms to Your New Libraries
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).
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.
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}
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.
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.
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.
647
Also add information on how to contact you by electronic and paper mail.
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:
654
Yoyodyne, Inc., hereby disclaims all copyright interest in the
655
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
657
@var{signature of Ty Coon}, 1 April 1990
658
Ty Coon, President of Vice
661
That's all there is to it!
664
@c ------------------------------------------------------------------------
665
@c Node, Next, Previous, Up
666
@node Introduction, Installing VFlib, Copying, Top
667
@chapter Introduction
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.
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.
685
This document describes the fundamental concepts of VFlib and gives
686
a brief introduction in writing programs using VFlib.
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).
696
The VFlib system consists of two parts:
699
@item A library (@file{libVFlib.a} and/or @file{libVFlib.so})
703
It provides several C functions. Any application software
704
using VFlib must link this library.
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.
713
@item A font database file (@file{vflibcap})
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.
724
Basic concept of VFlib
728
@item Font Classes and Font Drivers
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
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
747
@item A View of VFlib Font From The End-User
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.
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.
764
@item Font Names and Font Searching Mechanism
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).
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
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.
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.
789
@item Obtaining Bitmaps (Glyph)
791
Two interfaces are provided to obtain glyph (bitmaps) of a font.
794
@item High resolution device oriented glyph
795
@cindex High resolution oriented mode
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.
803
@item Low resolution device oriented glyph
804
@cindex Low resolution oriented mode
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.
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
825
VFlib uses GNU autoconf and GNU libtool to compile.
826
According to the following procedure,
827
compile and install VFlib.
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:
837
VFlib is tested with FreeType 1.3.
838
(FreeType 1.0 does not work with current VFlib3.)
840
@item @url{http://www.freetype.org/}
841
@item @url{ftp://ftp.freetype.org/pub/freetype/freetype-1.3.tar.gz}
845
VFlib is tested with T1Lib 1.3.
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/}
853
VFlib is tested with kpathsea 3.2 in web2c-7.2b.
855
@item @url{ftp://ftp.ctan.org/tex-archive/system/web2c/}
863
VFlib is tested on the following platforms:
865
@item FreeBSD 2.2.2 and 3.2 on IBM PC-clones
866
@item Solaris 2.5.1 on Sun SPARC Stations
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.
874
Go into the directory @file{VFlib3-3.6.12}.
877
Run the @command{configure} script.
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.
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.
903
--with-kpathsea-includedir=/usr/local/include \
904
--with-kpathsea-libdir=/usr/local/lib
906
--with-freetype-includedir=/usr/local/include/freetype \
907
--with-freetype-libdir=/usr/local/lib"
909
--with-t1lib-includedir=/usr/local/include \
910
--with-t1lib-libdir=/usr/local/lib [RET]
914
See the @command{configure-site} script;
915
it invokes the @command{configure} script with typical settings shown above.
918
Options for configure script is as follows:
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.
927
@item @t{--disable-shared}
928
Disable to build a shared library version of VFlib.
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.
935
@item @t{--enable-static}
936
Enable to build a shared library version of VFlib.
938
@item @t{--disable-bdf}
939
VFlib is built without the BDF font driver.
941
@item @t{--disable-pcf}
942
VFlib is built without the PCF font driver.
944
@item @t{--disable-hbf}
945
VFlib is built without the HBF font driver.
947
@item @t{--disable-gf}
948
VFlib is built without the @TeX{} GF font driver.
950
@item @t{--disable-pk}
951
VFlib is built without the @TeX{} PK font driver.
953
@item @t{--disable-tfm}
954
VFlib is built without the @TeX{} TFM font driver.
956
@item @t{--disable-jtex}
957
VFlib is built without the Japanese @TeX{} Kanji font driver.
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.
963
@item @t{--disable-zeit}
964
VFlib is built without the Zeit (Syotai Kurabu) font driver.
966
@item @t{--disable-jg}
967
VFlib is built without the JG font driver.
969
@item @t{--disable-ekanji}
970
VFlib is built without the eKanji font driver.
972
@item @t{--disable-comic}
973
VFlib is built without the Japanese comic font driver.
975
@item @t{--disable-try}
976
VFlib is built without the Try font driver.
978
@item @t{--disable-mojikmap}
979
VFlib is built without the Mojikyo font mapping driver.
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}.)
987
@item @t{--with-freetype-includedir=@var{DIR}}
988
FreeType include files are in @var{DIR}.
990
@item @t{--with-freetype-libdir=@var{DIR}}
991
FreeType library files are in @var{DIR}.
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}.)
999
@item @t{--with-t1lib-includedir=@var{DIR}}
1000
T1Lib include files are in @var{DIR}.
1002
@item @t{--with-t1lib-libdir=@var{DIR}}
1003
T1lib library files are in @var{DIR}.
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}.)
1011
@item @t{--with-kpathsea-includedir=@var{DIR}}
1012
Kpathsea include files are in @var{DIR}.
1014
@item @t{--with-kpathsea-libdir=@var{DIR}}
1015
Kpathsea library files are in @var{DIR}.
1020
Run @command{make} to compile VFlib.
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.)
1032
# make install [RET]
1036
If installation is successful, the following has been created:
1039
@item @file{libVFlib.a} and/or @file{libVFlib.so}
1042
These are the library files and linked with application programs.
1044
@item @command{vflserver}, @command{vflmkcaptex}, @command{vflx11}, @command{vfltest}, etc.
1045
--- A VFlib server and test programs on X11
1048
By @command{vflserver}, the functionality of VFlib is available
1049
via network if @command{vflserver} is registered in @file{/etc/inetd.conf}.
1051
interactively by invocation from shell. Interactive use of
1052
VFlib is useful for testing or debugging purposes.
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.
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.
1063
@command{vfltest} is a test program that displays characters
1064
on terminal by ascii-art form.
1069
Installation directories are as follows:
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.
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.
1081
Under this directory, there are following subdirectories:
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.
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.
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.
1110
This directory contains several papers on VFlib, written
1111
by Hirotsugu Kakugawa.
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
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}.
1133
@item @file{/usr/local/bin/}
1134
Binary programs such as @command{vflserver}, @command{vflx11}, etc
1137
@item @file{/usr/local/include/}
1138
Include file for C programs
1142
@item @file{/usr/local/lib/}
1143
VFlib library files such as @file{libVFlib.a}, @file{libVFlib.so}
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.
1153
@c ------------------------------------------------------------------------
1154
@c Node, Next, Previous, Up
1155
@node Programming with VFlib, Writing a vflibcap, Installing VFlib, Top
1156
@chapter Programming with VFlib
1161
* Functions and variables::
1162
* Building an application software with VFlib::
1163
* A simple example::
1167
@c Node, Next, Previous, Up
1168
@node Data types, Functions and variables, , Programming with VFlib
1180
@node bitmap type, metric1 type, , Data types
1181
@subsection bitmap type
1183
A bitmap object is a structure of the following:
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;
1193
typedef struct vf_s_bitmap* VF_BITMAP;
1195
@tindex struct vf_s_bitmap
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.)
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.
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.
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
1233
@c Node, Next, Previous, Up
1234
@node metric1 type, metric2 type, bitmap type, Data types
1235
@subsection metric1 type
1237
A metric1 object is a structure of the following:
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 */
1245
typedef struct vf_s_metric1* VF_METRIC1;
1247
@tindex struct vf_s_metric1
1251
The members of this structure are the same as the members of a
1252
bitmap object but the members' unit is point.
1255
@c Node, Next, Previous
1256
@node metric2 type, outline type, metric1 type, Data types
1257
@subsection metric2 type
1259
A metric2 object is a structure of the following:
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 */
1267
typedef struct vf_s_metric2* VF_METRIC2;
1269
@tindex struct vf_s_metric2
1272
The members of this structure are the same as the members of a
1273
bitmap object, and the members' unit is pixel also.
1277
@node outline type, , metric2 type, Data types
1278
@subsection outline type
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()}.
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.
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.)
1301
Outline data is defined as follows:
1305
typedef long VF_OUTLINE_ELEM;
1306
typedef VF_OUTLINE_ELEM *VF_OUTLINE;
1308
@tindex VF_OUTLINE_ELEM
1311
According to CPU architecture, @code{VF_OUTLINE_ELEM}
1312
is defined as @code{int} if size of @code{long} is 8.
1315
typedef long VF_OUTLINE_ELEM;
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.
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.
1330
@node Functions and variables, Building an application software with VFlib, Data types, Programming with VFlib
1331
@section Functions and variables
1342
@b{Font open and close}
1347
@b{Bitmaps and metrics}
1355
* VF_OutlineToBitmap()::
1357
@b{Font information}
1358
* VF_GetFontBoundingBox1()::
1359
* VF_GetFontBoundingBox2()::
1362
@b{Bitmap operations}
1364
* VF_MakeScaledBitmap()::
1365
* VF_ReflectedBitmap()::
1366
* VF_RotatedBitmap()::
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()::
1377
@b{Releasing data objects}
1379
* VF_FreeMetric1()::
1380
* VF_FreeMetric2()::
1382
@b{Installing a font driver}
1383
* VF_InstallFontDriver()::
1387
@c Node, Next, Previous, Up
1388
@node VF_Init(), vf_error, , Functions and variables
1389
@subsection @code{VF_Init()}
1392
int VF_Init(char* @var{vflibcap}, char* @var{variable_list})
1398
Initialization of VFlib.
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.
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
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.
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}.
1431
If initialization succeeds, a non-negative integer
1432
is returned. If initialization fails, a negative integer is returned.
1436
@c Node, Next, Previous, Up
1437
@node vf_error, VF_ClearError(), VF_Init(), Functions and variables
1438
@subsection @code{vf_error}
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.
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
1458
void VF_ClearError(void)
1463
Clear the error code variable of VFlib.
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
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})
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.
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.
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.
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.
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
1516
int VF_OpenFont2(char* @var{font_name},
1517
int @var{pixel_size}, double @var{mag_x}, double @var{mag_y})
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.
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.
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.
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
1554
int VF_CloseFont(int @var{font_id})
1562
The argument @var{font_id} is a font id to be closed.
1565
A non-negative integer is returned on success.
1566
A negative integer is returned on failure.
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
1576
VF_BITMAP VF_GetBitmap1(int @var{font_id}, long @var{code_point},
1577
double @var{mag_x}, double @var{mag_y})
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.
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
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.
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
1614
VF_BITMAP VF_GetBitmap2(int @var{font_id}, long @var{code_point},
1615
double @var{mag_x}, double @var{mag_y})
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.
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
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.
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
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})
1659
Obtain font metrics of a given font and code point.
1662
Same arguments as of @code{VF_GetBitmap1()}.
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()}.
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
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})
1687
Obtain font metrics of a given font and code point.
1690
Same arguments as of @code{VF_GetBitmap2()}.
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()}.
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
1708
VF_OUTLINE VF_GetOutline(int @var{font_id}, long @var{code_point},
1709
double @var{mag_x}, double @var{mag_y})
1714
Obtain outline data from a given font and code point.
1717
Same as @code{VF_GetBitmap1()}.
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.)
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
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})
1747
Obtain a bitmap from outline data.
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).
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()}.
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
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})
1781
Obtain font bounding box information of a given font.
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.
1798
The argument @var{mag_x} and @var{mag_y} are maginification factor
1799
to be scaled for a given font @var{font_id}.
1802
If font bounding information is successfully obtained,
1803
a non-negative integer is returned; otherwize, negative integer is
1806
Units of bounding box information is in point.
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
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})
1823
Same as @code{VF_GetFontBoundingBox1()} except units of
1824
font bounding box parameters are pixel.
1827
@c Node, Next, Previous, Up
1828
@node VF_GetProp(), VF_CopyBitmap(), VF_GetFontBoundingBox2(), Functions and variables
1829
@subsection @code{VF_GetProp()}
1833
char* VF_GetProp(int @var{font_id}, char* @var{prop_name})
1838
Obtain a property of given font. (This function
1839
is font class dependent. You must be very careful to use it!)
1842
The argument @var{font_id} specifies a font from which to
1843
obtain a property. @var{property_name} specifies the property name.
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.
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
1860
VF_BITMAP VF_CopyBitmap(VF_BITMAP @var{bm})
1865
Make a copy of a bitmap object.
1868
The argument @var{bm} is a pointer to a bitmap object to be copied.
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.
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
1886
VF_BITMAP VF_MakeScaledBitmap(VF_BITMAP @var{bm},
1887
double @var{mag_x}, double @var{mag_y})
1892
Make an enlarged or shrinked bitmap.
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
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}).
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.
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
1920
VF_BITMAP VF_ReflectedBitmap(VF_BITMAP @var{bm},
1921
int @var{refl_x}, double @var{refl_y})
1926
Make a bitmap with horizontally and/or vertically reflected image.
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()}.
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.
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
1952
VF_BITMAP VF_RotatedBitmap(VF_BITMAP @var{bm}, int @var{angle})
1957
Make a bitmap image with rotated image.
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:
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.
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.
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
1988
@code{VF_RotatedBitmap(@var{bm}, VF_BM_ROTATE_180)}
1990
@code{VF_ReflectedBitmap(@var{bm}, 1, 1)}
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
2001
void VF_DumpBitmap(VF_BITMAP @var{bm})
2006
Print a bitmap in ASCII-art-style to stdout.
2009
The argument @var{bm} specifies a bitmap to be displayed.
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
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})
2031
Print a bitmap @var{bm} in PBM ASCII format to a file stream @var{fp}.
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}.
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}
2045
Possible values for @var{position_x} is
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.
2057
Possible values for @var{position_y} is
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.
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.
2074
If the argument @var{reverse} is not 0, black and white in an output image
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.)
2080
Arguments @var{prog} and @var{title} are used to emmbed program name
2081
and title in an image file.
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
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})
2103
Print a bitmap @var{bm} in PGM ASCII format to a file stream @var{fp}.
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).
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
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})
2128
Print a bitmap @var{bm} in PGM Raw format to a file stream @var{fp}.
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).
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
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})
2154
Print a bitmap @var{bm} in EPS (Encapsulated PostScript)
2155
format to a file stream @var{fp}.
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.
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
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})
2180
Print a bitmap @var{bm} in ASCII art format to a file stream @var{fp}.
2183
Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
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
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})
2203
Print a bitmap @var{bm} in ASCII art format to a file stream @var{fp}.
2204
Image is rotated in clockwise, 90 degree.
2207
Arguments are the same as that of @code{VF_ImageOut_PGMAscii()}.
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
2217
void VF_FreeBitmap(VF_BITMAP @var{bm})
2222
Release a bitmap object.
2225
The argument @var{bm} is a pointer to a bitmap object to be released.
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
2236
void VF_FreeMetric1(VF_METRIC1 @var{metric})
2241
Release a metric1 object.
2244
The argument @var{metric} is a pointer to a metric1 object.
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
2254
void VF_FreeMetric2(VF_METRIC2 @var{metric})
2259
Release a metric2 object.
2262
The argument @var{metric} is a pointer to a metric2 object.
2267
@c Node, Next, Previous, Up
2268
@node VF_InstallFontDriver(), , VF_FreeMetric2(), Functions and variables
2269
@subsection @code{VF_InstallFontDriver()}
2270
@findex VF_InstallFontDriver
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}));
2282
Install a font driver.
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).
2302
If successful, a non-negative integer is returned.
2303
A negative integer is returned if the installation of the
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
2313
An application software that use VFlib must include
2317
@cindex VFlib-3\_6.h
2322
Typically, this file is installed @file{/usr/local/include/} directory.
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.)
2332
I recommend shared library versions for these optional libraries
2333
if you built a shared library version of VFlib.
2337
#include <VFlib-3_6.h>
2340
VFlib must be initialized before it is used.
2343
char* vflibcap = "vflibcap";
2344
char* params = "TeX_DPI=300, KPATHSEA_MODE=cx";
2346
if (VF_Init(vflibcap, params) < 0)@{
2347
fprintf(stderr, "Initializing VFlib: failed\n");
2352
Following program fragment opens a font, obtains a bitmap, and
2353
print obtained bitmap.
2359
if ((fid = VF_OpenFont2("timR24.pcf", -1, 1.0, 1.0)) < 0)@{
2360
fprintf(stderr, "Opening font: failed\n");
2364
bm = VF_GetBitmap2(fid, 0x67, 1.0, 1.0);
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
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.
2382
* vflbanner.c - a banner by VFlib
2383
* by Hirotsugu Kakugawa
2388
* Copyright (C) 1998 Hirotsugu Kakugawa.
2389
* All rights reserved.
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.
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.
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.
2410
#include "VFlib-3_6.h"
2412
#define DEFAULT_FONT "timR18.pcf"
2419
void vflbanner(FILE *fp);
2423
main(int argc, char **argv)
2426
fontname = DEFAULT_FONT;
2431
&& ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0)))@{
2434
@} else if ((argc >= 2) && (strcmp(argv[0], "-v") == 0))@{
2438
@} else if ((argc >= 2) && (strcmp(argv[0], "-f") == 0))@{
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");
2467
VF_BITMAP bm, page_bm;
2468
struct vf_s_bitmaplist PageBuff;
2470
if (VF_Init(vflibcap, NULL) < 0)@{
2471
printf("VFlib initialization 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;
2480
printf(" - Error code %d\n", vf_error); break;
2486
if ((fid = VF_OpenFont1(fontname, -1, -1, -1, 1, 1)) < 0)
2489
VF_BitmapListInit(&PageBuff);
2492
while ((ch = getc(fp)) != EOF)@{
2495
if ((bm = VF_GetBitmap1(fid, (long)ch, 1, 1)) == NULL)
2497
VF_BitmapListPut(&PageBuff, bm, pos_x, pos_y);
2498
pos_x = pos_x + bm->mv_x;
2501
page_bm = VF_BitmapListCompose(&PageBuff);
2502
VF_DumpBitmap(page_bm);
2503
VF_BitmapListFinish(&PageBuff);
2504
VF_FreeBitmap(page_bm);
2513
By the following commands is used to comple the program.
2516
% gcc -c `VFlib3-config --cflags` vflbanner.c
2517
% gcc -o vflbanner vflbanner.o `VFlib3-config --libs`
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}),
2525
Run @command{VFlib3-config} with @option{--help} option for detail.
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
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::
2545
@b{Global definitions}
2552
* TrueType font class::
2553
* Type1 font class::
2556
* eKanji font class::
2557
* TeX default and TeX font mapping font class::
2563
@b{Font drivers that map to another fonts}
2564
* ASCII Japanese TeX Kanji font class::
2565
* Japanese comic font class::
2567
* Mojikyo font mapping class::
2569
@b{Examples of vflibcaps}
2570
* Example vflibcap 1::
2571
* Example vflibcap 2::
2572
* Example vflibcap 3::
2576
@c Node, Next, Previous, Up
2577
@node Introduction to vflibcap, Syntax of vflibcap, , Writing a vflibcap
2578
@section Introduction to vflibcap
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.
2587
Each VFlib fonts have its own parameters listed below:
2591
@item Point size, and
2592
@item Resolution of target device.
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.
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
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
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.
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:
2627
@item String Form 1:
2628
Sequence of characters enclosed by double quotations.
2634
"He said \"Thanks!\"."
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.
2646
He\ said\ \"Thanks!\".
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.
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))}.
2660
A vflibcap must be a sequence of s-expression of the following forms:
2663
@item @code{(define-default @var{FONT-CLASS} @var{CAPABILITY-DEF} ... )}
2664
This expression defines a default values for a font class.
2666
@item @code{(define-font @var{NAME} @var{CAPABILITY-DEF} ... )}
2667
This expression defines a font.
2669
@item @code{(define-macro @var{NAME} @var{CAPABILITY-DEF} ... )}
2670
This expression defines a macro @var{NAME}.
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.
2680
This is an example of vflibcap file.
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"))
2692
(filename-extensions ".bdf")
2694
"/usr/X11R6/lib/X11/fonts//" "/usr/local/share/fonts/X11//")
2695
(compression-extensions ".gz" ".Z"))
2697
(define-font timR24 ; times roman 24
2699
(font-file "timR24.bdf"))
2701
(define-font timR18 ; times roman 18
2703
(font-file "timR18.bdf"))
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
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.
2719
(font-file "timR18.bdf"))
2722
is a font definition using a macro @code{MACRO-NAME}.
2723
Suppose a macro @code{MACRO-NAME} is defined as follows.
2726
(define-macro MACRO-NAME
2731
Then, the font definition for @code{timR24} is the same as follow.
2737
(font-file "timR18.bdf"))
2741
The rule of macr expand is as following procedure.
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.
2752
Macro expand is done recursively.
2753
Thus, a macro can be used in another macro.
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
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{//}.
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,
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.
2780
Currently, pk, gf, tfm, vf, truetype, and type1 font classes suport
2781
searcing files by kpathsea.
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
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}.
2799
The following is an example of FDB file.
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
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}.
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.
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.
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.
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
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.
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.
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
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}.
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
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.
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.
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}.
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.)
2889
@c Node, Next, Previous, Up
2890
@node VFlib defaults, BDF font class, Variables in vflibcap, Writing a vflibcap
2891
@section VFlib defaults
2893
To specify global behavior of VFlib, (virtual) font class
2894
@code{VFlib} is defined.
2896
The following capability are defined.
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.
2903
example: @code{(implicit-font-classes "bdf" "pcf" "gf")}
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.
2913
example: @code{(extension-hints (".pcf" pcf) (".bdf" bdf) ("gf" gf))}
2915
@item @code{variable-values} (optional)
2916
--- A list of pairs of a name of vflibcap variable and its default value.
2918
example: @code{(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE" "cx") (v ("p1" "v1")}
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
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.
2931
example: @code{(uncompression-programs (".Z" "zcat") (".gz" "gzip -cd")}
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}.
2938
example: @code{(code-conversion-files "iso8859-1_unicode.ccv".ccv")}
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"}.
2944
example: @code{(use-kpathsea "Yes")}
2946
@item @code{kpathsea-mode} (optional)
2947
--- A device mode name for kpathsea library.
2949
example: @code{(kpathsea-mode "cx")}
2951
@item @code{kpathsea-dpi} (optional)
2952
--- Device resolution (in dpi) of a device mode for kpathsea library.
2954
example: @code{(kpathsea-mode 300)}
2956
@item @code{kpathsea-program-name} (optional)
2957
--- An application program name for kpathsea library.
2959
example: @code{(kpathsea-mode "xgdvi")}
2965
@c Node, Next, Previous, Up
2966
@node BDF font class, PCF font class, VFlib defaults, Writing a vflibcap
2967
@section BDF font class
2969
The BDF format is a bitmap font format encoded in human-readable, platform
2970
independent format for distributing X Window fonts.
2972
This font class supports compressed font files and implicit fonts.
2976
@b{Font class name}: @code{bdf}
2977
@cindex BDF font class
2981
@b{Capabilities for font class default:}
2985
@item @code{font-directories} (optional)
2986
--- A list of font directories for searching font files.
2987
Recursive searching of font files is support.
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.)
2997
example: @code{(compression-extensions ".gz" ".Z")}
2999
@item @code{dpi} (optional)
3000
--- Defualt device resolution.
3001
Default horizontal and vertical resolutions will be the same value.
3003
example: @code{(dpi 300)}
3005
@item @code{dpi-x} (optional)
3006
--- Default horizontal device resolution.
3008
example: @code{(dpi-x 300)}
3010
@item @code{dpi-y} (optional)
3011
--- Default vertical device resolution.
3013
example: @code{(dpi-y 300)}
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.
3019
example: @code{(aspect-ratio 0.8)}
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()}
3025
example: @code{(properties ("PROP-1" "value-1") ("PROP-2" "value-2"))}
3027
@item @code{variable-values} (optional)
3028
--- A list of pairs of a vflibcap variable name and its default value.
3030
example: @code{(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE" "cx") ("TeX_KPATHSEA_PROGRAM" "/usr/X11R6/xldvi"))}
3036
@b{Capabilities for font definition:}
3041
@item @code{font-class} (essential)
3042
--- A font class name. This value must be @code{bdf}.
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.
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.
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
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.
3065
example: @code{(font-file "timI24.bdf" "timR24.bdf")}
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()}.
3074
example: @code{(point-size 24.0)}
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()}.
3083
example: @code{(pixel-size 24)}
3085
@item @code{magnification} (optional)
3086
--- magnification factor.
3087
The font is magnified by this factor.
3089
example: @code{(magnification 1.20)}
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.
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.
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.
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.
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.
3117
(define-font iso8859_5-font
3119
(character-set "ISO8859-5") (encoding "ISO")
3120
(font-character-set "KOI8-R") (font-encoding "KOI8-R")
3121
(font-file "koi8x13.pcf"))
3124
Code conversion is done by a subsystem named CCV.
3125
See @ref{Code conversion system} for detail.
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
3137
@b{Font class name:} @code{pcf}
3140
Other specification is the same as BDF font class
3141
except font class name is @code{pcf}.
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
3151
@b{Font class name:} @code{hbf}
3154
Other specification is the same as BDF font class
3155
except font class name is @code{hbf}.
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
3164
TrueType is a vector font font format.
3165
This font class supports implicit fonts but does not support
3166
compressed font files.
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.
3174
@b{Font class name:} @code{truetype}
3178
@b{Capabilities for font class default:}
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.
3188
@item @code{point-size} (optional)
3190
@item @code{pixel-size} (optional)
3192
@item @code{dpi} (optional)
3194
@item @code{dpi-x} (optional)
3196
@item @code{dpi-y} (optional)
3198
@item @code{aspect-ratio} (optional)
3200
@c @item @code{writing-direction} (optional)
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.
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.
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
3222
Value of this capability is one of strings below:
3226
@item @code{macintosh}, @code{mac}
3228
@item @code{ascii}, @code{iso}
3230
@item @code{microsoft}, @code{windows}, @code{ms}
3232
@item @code{any}, @code{?}, @code{*}
3236
Default value for this capability is Microsoft platform.
3238
example: @code{(platform-id "microsoft")}
3240
@item @code{encoding-id} (optional)
3241
--- Together with platform id, this capability is used to specify
3244
When ISO platform is selected by the @code{encoding-id}
3246
value of this @code{encoding-id} capability is one of strings below:
3252
@item @code{iso10464}
3254
@item @code{iso8859-1}
3256
@item @code{any}, @code{?}, @code{*}
3261
When Apple platform is selected by the @code{encoding-id}
3263
value of this @code{encoding-id} capability is one of strings below:
3267
@item @code{unicode1.1}
3268
Unicode 1.1 encoding.
3269
@item @code{unicode2.0}
3270
Unicode 2.0 encoding.
3271
@item @code{iso10464}
3273
@item @code{any}, @code{?}, @code{*}
3278
When Microsoft platform is selected by the @code{encoding-id}
3280
value of this @code{encoding-id} capability is one of strings below:
3285
@item @code{unicode}
3287
@item @code{shift-jis}, @code{sjis}, @code{ms-kanji}
3292
@item @code{wansung}
3294
@item @code{any}, @code{?}, @code{*}
3299
When Macintosh platform is selected by the @code{encoding-id}
3301
value of this @code{encoding-id} capability is one of strings below:
3305
@item @code{japanese}
3306
@item @code{traditional-chinese}
3311
@item @code{russian}
3312
@item @code{any}, @code{?}, @code{*}
3316
example: @code{(encoding-id "any")}
3318
@item @code{properties} (optional)
3320
@item @code{variable-values} (optional)
3327
@b{Capabilities for font definition:}
3331
@item @code{font-class} (essential)
3332
This value must be "truetype".
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.
3341
To search a font file by kpathsea,
3342
use @code{TEXMF} for a directory name.
3344
@item @code{font-file} (optional)
3346
@item @code{point-size} (optional)
3348
@item @code{pixel-size} (optional)
3350
@item @code{dpi} (optional)
3352
@item @code{dpi-x} (optional)
3354
@item @code{dpi-y} (optional)
3356
@item @code{magnification} (optional)
3358
@item @code{aspect-ratio} (optional)
3360
@c @item @code{writing-direction} (optional)
3362
@item @code{hinting} (optional)
3364
@item @code{font-number} (optional)
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.
3370
example @code{(encoding-force "unicode")}
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}.
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.
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}
3393
@item @code{properties} (optional)
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.
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.)
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
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.
3422
This Type1 font driver uses T1Lib library version 1.0 or later
3423
developed by Rainer Menzner.
3425
@url{http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib/t1lib.html}
3428
Be careful, VFlib does not work with T1Lib 0.7.
3429
Obtain and install T1Lib 1.0 or later.
3431
Currently, this font driver supports only 8-bit encoded fonts,
3432
i.e., it does not support for fonts of Japanese Kanji characters.
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,
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.
3450
@b{Font class name:} @code{type1}
3454
@b{Capabilities for font class default:}
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.
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.
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.
3478
By default, directories
3479
@code{/usr/local/share/VFlib/@var{x.y.z}/t1lib/} and
3480
@code{/usr/local/share/VFlib/site/t1lib/}
3482
Optional directories can be installed by this capability.
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.
3492
@item @code{point-size} (optional)
3494
@item @code{pixel-size} (optional)
3496
@item @code{dpi} (optional)
3498
@item @code{dpi-x} (optional)
3500
@item @code{dpi-y} (optional)
3502
@item @code{aspect-ratio} (optional)
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.
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.
3517
Any messages useful for debugging and above are written to the logfile.
3519
Never use a logfile.
3522
See users manual of T1Lib for detail.
3524
@item @code{properties} (optional)
3526
@item @code{variable-values} (optional)
3531
@b{Capabilities for font definition:}
3535
@item @code{font-class} (essential)
3536
This value must be "type1".
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.
3543
example: @code{(font-file "AvantGarde-Book" "a0100131.pfb")}
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.
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
3557
@item @code{point-size} (optional)
3559
@item @code{pixel-size} (optional)
3561
@item @code{dpi} (optional)
3563
@item @code{dpi-x} (optional)
3565
@item @code{dpi-y} (optional)
3567
@item @code{magnification} (optional)
3569
@item @code{aspect-ratio} (optional)
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.
3576
example: @code{(slant-factor 0.2)}
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}
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.
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}
3599
@item @code{properties} (optional)
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
3610
This font class supports @i{"Syotai Kurubu"} format;
3611
it is a vector font format for Japanese Kanji characters.
3613
Several free Japanese fonts in this file format are available.
3620
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/umeda-vector/mincho.vf1.gz}
3622
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/umeda-vector/mincho.vf2.gz}
3624
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/umeda-vector-font/mincho.vf1.gz}
3626
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/umeda-vector-font/mincho.vf2.gz}
3631
Watanabe vector fonts
3634
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/watanabe-vector/mincho.vf1.gz}
3636
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/watanabe-vector/mincho.vf2.gz}
3638
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/watanabe-vector-font/mincho.vf1.gz}
3640
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/watanabe-vector-font/mincho.vf2.gz}
3648
@url{ftp://ftp.web.ad.jp/pub/TeX/akiu/fonts/wadalab-vector/}
3650
@url{ftp://ftp.eos.hokudai.ac.jp/pub/TeX/fonts/wadalab-vector-font/}
3652
See also @url{ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/} for Free Japanese Kanji
3653
fonts in Type 1 formats.
3657
This font class does not support compressed font files nor implicit fonts.
3661
@b{Font class name:} @code{zeit}
3665
@b{Capabilities for font class default:}
3669
@item @code{font-directories} (optional)
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.
3676
example: @code{(filename-extensions ".vf" ".VF")}
3678
@item @code{point-size} (optional)
3680
@item @code{pixel-size} (optional)
3682
@item @code{dpi} (optional)
3684
@item @code{dpi-x} (optional)
3686
@item @code{dpi-y} (optional)
3688
@item @code{aspect-ratio} (optional)
3690
@item @code{writing-direction} (optional)
3691
--- Default writing direction.
3692
@code{Horizontal} or @code{vertical}; default is @code{Horizontal}.
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)}.
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.
3705
example: @code{(vector-to-bbx-upper-left 0 0.86)}
3707
@item @code{vector-to-next-ref-point} (optional)
3708
--- Default value of a vector from the reference
3709
point to next reference point.
3711
example: @code{(vector-to-next-ref-point 1.0 0.0)}
3713
@item @code{properties} (optional)
3715
@item @code{variable-values} (optional)
3721
@b{Capabilities for font definition:}
3724
@item @code{font-class} (essential)
3725
--- A font class name.
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.
3735
example: @code{(font-name "mincho")}
3737
@item @code{point-size} (optional)
3739
@item @code{pixel-size} (optional)
3741
@item @code{dpi} (optional)
3743
@item @code{dpi-x} (optional)
3745
@item @code{dpi-y} (optional)
3747
@item @code{magnification} (optional)
3749
@item @code{aspect-ratio} (optional)
3751
@item @code{writing-direction} (optional)
3753
@item @code{vector-to-bbx-upper-left} (optional)
3755
example: @code{(vector-to-bbx-upper-left 0 0.86)}
3757
@item @code{vector-to-next-ref-point} (optional)
3759
example: @code{(vector-to-next-ref-point 1.0 0.0)}
3761
@item @code{properties} (optional)
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
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.
3776
@b{Font class name:} @code{jg}
3780
@b{Capabilities for font class default:}
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.
3790
example: @code{(filename-extensions ".fn" ".FN")}
3793
(Other capabilities are the same as @code{zeit} font class.)
3795
@b{Capability for font definition:}
3797
Capabilities are the same as @code{zeit} font class.
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
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
3811
(This encoding scheme can be changed by setting some capabilities.)
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.
3819
@item Unicode (@file{ekan0010.d24})
3822
@item Kyoto University KangXi (@file{ekan0020.d24})
3825
@item Morohashi DaiKanwa (@file{ekan0030.d24})
3826
@cindex Morohashi DaiKanwa
3828
@item JIS X 0208 (@file{jisx9052.d24})
3834
@b{Font class name:} @code{ekanji}
3837
@b{Capabilities for font class default:}
3840
@item @code{font-directories} (optional)
3842
@item @code{font-dot-size} (optional)
3843
--- Dot size of characters in the font file.
3844
Default value is 24.
3846
example: @code{(font-dot-size 24)}
3848
@item @code{point-size} (optional)
3850
@item @code{pixel-size} (optional)
3852
@item @code{dpi} (optional)
3854
@item @code{dpi-x} (optional)
3856
@item @code{dpi-y} (optional)
3858
@item @code{aspect-ratio} (optional)
3860
@item @code{writing-direction} (optional)
3861
--- Default writing direction.
3862
@code{Horizontal} or @code{vertical}; default is @code{Horizontal}.
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)}.
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.
3875
example: @code{(vector-to-bbx-upper-left 0 0.90)}
3877
@item @code{vector-to-next-ref-point} (optional)
3878
--- Default value of a vector from the reference
3879
point to next reference point.
3881
example: @code{(vector-to-next-ref-point 1.0 0.0)}
3883
@item @code{properties} (optional)
3885
@item @code{variable-values} (optional)
3891
@b{Capability for font definition:}
3894
@item @code{font-class} (essential)
3895
--- A font class name.
3897
@item @code{font-name} (optional)
3898
--- Font file name with extension.
3900
@item @code{font-dot-size} (optional)
3901
--- Dot size of characters in the font file.
3903
@item @code{point-size} (optional)
3905
@item @code{pixel-size} (optional)
3907
@item @code{dpi} (optional)
3909
@item @code{dpi-x} (optional)
3911
@item @code{dpi-y} (optional)
3913
@item @code{magnification} (optional)
3915
@item @code{aspect-ratio} (optional)
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.
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:
3937
No effect, i.e., font encoding is not changed.
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.)
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.
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.
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.)
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}.
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.
3980
@item @code{writing-direction} (optional)
3982
@item @code{vector-to-bbx-upper-left} (optional)
3984
example: @code{(vector-to-bbx-upper-left 0 0.86)}
3986
@item @code{vector-to-next-ref-point} (optional)
3988
example: @code{(vector-to-next-ref-point 1.0 0.0)}
3990
@item @code{properties} (optional)
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
4001
This is a special font class to define common default values
4002
of @TeX{}-related font classes.
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.
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.
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.
4023
@b{Font class name:} @code{TeX}
4027
@b{Capabilities for font class default:}
4032
@item @code{dpi} (optional)
4033
--- Default device resolution for @TeX{}-related fonts.
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
4041
example: @code{(tfm-directories "TEXMF" "/usr/local/share/font/tfm//")}
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"
4048
example: @code{(tfm-filename-extensions "tfm")}
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.
4056
Syntax of this capability is as follows:
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} ...)
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
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
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:
4098
the requested font name without extension and directory parts.
4100
font file resolution part in the extension of the requested font name
4102
file format part in the extension of the requested font name
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.
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}:
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.
4122
A font is opened by the following way.
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.
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.
4138
If mapped fonts are not opened, next rule is checked.
4139
This is repeated for all rules until a mapped font is opened.
4146
((ascii-jtex-kanji "%f.jtex")
4147
"min*" "goth*" "tmin*" "tgoth*")
4148
((type1 "%f.pfb" point-size-from-tfm (magnification-adjustment 1.0))
4150
((pk "%f.%dpk") (gf "%f.%dgf") (tfm "%f.tfm")
4154
For this example, suppose that @code{min10.300pk} is requested to open.
4159
The first rule applies to the requested font since @code{min*} is in the
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.
4167
The second rule applies to the requested font since @code{*} is given in
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.
4175
The second rule applies to the reqiested font since @code{*} is given in
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.
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.
4185
The @code{tfm} driver is invoked to open a mapped name @code{min10.tfm}.
4189
If everything above fails, font open for @code{cmr10.300pk} fails.
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.
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.
4208
As a restriction of fonts of this class,
4209
each font must have a TFM file.
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)
4216
These two capabilities give correct resolution values for PK and GF fonts.
4218
Syntax of these capabilities are as follows:
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} ... )
4226
@var{DEVICE-RESOLUTION} is the resolution of target device in DPI
4227
and @var{FONT-RESOLUTION} is a font resolution value.
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.)
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.
4248
(resolution-accuracy 0.02)
4249
(resolution-corrections
4251
300 329 360 432 518 622 746 896 1075 1290 240 270)
4253
600 657 720 864 1037 1244 1493 1792 2150 2580 480 540))
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.)
4262
@item @code{properties} (optional)
4264
@item @code{variable-values} (optional)
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
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.
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
4289
To enable kpathsea, the value for @code{use-kpathsea} capability
4290
in @code{VFlib} class default must be @code{"Yes"}.
4292
This font class supports compressed font files and implicit fonts.
4296
@b{Font class name:} @code{pk}
4300
@b{Capabilities for font class default:}
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.
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.
4315
example: @code{(filename-extensions "pk")}
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")}
4322
@item @code{point-size} (optional)
4324
@item @code{pixel-size} (optional)
4326
@item @code{dpi} (optional)
4328
@item @code{properties} (optional)
4330
@item @code{variable-values} (optional)
4336
@b{Capabilities for font definition:}
4340
@item @code{font-class} (essential)
4341
--- A font class name.
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.
4348
@item @code{point-size} (optional)
4350
@item @code{pixel-size} (optional)
4352
@item @code{dpi} (optional)
4354
@item @code{properties} (optional)
4356
@item @code{magnification} (optional)
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
4367
@b{Font class name:} @code{gf}
4370
Other capabilities are the same as ones for @code{pk} font class.
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
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.
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.
4394
This font class supports compressed font files and implicit fonts.
4398
@b{Font class name:} @code{tfm}
4402
@b{Capabilities for font class default:}
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.
4412
@item @code{filename-extensions} (optional)
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.
4419
@item @code{point-size} (optional)
4421
@item @code{pixel-size} (optional)
4423
@item @code{dpi} (optional)
4425
@item @code{properties} (optional)
4427
@item @code{variable-values} (optional)
4431
@b{Capabilities for font definition:}
4434
@item @code{font-class} (essential)
4435
--- A font class name.
4437
@item @code{font-file} (optional)
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.
4444
@item @code{point-size} (optional)
4446
@item @code{pixel-size} (optional)
4448
@item @code{dpi} (optional)
4450
@item @code{magnification} (optional)
4452
@item @code{aspect-ratio} (optional)
4454
@item @code{properties} (optional)
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
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.
4475
@b{Font class name:} @code{vf}
4478
@b{Capabilities for font class default:}
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.
4487
@item @code{filename-extensions} (optional)
4488
--- A extension string for virtual font files.
4490
example: @code{(filename-extensions "vf")}
4492
@item @code{tfm-directories} (optional)
4494
@item @code{tfm-filename-extensions} (optional)
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.
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.)
4509
@item @code{open-style} (optional)
4510
--- This capability specifies how subfonts are opened.
4513
--- Boxes are used instead of glyph of subfonts.
4514
Subfonts are not opened.
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
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.
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.
4532
--- Boxes are white, i.e., all pixels are value 0.
4534
--- Boxes are black, i.e., all pixels are value 1.
4537
@item @code{point-size} (optional)
4539
@item @code{pixel-size} (optional)
4541
@item @code{dpi} (optional)
4543
@item @code{properties} (optional)
4545
@item @code{variables} (optional)
4547
@item @code{debug} (optional)
4552
@b{Capabilities for font definition:}
4555
@item @code{font-file} (optional)
4556
--- File name of a virtual font.
4558
@item @code{point-size} (optional)
4560
@item @code{pixel-size} (optional)
4562
@item @code{dpi} (optional)
4564
@item @code{magnification} (optional)
4566
@item @code{properties} (optional)
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
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...)
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.
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.
4603
@b{Font class name:} @code{ascii-jtex}
4606
@b{Capabilities for font class default:}
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.)
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
4626
example: @code{(implicit-font-mapping-suffix ".jtex")}
4628
@item @code{tfm-directories} (optional)
4630
@item @code{tfm-filename-extensions} (optional)
4632
@item @code{properties} (optional)
4634
@item @code{variable-values} (optional)
4638
@b{Capabilities for font definition:}
4641
@item @code{font-class} (essential)
4642
--- A font class name.
4644
@item @code{kanji-font} (optional)
4645
--- Font name for a subfont.
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,
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,
4657
@item @code{kanji-font-magnification} (optional)
4658
--- magnification factor for subfont.
4660
@item @code{tfm-file} (optional)
4661
--- TFM file that defines font metrics of a font.
4663
example: @code{(tfm-file "min10.tfm")}
4665
@item @code{metric-adjustment-file} (optional)
4666
--- a file name for font metric adjustment file.
4668
@item @code{properties} (optional)
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
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.
4684
@b{Font class name:} @code{japanese-comic}
4687
@b{Capabilities for font class default:}
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)
4698
@b{Capabilities for font definition:}
4701
@item @code{font-class} (essential)
4702
--- A font class name.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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
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.
4781
@b{Font class name:} @code{try}
4784
@b{Capabilities for font class default:}
4787
@item @code{properties} (optional)
4788
@item @code{variable-values} (optional)
4792
@b{Capabilities for font definition:}
4795
@item @code{font-class} (essential)
4796
--- A font class name.
4797
This must be @code{try}.
4799
@item @code{font-list} (optional)
4800
--- A list of sub-fonts.
4801
These fonts are VFlib fonts, not a font file names.
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)
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
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.
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.
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.
4842
@b{Font class name:} @code{mojikyo-mapper}
4845
@b{Capabilities for font class default:}
4848
@item @code{properties} (optional)
4849
@item @code{variable-values} (optional)
4853
@b{Capabilities for font definition:}
4856
@item @code{font-class} (essential)
4857
--- A font class name.
4858
This must be @code{mojikyo-mapper}.
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.
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}.
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}.
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,
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,
4885
The second @code{%d} in @code{mo%dm%02d.pfb} is a minor font number,
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.
4895
@item @code{truetype-subfont-encoding} (optional)
4896
This capability has effect only when @code{truetype} division scheme
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).
4906
Default value is @code{unicode}, which is the same as the
4907
the Mojikyo font files in TrueType format.
4909
@item @code{properties} (optional)
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
4920
This example vflibcap is for general use.
4921
@c vflibcaps/vflibcaps (sniped)
4924
;; -----------------------------------------------------------------
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)
4936
;; uncompression programs
4937
(uncompression-programs (".Z" "zcat") (".gz" "gzip -cd"))
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"))
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)
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"))
4964
;; -----------------------------------------------------------------
4965
;; BDF Font Class Default
4966
;; -----------------------------------------------------------------
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")) )
4979
;; -----------------------------------------------------------------
4980
;; PCF Font Class Default
4981
;; -----------------------------------------------------------------
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")) )
4999
;; -----------------------------------------------------------------
5000
;; HBF Font Class Default
5001
;; -----------------------------------------------------------------
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")) )
5010
;; -----------------------------------------------------------------
5011
;; TrueType Font Class Default
5012
;; -----------------------------------------------------------------
5013
(define-default truetype
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)
5025
;; properties for all fonts of this font class
5026
(properties ("FONT_CLASS" "TrueType")) )
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/")
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"
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")
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") ))
5055
;; -----------------------------------------------------------------
5056
;; JG Font Class Default
5057
;; -----------------------------------------------------------------
5059
;; filename extensions ("fn" for "zkyo0by.fn@{0,1,2@}")
5060
(filename-extensions ".fn")
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")))
5068
;; -----------------------------------------------------------------
5069
;; TeX-related Font Class Default and TeX Font Mapper
5070
;; -----------------------------------------------------------------
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
5079
((ascii-jtex-kanji "%f.jtex") "min*" "goth*" "tmin*" "tgoth*")
5080
((type1 "%f.pfb" point-size-from-tfm (magnification-adjustment 1.0))
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
5089
240 263 288 312 346 415 498 597)
5091
300 329 360 432 518 622 746 896 1075 1290 240 270)
5093
400 438 480 576 691 829 995 1194 1433 1720 320 360)
5095
600 657 720 864 1037 1244 1493 1792 2150 2580 480 540))
5096
;; default device resolution
5099
;; -----------------------------------------------------------------
5100
;; TeX GF Font Class Default
5101
;; -----------------------------------------------------------------
5104
(font-directories "TEXMF"
5105
"/usr/local/TeX/gf//")
5106
;; properties for all fonts of this font class
5107
(properties ("FONT_CLASS" "GF")) )
5109
;; -----------------------------------------------------------------
5110
;; TeX PK Font Class Default
5111
;; -----------------------------------------------------------------
5114
(font-directories "TEXMF"
5115
"/usr/local/TeX/pk//")
5116
;; properties for all fonts of this font class
5117
(properties ("FONT_CLASS" "PK")) )
5119
;; -----------------------------------------------------------------
5120
;; TeX TFM Font Class Default
5121
;; -----------------------------------------------------------------
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")) )
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"))
5143
;; -----------------------------------------------------------------
5144
;; Japanese Comic Font Class Default
5145
;; -----------------------------------------------------------------
5146
(define-default japanese-comic
5147
;; debugging flags ('*' selects all)
5149
;; properties for all fonts of this font class
5150
(properties ("FONT_CLASS" "JAPANESE-COMIC")
5151
("CHARSET_REGISTRY" "jisx0208.1983")
5152
("CHARSET_ENCODING" "0")))
5155
;; -----------------------------------------------------------------
5156
;; sample font definitions for Japanese TeX
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"))
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)
5205
;; -----------------------------------------------------------------
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
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}.
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.
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.)
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.
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})},
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
5244
@c vflibcaps/vflibcap-tex (sniped)
5246
;; -----------------------------------------------------------------
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"))
5270
;; -----------------------------------------------------------------
5271
;; TeX-related Font Class Default and TeX Font Mapper
5272
;; -----------------------------------------------------------------
5274
(tfm-directories "TEXMF")
5275
(tfm-filename-extensions ".tfm")
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
5283
240 263 288 312 346 415 498 597)
5285
300 329 360 432 518 622 746 896 1075 1290 240 270)
5287
400 438 480 576 691 829 995 1194 1433 1720 320 360)
5289
600 657 720 864 1037 1244 1493 1792 2150 2580 480 540))
5292
;; -----------------------------------------------------------------
5293
;; GF Font Class Default
5294
;; -----------------------------------------------------------------
5296
(font-directories "TEXMF"))
5298
;; -----------------------------------------------------------------
5299
;; PK Font Class Default
5300
;; -----------------------------------------------------------------
5302
(font-directories "TEXMF"))
5304
;; -----------------------------------------------------------------
5305
;; VF Font Class Default
5306
;; -----------------------------------------------------------------
5308
(font-directories "TEXMF")
5310
((type1 "%f.pfb" point-size-from-tfm) *) )
5311
(open-style "try") ;; "none", "try", or "require"
5312
(glyph-style "fill")) ;; "fill", or "empty"
5314
;; -----------------------------------------------------------------
5315
;; TFM Font Class Default
5316
;; -----------------------------------------------------------------
5318
(glyph-style "fill"))
5320
;; -----------------------------------------------------------------
5321
;; ASCII-JTeX Kanji fonts
5322
;; -----------------------------------------------------------------
5323
(define-default ascii-jtex-kanji
5324
(tfm-directories "TEXMF")
5325
(implicit-font-mapping-suffix ".jtex"))
5327
;; -----------------------------------------------------------------
5328
;; Type1 Font Class Default
5329
;; -----------------------------------------------------------------
5330
(define-default type1
5331
(font-directories "TEXMF")
5332
(afm-directories "TEXMF")
5336
;; -----------------------------------------------------------------
5337
;; TrueType Font Class Default
5338
;; -----------------------------------------------------------------
5339
(define-default truetype
5340
(font-directories "TEXMF")
5341
(platform-id "microsoft")
5344
;; -----------------------------------------------------------------
5345
;; PCF Font Class Default
5346
;; -----------------------------------------------------------------
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")
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"))
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"))
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
;; -----------------------------------------------------------------
5411
@c Node, Next, Previous, Up
5412
@node Example vflibcap 3, , Example vflibcap 2, Writing a vflibcap
5413
@section Example vflibcap 3
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
5420
@c vflibcaps/vflibca-tex-pk
5422
;; -----------------------------------------------------------------
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))
5437
;; -----------------------------------------------------------------
5438
;; TeX-related Font Class Default and TeX Font Mapper
5439
;; -----------------------------------------------------------------
5441
(tfm-directories "TEXMF"
5442
"/usr/local/lib/jtex/fonts"
5443
"/usr/local/lib/tex/fonts")
5444
(tfm-filename-extensions ".tfm")
5447
((tfm "%f.%dtfm") *))
5448
(resolution-accuracy 0.02)
5449
(resolution-corrections
5451
240 263 288 312 346 415 498 597)
5453
300 329 360 432 518 622 746 896 1075 1290 240 270)
5455
400 438 480 576 691 829 995 1194 1433 1720 320 360)
5457
600 657 720 864 1037 1244 1493 1792 2150 2580 480 540))
5460
;; -----------------------------------------------------------------
5461
;; PK Font Class Default
5462
;; -----------------------------------------------------------------
5464
(font-directories "TEXMF"))
5466
;; -----------------------------------------------------------------
5467
;; TFM Font Class Default
5468
;; -----------------------------------------------------------------
5470
(glyph-style "fill"))
5472
;; -----------------------------------------------------------------
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
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.
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.
5495
The following Unix environment variables are used
5496
to print debugging messages.
5499
@item @code{VFLIB_DEBUG_FONT_OPEN}
5500
--- If this environment variable is defined,
5501
the processes of font opens are printed.
5503
@item @code{VFLIB_DEBUG_FONT_SEARCH}
5504
--- If this variable is defined,
5505
the processes of font opens are printed
5507
@item @code{VFLIB_DEBUG_VFLIBCAP}
5508
--- If this variable is defined,
5509
the process of reading of vflibcap file is printed.
5511
@item @code{VFLIB_DEBUG_PARAMETERS}
5512
--- If this variable is defined,
5514
how parameters (variables) in vflibcap file are substituted.
5516
@item @code{VFLIB_DEBUG_CCV}
5517
--- If this variable is defined,
5518
the process of reading CCV files is printed.
5520
@item @code{VFLIB_DEBUG_CCV_MAPPING}
5521
--- If this variable is defined,
5522
encoding conversions by CCV are printed.
5530
@c ------------------------------------------------------------------------
5531
@c Node, Next, Previous, Up
5532
@node Code conversion system, Utility programs, Debugging a vflibcap, Top
5533
@chapter Code conversion system
5536
@cindex code conversion system
5537
@cindex code-conversion-files
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.
5548
Conversion rule is given by one of the following two methods
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.
5560
@section How CCV works
5562
Each conversion rule has the following information.
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...
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.
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".)
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.
5594
For example, a CCV file @t{iso8859-1_unicode.ccv} has the following
5595
charset/encoding names:
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}
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.)
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.
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.
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)
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()}.
5635
@section The internal (hardcoded) CCV functions
5636
VFlib has several hardcoded CCV functions.
5637
Followings CCV functions are implemented.
5641
@item from ISO-2022 (@code{ISO2022}) to Shift JIS (@code{SJIS})
5643
@item from Shift JIS (@code{SJIS}) to ISO 2022 (@code{ISO2022})
5645
@item from EUC (@code{EUC}) to ISO 2022 (@code{ISO2022})
5647
@item from Row-Cell (@code{Row-Cell}) to ISO 2022 (@code{ISO2022})
5649
@item from ISO-2022 (@code{ISO2022}) to Row-Cell (@code{Row-Cell})
5651
@item from ISO-2022 (@code{ISO2022}) to WanSung (@code{WanSung})
5653
@item from Row-Cell (@code{Row-Cell}) to WanSung (@code{WanSung})
5655
@item from ISO-2022 (@code{ISO2022}) to Sequential Numbering
5656
(@code{Sequential2-0} and @code{Sequential2-1})
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.
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.
5677
All of these are implemented simple arithmetic and
5678
large conversion tables are not necessary in memory.
5681
@section The syntax of CCV files
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'.
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
5697
@item (table-type @var{type})
5698
@var{type} must be one of the following:
5701
@item @code{random-arrays}
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} ...)
5713
Let @var{c} be a code point of a character to be converted
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.
5723
@var{c1max}, @var{c2max} and @var{nblocks} are used
5724
internally to determine the necessary memory area to load the table.
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.
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.
5742
@section Example of a CCV file 1
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
5748
This file is distributed with VFlib and installed
5749
by the name @code{iso8859-1_unicode.ccv}.
5751
This file is a table indexed by code points of ISO 8859-1;
5752
contents of table entries are Unicode code points.
5755
@c iso8859-1_unicode.ccv
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)
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.
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 )
5806
@section Example of a CCV file 2
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}.
5813
This file is an example of CCV files
5814
that have @code{random-arrays} for @code{table-type} directive.
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.
5833
; 0x12121 ... 0x1217e
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
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
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
5876
@var{... it's very long, snip, snip, snip ...}
5878
; 0xe6621 ... 0xe667e
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
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
5911
@c ------------------------------------------------------------------------
5912
@c Node, Next, Previous, Up
5913
@node Utility programs, Sample programs, Code conversion system, Top
5915
@chapter Utility programs
5925
@node vflmkcaptex, vflpp, , Utility programs
5926
@section vflmkcaptex
5930
@command{vflmkcaptex} is a utility program
5931
to generate vflibcap file for @TeX{} DVI driver software
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.
5938
@b{Usage:} @t{vflmkcaptex} [ @var{OPTIONS...} ] [ @var{CLASS...} ]
5941
@b{Usage:} @t{vflmkcaptex} [ @var{SHORTCUT} ] [ @var{OPTIONS...} ]
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.
5955
This is the same as command line option @t{pk}.
5959
This is the same as command line option @t{-g pk tfm}.
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).
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.
5971
This is the same as command line option @t{-g pk tfm -jtex -jisx0212 -jpcf}.
5972
(Japanese support for @t{simple} shortcut.)
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.)
5982
@b{Font class list:}
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}).
5993
Enables to use PK font files.
5994
For searching font files, kpathsea is used.
5997
Enables to use Virtual Font files.
5998
For searching font files, kpathsea is used.
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.
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.
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
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.
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.)
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.
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.
6038
vflmkcaptex pk type1
6041
Therefore, the order of font classes decides the priority of
6042
font file formats to search.
6051
Print a list of command line options and exit.
6054
Print version number of this program and exit.
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.
6061
@item @t{-n @var{MODE}}
6062
Device mode name for font file search, used by kpathsea.
6065
@item @t{-r @var{DPI}}
6066
Device resolution in DPI. Default is 300.
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.
6073
Configure @file{vflibcap} to generate non-existing PK files
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.
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.
6090
@b{Options for Japanese @TeX{} support:}
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.
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.
6107
Switch to use PCF fonts for Japanese Kanji characters.
6108
(This is the default.)
6111
Switch to use eKanji fonts for Japanese Kanji characters.
6112
See @ref{eKanji font class} for detail about eKanji fonts.
6115
Switch to use TrueType fonts for Japanese Kanji characters.
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)
6124
This option can be used multiple times.
6126
@item @t{-jefd @var{DIR}}
6127
Add a eKanji font directory.
6128
This option can be used multiple times.
6130
@item @t{-jtfd @var{DIR}}
6131
Add a TrueType font directory.
6132
This option can be used multiple times.
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:
6155
See files in a directory @file{ascii-jtex/} for detail.
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.
6165
invoke each program with @option{--help} option to see how to use it.
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}.)
6200
@node vflpp, vflmkfdb, vflmkcaptex, Utility programs
6204
@command{vflpp} prettyprints (i.e., grinds) a vflibcap file.
6205
It eliminate all comment strings and unnecessary space and newline characters.
6208
@b{Usage:} @t{vflpp} [ @var{vflibcap-file} ]
6211
@command{vflpp} prettyprints a file @var{vflibcap} to standard output.
6212
If no argument is given, @command{vflpp} reads from standard input.
6216
@node vflmkfdb, vfldrvs, vflpp, Utility programs
6222
@b{Usage:} @t{vflmkfdb} @var{font-directory} [ ... ]
6225
@command{vflmkfdb} makes a font file hint database (FDB for short)
6226
in a font directories given in the command line argument.
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.
6236
For each @var{font-directory}, a FDB file named @file{VFlib.fdb}
6237
is created in the directory.
6240
@node vfldrvs, , vflmkfdb, Utility programs
6246
@b{Usage:} @t{vfldrvs}
6249
@command{vfldrvs} prints a list of pre-installed
6250
font drivers in VFlib.
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
6267
@node vflserver, vfltest, , Sample programs
6271
@command{vflserver} is a font server that provides
6272
the functionality of VFlib via network.
6274
@command{vflserver} can be invokes from command line or via network.
6278
* Using vflserver from command line::
6279
* Using vflserver via network::
6280
* The protocol of vflserver::
6283
@node Using vflserver from command line, Using vflserver via network, , vflserver
6284
@subsection Using vflserver from command line
6287
@b{Usage:} @t{vflserver} [@t{-v} @var{vflibcap}] [@t{-s} @var{shrink}] [@var{cmd-file ...}]
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.
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}.)
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.
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.
6322
@node Using vflserver via network, The protocol of vflserver, Using vflserver from command line, vflserver
6323
@subsection Using vflserver via network
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.
6330
First, edit @file{/etc/services}:
6333
@item Network service name: vflserver
6334
@item Well known port: 4681
6339
Add the following line to @file{/etc/inetd.conf}.
6342
vflserver stream tcp nowait nobody /usr/local/bin/vflserver vflserver
6345
If you need to explicitly specify a vflibcap file to be used,
6346
you must give @option{-v} option as follows:
6349
vflserver stream tcp nowait nobady /usr/local/bin/vflserver vflserver -v /foo/vflibcap
6353
To force inetd to re-read @file{inetd.conf},
6354
send a HUP signal to inetd.
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.
6362
% telnet localhost vflserver
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
6369
; Type `HELP' for description of the protocol.
6371
(100 "vflserver ready.")
6374
(100 0 "timR14.pcf")
6376
(100 "Ascii-art bitmap on.")
6379
"3eccc4c4cc78407c7f83c1e27c"
6392
8| .@@@@@@@@@@@@@@ |8
6402
(100 "Happy Hacking")
6403
Connection closed by foreign host.
6407
@node The protocol of vflserver, , Using vflserver via network, vflserver
6408
@subsection The protocol of vflserver
6410
@subsubsection Introduction
6411
The VFLSERVER Protocol is a communication protocol between a
6412
server which offers font service and a client which uses
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
6421
@subsubsection Reply Format of a Server
6423
Each request to a server by a client takes a form of a line.
6424
The following are examples of client's requests.
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.
6437
(100 0 "timR14.pcf")
6438
(100 "Ascii-art bitmap on.")
6439
(100 8 13 0 9 9 0 "3eccc4c4cc78407c7f83c1e27c")
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.
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.
6456
@subsubsection The Protocol
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.
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).
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.
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).
6493
@b{Response:} Response is the same as one for @command{OPEN1} command.
6496
@item @t{CLOSE} @var{font_id}
6500
@b{Response:} @t{( @var{status} @var{message} )}
6503
@item @t{BITMAP1} @var{font_id} @var{code_point} [ @var{mag_x} @var{mag_y} ]
6505
@var{font_id} is a font id.
6506
This command corresponds to @code{VF_GetBitmap1()} function of VFlib.
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.
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.
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.
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.
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.
6553
@b{Response:} Same as METRIC1 command except for units are points.
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
6559
The argument @var{mag_x} @var{mag_y} are magnification factor
6561
This command corresponds to @code{VF_GetFontBoundingBox1()} function.
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.
6577
@item When the command failed: @t{( @var{status} @var{message} )}
6578
@var{status} indicates that an error occurred.
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.
6588
@item @t{PROPERTY} @var{font_id} @var{property_name}
6589
Obtain a property named @var{property_name} of a font @var{font_id}.
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.
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
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}.
6611
@b{Response:} The current mode is returned even if the operation fails or succeeds.
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}.
6621
Finish interaction between a server and a client.
6622
This operation always succeeds.
6625
@b{Response:} @t{( @var{status} @var{message} )}
6631
@node vfltest, vflx11, vflserver, Sample programs
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.
6642
@b{Usage:} @t{vfltest} [ @var{OPTIONS...} ] @var{FONT_NAME} @var{CHAR_LIST}
6649
A font is opened in mode 1 (high resolution device oriented mode).
6652
A font is opened in mode 2 (low resolution device oriented mode).
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.
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}.)
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.
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.
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.
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.
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.
6686
Print command line arguments and key operations on a window.
6690
A list of character is a sequence of the following forms.
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.
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{-}).
6704
@item @t{=}@var{charlist}
6705
This form specifies characters by a list of 1-byte characters,
6706
e.g., @samp{=abcdefg}.
6711
@node vflx11, vfldisol, vfltest, Sample programs
6716
@command{vflx11} displays glyph of a given font in a window.
6717
It requires X11R5 or X11R6.
6720
@b{Usage:} @t{vflx11} [ @var{OPTIONS...} ] @var{FONT_NAME}
6727
A font is opened in mode 1 (high resolution device oriented mode).
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.
6735
A font is opened in mode 2 (low resolution device oriented mode).
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}.)
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.
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.
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.
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.
6760
Print command line arguments and key operations on a window.
6765
Following operations are defined on a @command{vflx11} window.
6770
Finish @command{vflx11}
6773
Go to previous page.
6779
Go to previous 4 page.
6785
Go to previous 16 page.
6797
Go to the first page.
6800
Go to the last page.
6803
Mark the current page.
6806
Goto the marked page.
6812
@node vfldisol, ctext2pgm, vflx11, Sample programs
6816
@command{vfldisol} displays `disassembled lists'
6817
of vector data of a given font and code points.
6820
@b{Usage:} @t{vfldisol} [ @var{OPTIONS...} ] @var{FONT_NAME} @var{CODE} ...
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}.)
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.
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.
6841
Print hexadecimal dump of outline data instead of disassembled list.
6846
@node ctext2pgm, , vfldisol, Sample programs
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.
6859
@cindex Japanese EUC
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
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.
6880
--- An Arabic script, written from right to left.
6881
This character set is used by the multilingual editor Mule.
6886
@item JIS X 0201, JIS X 0208, JIS X 0212
6887
--- Japanese character sets.
6891
--- A Chinese character set.
6894
@item CNS 11641-1, CNS 11641-2
6895
--- Chinese character sets.
6899
--- A Hangle character set.
6904
@subsection Running ctext2pgm
6907
@b{Usage:} @t{ctext2pgm} [ @var{OPTIONS...} ] [ @var{file} ]
6910
--- @command{ctext2pgm} reads @var{file} (if not given, reads standard input)
6911
and prints image file to standard output.
6915
% ctext2pgm -pgm -ctext -16 -times DOC-10.txt > IMAGE.pgm
6917
(Never forget to redirect the output.)
6921
@b{Options for VFlib:}
6924
@item @t{-v @var{f}}
6925
--- a vflibcap file to be used by @command{ctext2pgm}.
6926
Default value is @file{vflibcap-ctext2pgm}.
6931
@b{Options for input encoding and script:}
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
6994
--- Same as @t{-euc-jp1} except
6995
ASCII character set is used for code set 0.
6998
--- Assume that input file is encoded by Korean EUC.
6999
Default writing directionality is set to left-to-right.
7001
ASCII character set is used for code set 0 and
7002
KSC 5601 is used for code set 1.
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.
7008
ASCII character set is used for code set 0, and
7009
GB 2312 is used for code set 1.
7012
--- Assume that input file is encoded by Chinese EUC by traditional Hanzi.
7013
Default writing directionality is set to left-to-right.
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.
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.
7025
ASCII character set is used for code set 0,
7026
JIS X 0208 is used for code set 1, and
7032
@b{Options for directionality:}
7036
--- Select left-to-right directionality for typesetting.
7038
--- Select right-to-left directionality for typesetting.
7043
@b{Options for font selection:}
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.
7051
@item @t{-bold} or @t{-italic}
7052
--- Select a font face: bold or italic (or oblique), respectively.
7053
Default face is normal.
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.
7059
@item @t{-scale @var{n}}
7060
--- Select a scalable font set and scales the font to @i{n} dot.
7062
@item @t{-m @var{m}}
7063
--- Specify vertical and horizontal magnification factors.
7066
@item @t{-mx @var{m}}
7067
--- Specify horizontal magnification factor.
7069
@item @t{-my @var{m}}
7070
--- Specify vertical magnification factor.
7072
@item @t{-font-list}
7073
--- Print all installed character sets and font names. Then exit the program.
7079
@b{Options for typesetting:}
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.
7087
@item @t{-center-line}
7088
--- Each line is centered.
7089
Output image is vertically and horizontally centered.
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.
7096
@item @t{-left-line}
7097
--- Each line is flushed left, but image is not flushed left.
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.
7106
@item @t{-right-line}
7107
--- Each line is flushed right, but image is not flushed right.
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.
7124
@b{Options for output:}
7128
@item @t{-pgm} or @t{-pgm-raw}
7129
--- Select binary PGM format for image output.
7131
@item @t{-pgm-ascii}
7132
--- Select ascii PGM format for image output.
7133
This is the default output mode.
7135
@item @t{-pbm} or @t{-pbm-ascii}
7136
--- Select ascii PBM format for output an image.
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
7144
@item @t{-ascii-art-h}
7145
--- An image is printed as an ASCII art. (Horizontal mode)
7146
Baseline is horizontal.
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.
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.
7159
--- An image is not shipped out.
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.)
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
7170
This option has effect when output format is PGM and EPS.
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.
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.
7184
--- Specify horizontal and vertical margins of output image (in pixels).
7185
Default margin is zero pixel.
7188
--- Specify horizontal margin of output image (in pixels).
7189
Default margin is zero pixel.
7192
--- Specify vertical margin of output image (in pixels).
7193
Default margin is zero pixel.
7195
@item @t{-center-image}
7196
--- An image of typeset text is horizontaly and vertically centered.
7198
@item @t{-h-center-image}
7199
--- An image of typeset text is horizontaly centered.
7201
@item @t{-v-center-image}
7202
--- An image of typeset text is vertically centered.
7204
@item @t{-left-image}
7205
--- An image of typeset text is flushed left.
7207
@item @t{-right-image}
7208
--- An image of typeset text is flushed right.
7210
@item @t{-top-image}
7211
--- An image of typeset text is flushed top.
7213
@item @t{-bottom-image}
7214
--- An image of typeset text is flushed bottom.
7220
@subsection Making input files for ctext2pgm
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.
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.
7243
@subsection Commands in input text
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{\\}.
7251
Following commands are defined:
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.
7261
--- Current font family is changed to the default font family.
7262
The default font family can be specified by a command line option.
7264
@item @code{\N}, @code{\B}, @code{\I}
7265
--- Change of font faces.
7266
Current font face is changed to normal, bold, italic, respectively.
7269
--- Current font face is changed to the default font face.
7270
The default font face can be specified by a command line option.
7273
--- Same as @code{\d} followed by @code{\D}.
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.)
7282
Nesting of @code{\(} has no effect.
7285
--- End of reversing black and white.
7288
--- Print backslash itself.
7293
@subsection Trouble shooting
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!)
7304
--- Print the state transition of the parser for compound text.
7306
--- Print the state transition of bi-directionality handling.
7308
--- Print font name to be opened.
7310
--- Print each character glyph in ascii-art form.
7312
--- Print each line image by in ascii-art form.
7314
--- Print entire page image in ascii-art form.
7316
--- Selects all debugging options above.
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
7326
VFlib version 3.6 and version 2 are quite different and
7327
you should forget about VFlib version 2.
7331
@item VFlib 2 was designed only for Japanese Kanji fonts
7332
VFlib 3.6 can handle fonts for multilingual text printing.
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
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.
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.
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
7359
Since I released VFlib version 1, so many people helped me
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.
7367
@c ------------------------------------------------------------------------
7368
@c Node, Next, Previous, Up
7369
@node Concept index, Data type index, Acknowledgments, Top
7370
@unnumbered Concept index
7375
@c ------------------------------------------------------------------------
7376
@c Node, Next, Previous, Up
7377
@node Data type index, Function index, Concept index, Top
7378
@unnumbered Data type index
7383
@c ------------------------------------------------------------------------
7384
@c Node, Next, Previous, Up
7385
@node Function index, Program index, Data type index, Top
7386
@unnumbered Function index
7391
@c ------------------------------------------------------------------------
7392
@c Node, Next, Previous, Up
7393
@node Program index, Acknowledgments, Function index, Top
7394
@unnumbered Program index
7399
@c ------------------------------------------------------------------------
7403
@c ------------------------------------------------------------------------