1
Info file: VFlib-36.info, -*-Text-*-
2
produced by `texinfo-format-buffer'
3
from file `VFlib-36.texi'
4
using `texinfmt.el' version 2.38 of 3 July 1998.
15
File: VFlib-36.info, Node: Functions and variables, Next: Building an application software with VFlib, Prev: Data types, Up: Programming with VFlib
17
Functions and variables
18
=======================
43
* VF_OutlineToBitmap()::
46
* VF_GetFontBoundingBox1()::
47
* VF_GetFontBoundingBox2()::
52
* VF_MakeScaledBitmap()::
53
* VF_ReflectedBitmap()::
54
* VF_RotatedBitmap()::
57
Writing a bitmap to file
58
* VF_ImageOut_PBMAscii()::
59
* VF_ImageOut_PGMAscii()::
60
* VF_ImageOut_PGMRaw()::
62
* VF_ImageOut_ASCIIArt()::
63
* VF_ImageOut_ASCIIArtV()::
65
Releasing data objects
70
Installing a font driver
71
* VF_InstallFontDriver()::
76
File: VFlib-36.info, Node: VF_Init(), Next: vf_error, Up: Functions and variables
81
int VF_Init(char* VFLIBCAP, char* VARIABLE_LIST)
84
Initialization of VFlib.
87
VFLIBCAP is a file name of vflibcap (this file is a font
88
database). If the null pointer is given, the default path name
89
given on compile time is used (a typical default value is
90
`/usr/local/lib/VFlib/3.6.12/vflibcap'). Searching of a vflibcap
91
file is done in the following way. First, VFlib try to open a file
92
as given to the first argument. (That is, VFlib searches it
93
relative to current working directory.) If not found, then VFlib
94
try to open the file under default runtime directory (e.g.,
95
`/usr/local/lib/VFlib/3.6.12/'). For example, `vflibcap-tex' is
96
given, VFlib first look for `vflibcap-tex' in current directory,
97
and then, it looks for the file under runtime directory.
99
Default runtime directory can be changed by an environment
100
variable `VFLIB_RUNTIME_DIRECTORY' on runtime. If an environment
101
variable `VFLIB_VFLIBCAP_PATH' is set, the first argument of this
102
function is ignored and its value is used. If an environment
103
variable `VFLIB_VFLIBCAP_DIRECTORY' is set, a vflibcap file is
104
searched under a directory sepecified by this environment variable.
106
VARIABLE_LIST is a list of parameters passed to VFlib. This is
107
used to specify values of parameterized vflibcap files. (See
108
basic.txt for parameterized vflibcap file.) The type of this
109
argument is a string and its syntax is a sequence of
110
VARIABLE=VALUE, separated by a comma `,'. For example, `DPI=400,
114
If initialization succeeds, a non-negative integer is returned.
115
If initialization fails, a negative integer is returned.
120
File: VFlib-36.info, Node: vf_error, Next: VF_ClearError(), Prev: VF_Init(), Up: Functions and variables
128
This is a global variable. Holding the error code of VFlib. If
129
no error, it keeps 0. If an error occurs, the corresponding error
134
File: VFlib-36.info, Node: VF_ClearError(), Next: VF_OpenFont1(), Prev: vf_error, Up: Functions and variables
139
void VF_ClearError(void)
142
Clear the error code variable of VFlib.
147
File: VFlib-36.info, Node: VF_OpenFont1(), Next: VF_OpenFont2(), Prev: VF_ClearError(), Up: Functions and variables
152
int VF_OpenFont1(char* FONT_NAME,
153
double DPI_X, double DPI_Y, double POINT_SIZE,
154
double MAG_X, double MAG_Y)
157
Open a font. (If the same font is opened multiple times, VFlib
158
keeps track of the number of opened font instances of the font.)
159
Since the font is opened with device resolution, point size and
160
magnification, a font opened by this function may be useful for
161
high resolution devices such as laser printers.
164
The argument FONT_NAME is a name of the font to be opened. The
165
device resolution of the target device is specified by DPI_X
166
(horizontal) DPI_Y (vertical). These values are given in DPI (dots
167
per inch). The argument POINT_SIZE specifies the size of the
168
bitmap. If this argument is negative the bitmap size will be the
169
inherent size of the font.
171
To obtain a magnified bitmap, give a magnification factor to the
172
argument MAG_X (horizontal) and MAG_Y (vertical). If the argument
173
POINT_SIZE is non-negative, font size will be POINT_SIZE times
174
MAG_X (MAG_Y) large for horizontal (vertical) direction.
177
A non-negative integer is returned on success. This value is a
178
font identifier (font id); it is used to specify a font for further
179
font operations. If `VF_OpenFont1()' fails, a negative integer is
185
File: VFlib-36.info, Node: VF_OpenFont2(), Next: VF_CloseFont(), Prev: VF_OpenFont1(), Up: Functions and variables
190
int VF_OpenFont2(char* FONT_NAME,
191
int PIXEL_SIZE, double MAG_X, double MAG_Y)
194
Open a font. (If the same font is opened multiple times, VFlib
195
keeps track of the number of opened font instances of the font.)
196
Since the font is opened with pixel size and magnification, a font
197
opened by this function may be useful for low resolution devices
201
The argument FONT is a name of the font to be opened. The
202
argument PIXEL_SIZE specifies the size of the bitmap. If this
203
argument is negative the bitmap size will be the inherent size of
204
the font. To obtain a magnified bitmap, give a magnification
205
factor to the argument MAG_X (horizontal) and MAG_Y (vertical). If
206
the argument POINT_SIZE is non-negative, font size will be
207
PIXEL_SIZE times MAG_X (MAG_Y) large for horizontal (vertical)
211
A non-negative integer is returned on success. This value is a
212
font identifier (font id); it is used to specify a font for further
213
font operations. If `VF_OpenFont2()' fails, a negative integer is
219
File: VFlib-36.info, Node: VF_CloseFont(), Next: VF_GetBitmap1(), Prev: VF_OpenFont2(), Up: Functions and variables
224
int VF_CloseFont(int FONT_ID)
230
The argument FONT_ID is a font id to be closed.
233
A non-negative integer is returned on success. A negative integer
234
is returned on failure.
239
File: VFlib-36.info, Node: VF_GetBitmap1(), Next: VF_GetBitmap2(), Prev: VF_CloseFont(), Up: Functions and variables
244
VF_BITMAP VF_GetBitmap1(int FONT_ID, long CODE_POINT,
245
double MAG_X, double MAG_Y)
248
Obtain a glyph bitmap of given font id and code point. The font
249
id FONT_ID must be an id by `VF_OpenFont1()'. Size of bitmap to be
250
obtained can be specified by MAG_X and MAG_Y arguments.
253
FONT_ID specifies the font; CODE_POINT specifies the code point of
254
a character. To obtain a magnified bitmap, give a magnification
255
factor to the argument MAG_X (horizontal) and MAG_Y (vertical). If
256
a font is opened with magnification factor 2 and an bitmap is
257
obtained by this function with magnification factor 2, then the
258
size of yielding bitmap will be 4 times larger than the original
262
The return value is a pointer to a newly allocated bitmap object.
263
If it fails to obtain a bitmap, the null pointer is returned. If
264
the bitmap object is no longer needed, it must be released by the
265
function `VF_FreeBitmap()'. The font may not have the specified
266
size; in such case, VFlib internally enlarges or shrinks the glyph
267
to obtain a bitmap of the requested size.
272
File: VFlib-36.info, Node: VF_GetBitmap2(), Next: VF_GetMetric1(), Prev: VF_GetBitmap1(), Up: Functions and variables
277
VF_BITMAP VF_GetBitmap2(int FONT_ID, long CODE_POINT,
278
double MAG_X, double MAG_Y)
281
Obtain a glyph bitmap of given font id and code point. The font
282
id 'font_id' must be an id by `VF_OpenFont2()'. Size of bitmap to
283
be obtained can be specified by PIXEL_SIZE, MAG_X and MAG_Y
287
FONT_ID specifies the font; CODE_POINT specifies the code point of
288
a character. To obtain a magnified bitmap, give a magnification
289
factor to the argument MAG_X (horizontal) and MAG_Y (vertical). If
290
a font is opened with magnification factor 2 and an bitmap is
291
obtained by this function with magnification factor 2, then the
292
size of yielding bitmap will be 4 times larger than the original
296
The return value is a pointer to a newly allocated bitmap object.
297
If it fails to obtain a bitmap, the null pointer is returned. If
298
the bitmap object is no longer needed, it must be released by the
299
function `VF_FreeBitmap()'. The font may not have the specified
300
size; in such case, VFlib internally enlarges or shrinks the glyph
301
to obtain a bitmap of the requested size.
306
File: VFlib-36.info, Node: VF_GetMetric1(), Next: VF_GetMetric2(), Prev: VF_GetBitmap2(), Up: Functions and variables
311
VF_METRIC1 VF_GetMetric1(int FONT_ID, long CODE_POINT,
313
double MAG_X, double MAG_Y)
316
Obtain font metrics of a given font and code point.
319
Same arguments as of `VF_GetBitmap1()'.
322
A pointer to a metric1 object is returned. If an error occurs,
323
the NULL pointer is returned. The obtained metric is a metric for
324
a bitmap obtained by `VF_GetBitmap1()' with the same arguments, but
325
the unit of the obtained metric is point. If the metric1 object is
326
no longer needed it must be released by the function
332
File: VFlib-36.info, Node: VF_GetMetric2(), Next: VF_GetOutline(), Prev: VF_GetMetric1(), Up: Functions and variables
337
VF_METRIC2 VF_GetMetric2(int FONT_ID, long CODE_POINT,
339
double MAG_X, double MAG_Y)
342
Obtain font metrics of a given font and code point.
345
Same arguments as of `VF_GetBitmap2()'.
348
A pointer to a metric2 object is returned. If an error occurs,
349
the NULL pointer is returned. The obtained metric is a metric for
350
a bitmap obtained by `VF_GetBitmap2()' with the same arguments, but
351
the unit of the obtained metric is pixel. If the metric2 object is
352
no longer needed, it must be released by the function
358
File: VFlib-36.info, Node: VF_GetOutline(), Next: VF_OutlineToBitmap(), Prev: VF_GetMetric2(), Up: Functions and variables
363
VF_OUTLINE VF_GetOutline(int FONT_ID, long CODE_POINT,
364
double MAG_X, double MAG_Y)
367
Obtain outline data from a given font and code point.
370
Same as `VF_GetBitmap1()'.
373
Return value is a pointer to a newly allocated outline data
374
object. If it fails to obtain a outline data, the NULL pointer is
375
returned. Even if the original font is a bitmap, VFlib internally
376
creates outline data from the bitmap. If the source font is a
377
vector font, VFlib internally converts the data format to VFlib
378
outline data style. A bitmap of any specified size can be obtained
379
from outline data by the function `VF_Outline2Bitmap()'. (Default
380
point size and device resolution is also kept in the outline data.)
385
File: VFlib-36.info, Node: VF_OutlineToBitmap(), Next: VF_GetFontBoundingBox1(), Prev: VF_GetOutline(), Up: Functions and variables
387
`VF_OutlineToBitmap()'
388
----------------------
390
VF_OUTLINE VF_OutlineToBitmap(VF_OUTLINE OUTLINE,
391
double DPI_X, double DPI_Y,
393
double MAG_X, double MAG_Y)
396
Obtain a bitmap from outline data.
399
The argument OUTLINE is a pointer to an outline object to be
400
rasterised. The arguments DPI_X, DPI_Y, POINT_SIZE, MAG_X and
401
MAG_Y are the same as the corresponding arguments of
402
`VF_GetBitmap1()'. The outline data contains information on device
403
resolution and point size specified by `VF_GetOutline()'. (If not
404
specified, default values are used. Thus, bitmaps with a default
405
size can be obtained by giving -1 for the arguments).
408
A pointer to a bitmap object is returned. The NULL pointer is
409
returned on failure. If the bitmap object is no longer needed it
410
must be released by the function `VF_FreeBitmap()'.
415
File: VFlib-36.info, Node: VF_GetFontBoundingBox1(), Next: VF_GetFontBoundingBox2(), Prev: VF_OutlineToBitmap(), Up: Functions and variables
417
`VF_GetFontBoundingBox1()'
418
--------------------------
420
int VF_GetFontBoundingBox1(int FONT_ID,
421
double MAG_X, double MAG_Y,
422
double* W, double* H,
423
double* XOFF, double* YOFF)
426
Obtain font bounding box information of a given font.
429
The argument FONT_ID specify a font in interest. The function
430
writes the bounding box information to the locations pointed by W,
431
H, XOFF, and YOFF. W and H point to data objects for width and
432
height of bounding box, respectively. XOFF and YOFF point to data
433
objects for largest horizontal and vertical displacement of lower
434
left corner of bounding box from reference points. Note that these
435
values does not guarantee the minimality; they only guarantee that
436
all characters can be contained in a box descrived by them. If
437
some values of W, H, XOFF, or YOFF are not in interest, NULL
438
pointer can be given.
440
The argument MAG_X and MAG_Y are maginification factor to be
441
scaled for a given font FONT_ID.
444
If font bounding information is successfully obtained, a
445
non-negative integer is returned; otherwize, negative integer is
448
Units of bounding box information is in point.
454
File: VFlib-36.info, Node: VF_GetFontBoundingBox2(), Next: VF_GetProp(), Prev: VF_GetFontBoundingBox1(), Up: Functions and variables
456
`VF_GetFontBoundingBox2()'
457
--------------------------
459
int VF_GetFontBoundingBox2(int FONT_ID,
460
double MAG_X, double MAG_Y,
462
int* XOFF, int* YOFF)
464
Same as `VF_GetFontBoundingBox1()' except units of font bounding box
465
parameters are pixel.
470
File: VFlib-36.info, Node: VF_GetProp(), Next: VF_CopyBitmap(), Prev: VF_GetFontBoundingBox2(), Up: Functions and variables
475
char* VF_GetProp(int FONT_ID, char* PROP_NAME)
478
Obtain a property of given font. (This function is font class
479
dependent. You must be very careful to use it!)
482
The argument FONT_ID specifies a font from which to obtain a
483
property. PROPERTY_NAME specifies the property name.
486
If the given property exists, its value is returned as a string.
487
The string for the property value is newly allocated and must be
488
released by FREE() if it is no longer needed. If the given
489
property is undefined, the NULL pointer is returned.
494
File: VFlib-36.info, Node: VF_CopyBitmap(), Next: VF_MakeScaledBitmap(), Prev: VF_GetProp(), Up: Functions and variables
499
VF_BITMAP VF_CopyBitmap(VF_BITMAP BM)
502
Make a copy of a bitmap object.
505
The argument BM is a pointer to a bitmap object to be copied.
508
A new bitmap object is allocated; all values are copied. Return
509
value is a pointer to a new bitmap. The source bitmap BM remains
510
unaffected. If an error occurs, the NULL pointer is returned. The
511
obtained bitmap object must be released by `VF_FreeBitmap()' if it
517
File: VFlib-36.info, Node: VF_MakeScaledBitmap(), Next: VF_ReflectedBitmap(), Prev: VF_CopyBitmap(), Up: Functions and variables
519
`VF_MakeScaledBitmap()'
520
-----------------------
522
VF_BITMAP VF_MakeScaledBitmap(VF_BITMAP BM,
523
double MAG_X, double MAG_Y)
526
Make an enlarged or shrinked bitmap.
529
The argument BM specifies the source bitmap object, MAG_X and
530
MAG_Y give the magnification factor in the horizontal and vertical
531
direction respectively. If the magnification factor is less than
532
1, a shrinked bitmap is obtained. Values for MAG_X and MAG_Y can
533
be arbitrary such as (MAG_X > 1 and MAG_Y < 1) or (MAG_X < 1 and
537
A bitmap object whose bitmap is enlarged or shrinked is created
538
and a pointer to the new bitmap is returned. If an error occurs,
539
the NULL pointer is returned. The source bitmap BM remains
540
unaffected. Use `VF_FreeBitmap()' if the returned bitmap object is
546
File: VFlib-36.info, Node: VF_ReflectedBitmap(), Next: VF_RotatedBitmap(), Prev: VF_MakeScaledBitmap(), Up: Functions and variables
548
`VF_ReflectedBitmap()'
549
----------------------
551
VF_BITMAP VF_ReflectedBitmap(VF_BITMAP BM,
552
int REFL_X, double REFL_Y)
555
Make a bitmap with horizontally and/or vertically reflected image.
558
The argument BM specifies the source bitmap object, REFL_X and
559
REFL_Y specify the reflection, respectively. If REFL_X is
560
non-zero, the image is holizontally reflected; if REFL_Y is
561
non-zero, the image is vertically reflected. In case RELF_X and
562
REFL_Y are both zero, the effect is the same as `VF_CopyBitmap()'.
565
A new bitmap object is created and a pointer to the new bitmap is
566
returned. If an error occurs, the NULL pointer is returned.
567
Metrics of created bitmap is the same as that of the original
568
bitmap. The source bitmap BM remains unaffected. Use
569
`VF_FreeBitmap()' if the returned bitmap object is no longer
575
File: VFlib-36.info, Node: VF_RotatedBitmap(), Next: VF_DumpBitmap(), Prev: VF_ReflectedBitmap(), Up: Functions and variables
580
VF_BITMAP VF_RotatedBitmap(VF_BITMAP BM, int ANGLE)
583
Make a bitmap image with rotated image.
586
The argument BM specifies the source bitmap object, ANGLE gives
587
rotation angle in degree. By the limitation of implementation,
588
rotatin angle must be multiple of 90. The rotation angle ANGLE
589
must be one of the following:
591
Rotation angle is zero. Thus, the effect is the same as
594
Rotation angle is 90 degree.
596
Rotation angle is 180 degree.
598
Rotation angle is 270 degree.
601
A bitmap object whose bitmap is rotated is created and a pointer
602
to the new bitmap is returned. If an error occurs, the NULL
603
pointer is returned. The source bitmap BM remains unaffected. Use
604
`VF_FreeBitmap()' if the bitmap object is no longer necessary.
606
This function rotates a bitmap with the reference point as origin.
607
The vector to the next reference point is also rotated. Therefore,
608
position of the reference point and a vector to the next reference
609
point of `VF_RotatedBitmap(BM, VF_BM_ROTATE_180)' and that of
610
`VF_ReflectedBitmap(BM, 1, 1)' are different.
615
File: VFlib-36.info, Node: VF_DumpBitmap(), Next: VF_ImageOut_PBMAscii(), Prev: VF_RotatedBitmap(), Up: Functions and variables
620
void VF_DumpBitmap(VF_BITMAP BM)
623
Print a bitmap in ASCII-art-style to stdout.
626
The argument BM specifies a bitmap to be displayed.
632
File: VFlib-36.info, Node: VF_ImageOut_PBMAscii(), Next: VF_ImageOut_PGMAscii(), Prev: VF_DumpBitmap(), Up: Functions and variables
634
`VF_ImageOut_PBMAscii()'
635
------------------------
637
int VF_ImageOut_PBMAscii(VF_BITMAP BM, FILE *FP,
638
int IMAGE_WIDTH, int IMAGE_HEIGHT,
639
int POSITION_X, int POSITION_Y,
640
int MARGIN_L, int MARGIN_R,
641
int MARGIN_T, int MARGIN_B,
642
int REVERSE, int SHRINK,
643
char *PROG, char *TITLE)
646
Print a bitmap BM in PBM ASCII format to a file stream FP.
649
BM is a bitmap to be written to a file stream FP. Size of output
650
image (in pixel) is specified by IMAGE_WIDTH and IMAGE_HEIGHT. If
651
-1 is given for these arguments, the image size should be minimum
652
to contain the bitmap BM.
654
Arguments POSITION_X and POSITION_Y specifies the horizontal and
655
vertical position of a source bitmap BM in an output image file,
656
respectively. These parameters have effect when IMAGE_WIDTH and
657
IMAGE_HEIGHT are specified. Possible values for POSITION_X is
658
`VF_IMAGEOUT_POSITION_NONE'
659
Same as `VF_IMAGEOUT_POSITION_LEFT'.
660
`VF_IMAGEOUT_POSITION_CENTER'
661
BM is centered in output image.
662
`VF_IMAGEOUT_POSITION_LEFT'
663
BM is flushed left in output image.
664
`VF_IMAGEOUT_POSITION_RIGHT'
665
BM is flushed righted in output image.
667
Possible values for POSITION_Y is
668
`VF_IMAGEOUT_POSITION_NONE'
669
Same as `VF_IMAGEOUT_POSITION_TOP'.
670
`VF_IMAGEOUT_POSITION_CENTER'
671
BM is centered in output image.
672
`VF_IMAGEOUT_POSITION_TOP'
673
BM is placed at the top in output image.
674
`VF_IMAGEOUT_POSITION_BOTTOM'
675
BM is placed at the bottom in output image.
677
Arguments MARGIN_L, int MARGIN_R are used to speficy left and right
678
margins, respectively. Arguments MARGIN_T, int MARGIN_B are used
679
to speficy top and bottom margins, respectively.
681
If the argument REVERSE is not 0, black and white in an output
682
image is reversed. Argument SHRINK specifys shrink factor of image
683
BM. (If this value is 1, BM is not shrinked. Note: Currently,
684
shrinking image is not supported in PBM ASCII format.)
686
Arguments PROG and TITLE are used to emmbed program name and title
693
File: VFlib-36.info, Node: VF_ImageOut_PGMAscii(), Next: VF_ImageOut_PGMRaw(), Prev: VF_ImageOut_PBMAscii(), Up: Functions and variables
695
`VF_ImageOut_PGMAscii()'
696
------------------------
698
int VF_ImageOut_PGMAscii(VF_BITMAP BM, FILE *FP,
699
int IMAGE_WIDTH, int IMAGE_HEIGHT,
700
int POSITION_X, int POSITION_Y,
701
int MARGIN_L, int MARGIN_R,
702
int MARGIN_T, int MARGIN_B,
703
int REVERSE, int SHRINK,
704
char *PROG, char *TITLE)
707
Print a bitmap BM in PGM ASCII format to a file stream FP.
710
Arguments are the same as that of `VF_ImageOut_PGMAscii()'. If
711
SHRINK is greater than 1, output image is anti-aliased
717
File: VFlib-36.info, Node: VF_ImageOut_PGMRaw(), Next: VF_ImageOut_EPS(), Prev: VF_ImageOut_PGMAscii(), Up: Functions and variables
719
`VF_ImageOut_PGMRaw()'
720
----------------------
722
int VF_ImageOut_PGMRaw(VF_BITMAP BM, FILE *FP,
723
int IMAGE_WIDTH, int IMAGE_HEIGHT,
724
int POSITION_X, int POSITION_Y,
725
int MARGIN_L, int MARGIN_R,
726
int MARGIN_T, int MARGIN_B,
727
int REVERSE, int SHRINK,
728
char *PROG, char *TITLE)
731
Print a bitmap BM in PGM Raw format to a file stream FP.
734
Arguments are the same as that of `VF_ImageOut_PGMAscii()'. If
735
SHRINK is greater than 1, output image is anti-aliased
741
File: VFlib-36.info, Node: VF_ImageOut_EPS(), Next: VF_ImageOut_ASCIIArt(), Prev: VF_ImageOut_PGMRaw(), Up: Functions and variables
746
int VF_ImageOut_EPS(VF_BITMAP BM, FILE *FP,
747
int IMAGE_WIDTH, int IMAGE_HEIGHT,
748
int POSITION_X, int POSITION_Y,
749
int MARGIN_L, int MARGIN_R,
750
int MARGIN_T, int MARGIN_B,
751
int REVERSE, int SHRINK,
752
char *PROG, char *TITLE,
753
double PTSIZE, int PIXSIZE)
756
Print a bitmap BM in EPS (Encapsulated PostScript) format to a
760
Arguments are the same as that of `VF_ImageOut_PGMAscii()'. If
761
SHRINK is greater than 1, output image is anti-aliased
762
(gray-scaled). Arguments PTSIZE and PIXSIZE specify size of EPS
763
bounding box; PIXSIZE pixels occupy PTSIZE points in physical
768
File: VFlib-36.info, Node: VF_ImageOut_ASCIIArt(), Next: VF_ImageOut_ASCIIArtV(), Prev: VF_ImageOut_EPS(), Up: Functions and variables
770
`VF_ImageOut_ASCIIArt()'
771
------------------------
773
int VF_ImageOut_ASCIIArt(VF_BITMAP BM, FILE *FP,
774
int IMAGE_WIDTH, int IMAGE_HEIGHT,
775
int POSITION_X, int POSITION_Y,
776
int MARGIN_L, int MARGIN_R,
777
int MARGIN_T, int MARGIN_B,
778
int REVERSE, int SHRINK)
781
Print a bitmap BM in ASCII art format to a file stream FP.
784
Arguments are the same as that of `VF_ImageOut_PGMAscii()'.
789
File: VFlib-36.info, Node: VF_ImageOut_ASCIIArtV(), Next: VF_FreeBitmap(), Prev: VF_ImageOut_ASCIIArt(), Up: Functions and variables
791
`VF_ImageOut_ASCIIArtV()'
792
-------------------------
794
int VF_ImageOut_ASCIIArtV(VF_BITMAP BM, FILE *FP,
795
int IMAGE_WIDTH, int IMAGE_HEIGHT,
796
int POSITION_X, int POSITION_Y,
797
int MARGIN_L, int MARGIN_R,
798
int MARGIN_T, int MARGIN_B,
799
int REVERSE, int SHRINK)
802
Print a bitmap BM in ASCII art format to a file stream FP. Image
803
is rotated in clockwise, 90 degree.
806
Arguments are the same as that of `VF_ImageOut_PGMAscii()'.
811
File: VFlib-36.info, Node: VF_FreeBitmap(), Next: VF_FreeMetric1(), Prev: VF_ImageOut_ASCIIArtV(), Up: Functions and variables
816
void VF_FreeBitmap(VF_BITMAP BM)
819
Release a bitmap object.
822
The argument BM is a pointer to a bitmap object to be released.
828
File: VFlib-36.info, Node: VF_FreeMetric1(), Next: VF_FreeMetric2(), Prev: VF_FreeBitmap(), Up: Functions and variables
833
void VF_FreeMetric1(VF_METRIC1 METRIC)
836
Release a metric1 object.
839
The argument METRIC is a pointer to a metric1 object.
844
File: VFlib-36.info, Node: VF_FreeMetric2(), Next: VF_InstallFontDriver(), Prev: VF_FreeMetric1(), Up: Functions and variables
849
void VF_FreeMetric2(VF_METRIC2 METRIC)
852
Release a metric2 object.
855
The argument METRIC is a pointer to a metric2 object.
861
File: VFlib-36.info, Node: VF_InstallFontDriver(), Prev: VF_FreeMetric2(), Up: Functions and variables
863
`VF_InstallFontDriver()'
864
------------------------
866
int VF_InstallFontDriver(char* CLASS_NAME,
867
int(*driver)(VF_FONT FONT,
873
Install a font driver.
876
CLASS_NAME is a font class name, DRIVER is a pointer to a function
877
of a font driver of the font class. The function given by DRIVER
878
is called when a font of this font class is opened by
879
`VF_OpenFont1()' and `VF_OpenFont2()'. The function DRIVER is
880
called with parameters of the font to be opened: FONT is a data
881
object for font management defined by VFlib internally. CLASS_NAME
882
is the font class name. FONT_NAME is the name of the font to be
883
opened. This argument is the same as the argument of
884
`VF_OpenFont1()' and `VF_OpenFont2()'. IMPLICIT_FONT is a flag
885
whose value is 1 if a font is to be opened as an implicit font (a
886
font which does not explicitly appear in vflibcap) and 0 if it is
887
to be opened as an explicit font (a font that does appear in
891
If successful, a non-negative integer is returned. A negative
892
integer is returned if the installation of the font driver fails.
898
File: VFlib-36.info, Node: Building an application software with VFlib, Next: A simple example, Prev: Functions and variables, Up: Programming with VFlib
900
Building an application software with VFlib
901
===========================================
903
An application software that use VFlib must include a header file
904
`VFlib-3_6.h'. Typically, this file is installed `/usr/local/include/'
907
Never forget, that application software that uses VFlib must be linked
908
against FreeType 1.2 or later (`libttf.a' or `libttf.so'), T1Lib 1.0 or
909
later (`libt1.a' or `libt1.so'), and kpathsea 3.2 (`libkpathsea.a' or
910
`libkpathsea.so'), if you configure VFlib to use them. (If VFlib is
911
configured not to use them, they are not necessary.)
913
I recommend shared library versions for these optional libraries if you
914
built a shared library version of VFlib.
917
#include <VFlib-3_6.h>
919
VFlib must be initialized before it is used.
921
char* vflibcap = "vflibcap";
922
char* params = "TeX_DPI=300, KPATHSEA_MODE=cx";
924
if (VF_Init(vflibcap, params) < 0){
925
fprintf(stderr, "Initializing VFlib: failed\n");
929
Following program fragment opens a font, obtains a bitmap, and print
935
if ((fid = VF_OpenFont2("timR24.pcf", -1, 1.0, 1.0)) < 0){
936
fprintf(stderr, "Opening font: failed\n");
940
bm = VF_GetBitmap2(fid, 0x67, 1.0, 1.0);
947
File: VFlib-36.info, Node: A simple example, Prev: Building an application software with VFlib, Up: Programming with VFlib
952
The following program code is a "banner" like using VFlib. For
953
simplicity, this program accepts only 1-byte encoded characters. It
954
reads an input from standard input and prints characters in ascii-art
955
form to standard output.
958
* vflbanner.c - a banner by VFlib
959
* by Hirotsugu Kakugawa
964
* Copyright (C) 1998 Hirotsugu Kakugawa.
965
* All rights reserved.
967
* This program is free software; you can redistribute it and/or modify
968
* it under the terms of the GNU General Public License as published by
969
* the Free Software Foundation; either version 2, or (at your option)
972
* This program is distributed in the hope that it will be useful,
973
* but WITHOUT ANY WARRANTY; without even the implied warranty of
974
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
975
* GNU General Public License for more details.
977
* You should have received a copy of the GNU General Public License
978
* along with this program; if not, write to the Free Software
979
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
986
#include "VFlib-3_6.h"
988
#define DEFAULT_FONT "timR18.pcf"
995
void vflbanner(FILE *fp);
999
main(int argc, char **argv)
1002
fontname = DEFAULT_FONT;
1007
&& ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0))){
1010
} else if ((argc >= 2) && (strcmp(argv[0], "-v") == 0)){
1014
} else if ((argc >= 2) && (strcmp(argv[0], "-f") == 0)){
1030
printf("vflbanner - a banner program using VFlib\n");
1031
printf("Usage: vflbanner [-v vflibcap] [-f fontname]\n");
1032
printf("This program reads a text from standard input. It supports\n");
1033
printf("1-bit encoded font only. Thus, `ctextpgm' is better than this.\n");
1043
VF_BITMAP bm, page_bm;
1044
struct vf_s_bitmaplist PageBuff;
1046
if (VF_Init(vflibcap, NULL) < 0){
1047
printf("VFlib initialization error");
1049
case VF_ERR_INTERNAL:
1050
printf(" - Internal error.\n"); break;
1051
case VF_ERR_NO_MEMORY:
1052
printf(" - Server runs out of memory.\n"); break;
1053
case VF_ERR_NO_VFLIBCAP:
1054
printf(" - No vflibcap.\n"); break;
1056
printf(" - Error code %d\n", vf_error); break;
1062
if ((fid = VF_OpenFont1(fontname, -1, -1, -1, 1, 1)) < 0)
1065
VF_BitmapListInit(&PageBuff);
1068
while ((ch = getc(fp)) != EOF){
1071
if ((bm = VF_GetBitmap1(fid, (long)ch, 1, 1)) == NULL)
1073
VF_BitmapListPut(&PageBuff, bm, pos_x, pos_y);
1074
pos_x = pos_x + bm->mv_x;
1077
page_bm = VF_BitmapListCompose(&PageBuff);
1078
VF_DumpBitmap(page_bm);
1079
VF_BitmapListFinish(&PageBuff);
1080
VF_FreeBitmap(page_bm);
1088
By the following commands is used to comple the program.
1090
% gcc -c `VFlib3-config --cflags` vflbanner.c
1091
% gcc -o vflbanner vflbanner.o `VFlib3-config --libs`
1093
`VFlib3-config' is a program to print misc information on configuration
1094
of VFlib. It prints C compiler option to specify include directory
1095
(`--cflags'), dependent libraries (`--libs'), for example. Run
1096
`VFlib3-config' with `--help' option for detail.
1102
File: VFlib-36.info, Node: Writing a vflibcap, Next: Debugging a vflibcap, Prev: Programming with VFlib, Up: Top
1110
* Introduction to vflibcap::
1111
* Syntax of vflibcap::
1112
* Macros in vflibcap::
1113
* Searching font files::
1114
* Fast font file search::
1115
* Compressed font files::
1116
* Explicit and implicit fonts::
1117
* Variables in vflibcap::
1126
* TrueType font class::
1127
* Type1 font class::
1130
* eKanji font class::
1131
* TeX default and TeX font mapping font class::
1137
Font drivers that map to another fonts
1138
* ASCII Japanese TeX Kanji font class::
1139
* Japanese comic font class::
1141
* Mojikyo font mapping class::
1143
Examples of vflibcaps
1144
* Example vflibcap 1::
1145
* Example vflibcap 2::
1146
* Example vflibcap 3::
1151
File: VFlib-36.info, Node: Introduction to vflibcap, Next: Syntax of vflibcap, Up: Writing a vflibcap
1153
Introduction to vflibcap
1154
========================
1156
A vflibcap file is a database of font definitions for the VFlib library.
1157
A vflibcap font definition is described in a format similar to termcap
1158
and printcap. Vflibcap provides logical font names and logical font
1159
names may not corresponds to font files to be accessed. In this
1160
document, we simply say "font" to denote logical fonts.
1162
Each VFlib fonts have its own parameters listed below:
1166
* Resolution of target device.
1168
These parameters may not be available in font file. For instance, these
1169
parameters are lacking in TrueType fonts. Lacking information is given
1170
in vflibcap file, or it is given by a font driver as default values.
1172
Note: If you want to use VFlib for TeX DVI drivers, such as previewers
1173
and pronter driver, use `vflmkcaptex' program to generate vflibcap file
1179
File: VFlib-36.info, Node: Syntax of vflibcap, Next: Macros in vflibcap, Prev: Introduction to vflibcap, Up: Writing a vflibcap
1184
The syntax of vflibcap file is lisp-like form. A semicolon `;' starts a
1185
comment and following text is ignored until the end of line. A colon in
1186
a string which is enclosed by double colons is not considered as a
1187
comment character and forms a part of string. In the following
1188
explanation, we ignore comments.
1190
A vflibcap file is a sequence of expressions called s-expressions.
1191
Basic data item of s-expression is string. Unlike lisp, there is no
1192
"number" type. A sequence of digits is parsed as a string. To include
1193
a special characters in a string such as double quotation, control code,
1194
and parenthesis, escape sequence can be used. String is a sequence of
1195
characters of the following form:
1198
Sequence of characters enclosed by double quotations.
1203
"He said \"Thanks!\"."
1207
Sequence of characters except space, tab, newline, and closing
1208
parenthesis. A start character must not be a double quotation.
1213
He\ said\ \"Thanks!\".
1216
Unlink lisp, there is no distinction between string and symbol in
1217
vflibcap; they are the same data type. That is, `HELLO' and `"HELLO"'
1220
Parentheses is used to form a "list" like in lisp. For example, `(A B
1221
C)' is a list of three strings. List can be nested any depth, e.g., `(A
1222
(B1 B2 B3) (C1 (C21 C22) C3))'.
1224
A vflibcap must be a sequence of s-expression of the following forms:
1226
`(define-default FONT-CLASS CAPABILITY-DEF ... )'
1227
This expression defines a default values for a font class.
1229
`(define-font NAME CAPABILITY-DEF ... )'
1230
This expression defines a font.
1232
`(define-macro NAME CAPABILITY-DEF ... )'
1233
This expression defines a macro NAME.
1235
CAPABILITY-DEF must be a list of form `(CAPABILITY-NAME VALUE)', e.g.,
1236
`(font-file "/usr/local/share/fonts/"'. Each font class defines its own
1237
set of capabilities and capability sets can be different by font
1241
This is an example of vflibcap file.
1244
(define-default VFlib
1245
(extension-hints (".bdf" bdf) (".pcf" pcf))
1246
(uncompression-programs (".Z" "zcat") (".gz" "gzip -cd")
1247
("pk" ascii-jtex-kanji))
1248
(implicit-font-classes bdf pcf hbf ascii-jtex-kanji)
1249
(variable-values ("TeX_DPI" "300"))
1252
(filename-extensions ".bdf")
1254
"/usr/X11R6/lib/X11/fonts//" "/usr/local/share/fonts/X11//")
1255
(compression-extensions ".gz" ".Z"))
1257
(define-font timR24 ; times roman 24
1259
(font-file "timR24.bdf"))
1261
(define-font timR18 ; times roman 18
1263
(font-file "timR18.bdf"))
1268
File: VFlib-36.info, Node: Macros in vflibcap, Next: Searching font files, Prev: Syntax of vflibcap, Up: Writing a vflibcap
1273
To avoid writing the same capabilities, macro feature is provided in
1274
vflib. In case of CAPABILITY-DEF is a string, it is treated as a macro
1275
and a macro definition for it is expanded. For instance,
1279
(font-file "timR18.bdf"))
1281
is a font definition using a macro `MACRO-NAME'. Suppose a macro
1282
`MACRO-NAME' is defined as follows.
1284
(define-macro MACRO-NAME
1288
Then, the font definition for `timR24' is the same as follow.
1293
(font-file "timR18.bdf"))
1296
The rule of macr expand is as following procedure.
1298
1. Looks for use of macros. From the first CAPABILITY-DEF to the last
1299
one, it is checked if it is a string (thus a macro) or not in
1300
order. If it is a macro, corresponding macro definition is
1301
substituted. Then, next CAPABILITY-DEF is checked.
1303
2. Macro expand is done recursively. Thus, a macro can be used in
1310
File: VFlib-36.info, Node: Searching font files, Next: Fast font file search, Prev: Macros in vflibcap, Up: Writing a vflibcap
1312
Searching font files
1313
====================
1315
Some font classes (e.g., BDF, PCF) defines a `font-directories'
1316
capability in vflibcap file. This capability specifies a list of font
1317
directories, for instance, `(font-directories "/usr/local/fonts/"
1318
"/opt/fonts" "/usr/local/share/fonts//")'. A font file can be searched
1319
recursively in a directory tree if a font directory name ends by double
1322
Some font drivers support file search by kpathsea. Typically, font
1323
files are located under `/usr/local/share/texmf'. This directory is
1324
used to hold TeX-related files. If a font driver supports searching by
1325
kpathsea, a special name `TEXMF' can be given in a list of
1326
`font-directories' capability. For instance, suppose that
1327
`(font-directories "/opt1/fonts//" "TEXMF" "/opt2/fonts//")' is
1328
specified. Then files are searched under `/opt1/fonts', by kpathsea,
1329
and then `/opt2/fonts', in this order.
1331
Currently, pk, gf, tfm, vf, truetype, and type1 font classes suport
1332
searcing files by kpathsea.
1337
File: VFlib-36.info, Node: Fast font file search, Next: Compressed font files, Prev: Searching font files, Up: Writing a vflibcap
1339
Fast font file search
1340
=====================
1342
In case there are many font directories and sub-directory which contains
1343
many font file, searching a font file take long time, since font
1344
directories are traversed to find a requested font file. For fast font
1345
file search, font file hint database (FDB for short) can be used. It is
1346
placed in a root of a font directory, and it contains pairs of font file
1347
name and relative pathname of the font file from the font directory.
1348
The file name of FDB is `VFlib.fdb'.
1350
The following is an example of FDB file.
1351
times__m.pfb type1/t/times__m.pfb
1352
times__m.afm type1/t/times__m.afm
1353
zac_____.ttf ttf/z/zac_____.ttf
1354
zalescap.ttf ttf/z/zalescap.ttf
1356
Suppose that this FDB file is located in `/foo/bar/', for instance. The
1357
file tells us that there is a file `times__m.pfb' and absolute path name
1358
of the file is `/foo/bar/type1/t/times__m.pfb'.
1360
If FDB file is found in a root directory of font directory, the FDB file
1361
is opened to find a requested font file. If a requested font file is
1362
not found, other font directory is searched, i.e., the directory is not
1363
traversed at all. In case FDB file is not found, a font directory is
1364
traversed to find a requested font file.
1366
It is important to remember that you must not forget to update FDB file
1367
after you added new font files in a font directory. If you forget,
1368
installed font files are not found evenif they are in a font directory.
1369
To update a FDB file, run the utility program `vflmkfdb'. See *Note
1370
vflmkfdb::, for details of the program.
1372
A FDB file must be located in a root of a font directory and its name
1373
must be `VFlib.fdb'. Even if there is a FDB file in a sub-directory of
1374
a font directory, VFlib does not look for it.
1380
File: VFlib-36.info, Node: Compressed font files, Next: Explicit and implicit fonts, Prev: Fast font file search, Up: Writing a vflibcap
1382
Compressed font files
1383
=====================
1385
To reduce disk storage, compressed font files and uncompression on the
1386
fly is supported by some font class. Note that this feature is font
1387
class dependent and not all font class support this.
1389
In a vflibcap file, a font file name need not have a compressed type
1390
extension, such as `.gz'. When VFlib searches a font file, it
1391
internally adds compressed type extension and finds a file.
1397
File: VFlib-36.info, Node: Explicit and implicit fonts, Next: Variables in vflibcap, Prev: Compressed font files, Up: Writing a vflibcap
1399
Explicit and implicit fonts
1400
===========================
1402
Fonts explicitly defined in a vflibcap file are called *explicit fonts*.
1403
Fonts does not appear vflibcap file and searched by font drivers on
1404
demand are called *implicit fonts*.
1409
File: VFlib-36.info, Node: Variables in vflibcap, Next: VFlib defaults, Prev: Explicit and implicit fonts, Up: Writing a vflibcap
1411
Variables in vflibcap
1412
=====================
1414
In a vflibcap file, variables can be used as capability values. A
1415
capability value can be a value of a variable if a dollar sign (`$')
1416
followed by a variable name is given.
1418
For instance, `(dpi $TeX_DPI)' can be used instead of `(dpi 300)'. The
1419
value for a variable must be defined somewhere. Default value can be
1420
given in `(define-default VFlib ...)', which will be explained later.
1422
Default values can be overridden on initialization function of VFlib
1423
`VF_Init()', or Unix environment variables `VFLIBCAP_PARAM_VAR'. For
1424
example, `VFLIBCAP_PARAM_TeX_DPI' is defined, its value becomes the
1425
value of the vflibcap variable `TeX_DPI'.
1427
The value of an environment variable `VFLIBCAP_PARAM_VAR' is parsed as
1428
an S-expression, not as an string. Thus, if you want to specify a
1429
string `ABC 123', the value of an environment variablue must be `\"abc
1430
123\"'. (Without double quotation, it will be a sequence of two
1431
strings. Only the first one is effective and the second one is
1436
File: VFlib-36.info, Node: VFlib defaults, Next: BDF font class, Prev: Variables in vflibcap, Up: Writing a vflibcap
1441
To specify global behavior of VFlib, (virtual) font class `VFlib' is
1444
The following capability are defined.
1446
`implicit-font-classes' (optional)
1447
--- A list of implicit font classes. Font classes listed by
1448
this capability is candidates for implicit font searching.
1450
example: `(implicit-font-classes "bdf" "pcf" "gf")'
1452
`extension-hints' (optional)
1453
--- A list of paris of font name postfix and corresponding font class name.
1454
This is hint information to find font class from a font name in
1455
case of searching an implicit font. If an implicit font name
1456
matches with a postfix given by this capability, specified font
1457
class is invoked to search an implicit font. This is effective to
1458
reduce time to search an implicit font.
1460
example: `(extension-hints (".pcf" pcf) (".bdf" bdf) ("gf" gf))'
1462
`variable-values' (optional)
1463
--- A list of pairs of a name of vflibcap variable and its default value.
1465
example: `(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE"
1466
"cx") (v ("p1" "v1")'
1468
`uncompression-programs' (optional)
1469
--- A list of pairs of file name extension and corresponding uncompression
1470
program. This is used for reading compressed font files. An
1471
uncompression program must output uncompressed data to standard
1474
This capability is just defines relations of an extension and an
1475
uncompression program. A list of supported compressed types of a
1476
font class is given in a font class default description of each
1479
example: `(uncompression-programs (".Z" "zcat") (".gz" "gzip -cd")'
1481
`code-conversion-files' (optional)
1482
--- A list of file names for encoding conversion.
1483
Currently, TrueType font class uses this. See *Note Code
1484
conversion system::.
1486
example: `(code-conversion-files "iso8859-1_unicode.ccv".ccv")'
1488
`use-kpathsea' (optional)
1489
--- A flag whether kpathsea is used or not to search TeX font files.
1490
Value of this capability must be one of `"Yes"' or `"No"'.
1492
example: `(use-kpathsea "Yes")'
1494
`kpathsea-mode' (optional)
1495
--- A device mode name for kpathsea library.
1497
example: `(kpathsea-mode "cx")'
1499
`kpathsea-dpi' (optional)
1500
--- Device resolution (in dpi) of a device mode for kpathsea library.
1502
example: `(kpathsea-mode 300)'
1504
`kpathsea-program-name' (optional)
1505
--- An application program name for kpathsea library.
1507
example: `(kpathsea-mode "xgdvi")'
1514
File: VFlib-36.info, Node: BDF font class, Next: PCF font class, Prev: VFlib defaults, Up: Writing a vflibcap
1519
The BDF format is a bitmap font format encoded in human-readable,
1520
platform independent format for distributing X Window fonts.
1522
This font class supports compressed font files and implicit fonts.
1525
Font class name: `bdf'
1528
Capabilities for font class default:
1531
`font-directories' (optional)
1532
--- A list of font directories for searching font files.
1533
Recursive searching of font files is support.
1535
`compression-extensions' (optional)
1536
--- A list of supported compression type for this font class.
1537
This font class supports only compression type given by this
1538
capability. When a font is searched, a file followed by a
1539
compression extension is searched if given font file is not found.
1540
(Note that `uncompression-programs' capability of VFlib class
1541
default description gives a uncompression programs.)
1543
example: `(compression-extensions ".gz" ".Z")'
1546
--- Defualt device resolution.
1547
Default horizontal and vertical resolutions will be the same value.
1549
example: `(dpi 300)'
1552
--- Default horizontal device resolution.
1554
example: `(dpi-x 300)'
1557
--- Default vertical device resolution.
1559
example: `(dpi-y 300)'
1561
`aspect-ratio' (optional)
1562
--- Aspect ratio of characters.
1563
If this value is 0.5 then width is half, and if 2 then width is
1566
example: `(aspect-ratio 0.8)'
1568
`properties' (optional)
1569
--- A list of pairs of a property name and its value.
1570
Property values given by this parameter is used by `VF_GetProp()'
1572
example: `(properties ("PROP-1" "value-1") ("PROP-2" "value-2"))'
1574
`variable-values' (optional)
1575
--- A list of pairs of a vflibcap variable name and its default value.
1577
example: `(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE"
1578
"cx") ("TeX_KPATHSEA_PROGRAM" "/usr/X11R6/xldvi"))'
1582
Capabilities for font definition:
1586
`font-class' (essential)
1587
--- A font class name. This value must be `bdf'.
1589
`font-directories' (optional)
1590
--- A list of font directories for searching font files.
1591
Recursive searching of font files is support. A font file is
1592
searched in the directories given by this capability.
1594
If this capability is not given, the font directory specified by
1595
the class default is used to search fonts. If this capability is
1596
given, the font directory specified by the class default is not
1597
used to search fonts.
1599
`font-file' (optional)
1600
--- A font file name string.
1601
If this capability is not specified, the font name is used as the
1602
font file name. Multiple font file names can be listed in this
1603
capability. The driver tries to open a font listed first. If it
1604
is impossible to open, then it tries to open the second font. This
1605
is repeated until a font is successfully opened. If all fonts are
1606
impossible to open, font open fails.
1608
example: `(font-file "timI24.bdf" "timR24.bdf")'
1610
`point-size' (optional)
1611
--- font size in points. If the size is different
1612
from the size defined in the BDF font file, the bitmap is enlarged
1613
or shrinked to yield the specified size. This capability has
1614
effect for the VFlib functions `VF_GetBitmap1()' and
1617
example: `(point-size 24.0)'
1619
`pixel-size' (optional)
1620
--- font size in pixels.
1621
If the size is different from the size defined in the BDF font
1622
file, the bitmap is enlarged or shrinked to yield the specified
1623
size. This capability has effect for the VFlib functions
1624
`VF_GetBitmap2()' and `VF_GetMetric2()'.
1626
example: `(pixel-size 24)'
1628
`magnification' (optional)
1629
--- magnification factor.
1630
The font is magnified by this factor.
1632
example: `(magnification 1.20)'
1634
`character-set' (optional)
1635
--- This is used for code point conversion.
1636
Value of this capability gives an external view of a character set
1637
of a font. Code conversion (ccv) is determined by this value and
1638
the following three capabilities.
1640
`encoding' (optional)
1641
--- This is used for code point conversion.
1642
Value of this capability gives an external view of an encoding of a
1645
`font-character-set' (optional)
1646
--- This is used for code point conversion.
1647
Value of this capability gives an internal view of a character set
1648
of a font. Therefore, this value must match the character set of
1649
the font file given by `font-file' capability.
1651
`font-encoding' (optional)
1652
--- This is used for code point conversion.
1653
Value of this capability gives an internal view of an encoding of a
1654
font. Therefore, this value must match the encoding of the font
1655
file given by `font-file' capability.
1657
The following example defines a font named `iso8859_5-font' with
1658
ISO-8859-5 encoding by using a KOI8-R encoded font file.
1660
(define-font iso8859_5-font
1662
(character-set "ISO8859-5") (encoding "ISO")
1663
(font-character-set "KOI8-R") (font-encoding "KOI8-R")
1664
(font-file "koi8x13.pcf"))
1666
Code conversion is done by a subsystem named CCV. See *Note Code
1667
conversion system:: for detail.