Info file: VFlib-36.info,    -*-Text-*-
produced by `texinfo-format-buffer'
from file `VFlib-36.texi'
using `texinfmt.el' version 2.38 of 3 July 1998.





 




File: VFlib-36.info, Node: Functions and variables, Next: Building an application software with VFlib, Prev: Data types, Up: Programming with VFlib

Functions and variables
=======================


* Menu:

Initialization
* VF_Init()::

Errors
* vf_error::
* VF_ClearError()::

Font open and close
* VF_OpenFont1()::
* VF_OpenFont2()::
* VF_CloseFont()::

Bitmaps and metrics
* VF_GetBitmap1()::
* VF_GetBitmap2()::
* VF_GetMetric1()::
* VF_GetMetric2()::

Outline
* VF_GetOutline()::
* VF_OutlineToBitmap()::

Font information
* VF_GetFontBoundingBox1()::
* VF_GetFontBoundingBox2()::
* VF_GetProp()::

Bitmap operations
* VF_CopyBitmap()::
* VF_MakeScaledBitmap()::
* VF_ReflectedBitmap()::
* VF_RotatedBitmap()::
* VF_DumpBitmap()::

Writing a bitmap to file
* VF_ImageOut_PBMAscii()::
* VF_ImageOut_PGMAscii()::
* VF_ImageOut_PGMRaw()::
* VF_ImageOut_EPS()::
* VF_ImageOut_ASCIIArt()::
* VF_ImageOut_ASCIIArtV()::

Releasing data objects
* VF_FreeBitmap()::
* VF_FreeMetric1()::
* VF_FreeMetric2()::

Installing a font driver
* VF_InstallFontDriver()::




File: VFlib-36.info, Node: VF_Init(), Next: vf_error, Up: Functions and variables

`VF_Init()'
-----------

     int  VF_Init(char* VFLIBCAP, char* VARIABLE_LIST)

Functionality
       Initialization of VFlib.

Arguments
      VFLIBCAP is a file name of vflibcap (this file is a font
     database).  If the null pointer is given, the default path name
     given on compile time is used (a typical default value is
     `/usr/local/lib/VFlib/3.6.14/vflibcap').  Searching of a vflibcap
     file is done in the following way.  First, VFlib try to open a
     file as given to the first argument.  (That is, VFlib searches it
     relative to current working directory.)  If not found, then VFlib
     try to open the file under default runtime directory (e.g.,
     `/usr/local/lib/VFlib/3.6.14/').  For example, `vflibcap-tex' is
     given, VFlib first look for `vflibcap-tex' in current directory,
     and then, it looks for the file under runtime directory.

      Default runtime directory can be changed by an environment
     variable `VFLIB_RUNTIME_DIRECTORY' on runtime.  If an environment
     variable `VFLIB_VFLIBCAP_PATH' is set, the first argument of this
     function is ignored and its value is used.  If an environment
     variable `VFLIB_VFLIBCAP_DIRECTORY' is set, a vflibcap file is
     searched under a directory sepecified by this environment
     variable.

      VARIABLE_LIST is a list of parameters passed to VFlib.  This is
     used to specify values of parameterized vflibcap files.  (See
     basic.txt for parameterized vflibcap file.)  The type of this
     argument is a string and its syntax is a sequence of
     VARIABLE=VALUE, separated by a comma `,'.  For example, `DPI=400,
     LEVEL=1, FOO=bar'.

Return value
      If initialization succeeds, a non-negative integer is returned.
     If initialization fails, a negative integer is returned.




File: VFlib-36.info, Node: vf_error, Next: VF_ClearError(), Prev: VF_Init(), Up: Functions and variables

`vf_error'
----------

     int  vf_error 

Functionality
      This is a global variable.  Holding the error code of VFlib.  If
     no error, it keeps 0.  If an error occurs, the corresponding
     error code is set.



File: VFlib-36.info, Node: VF_ClearError(), Next: VF_OpenFont1(), Prev: vf_error, Up: Functions and variables

`VF_ClearError()'
-----------------

     void  VF_ClearError(void)

Functionality
      Clear the error code variable of VFlib.




File: VFlib-36.info, Node: VF_OpenFont1(), Next: VF_OpenFont2(), Prev: VF_ClearError(), Up: Functions and variables

`VF_OpenFont1()'
----------------

     int  VF_OpenFont1(char* FONT_NAME,
                       double DPI_X, double DPI_Y, double POINT_SIZE, 
                       double MAG_X, double MAG_Y)

Functionality
      Open a font.  (If the same font is opened multiple times, VFlib
     keeps track of the number of opened font instances of the font.)
     Since the font is opened with device resolution, point size and
     magnification, a font opened by this function may be useful for
     high resolution devices such as laser printers.

Arguments
      The argument FONT_NAME is a name of the font to be opened.  The
     device resolution of the target device is specified by DPI_X
     (horizontal) DPI_Y (vertical).  These values are given in DPI
     (dots per inch).  The argument POINT_SIZE specifies the size of
     the bitmap.  If this argument is negative the bitmap size will be
     the inherent size of the font.

      To obtain a magnified bitmap, give a magnification factor to the
     argument MAG_X (horizontal) and MAG_Y (vertical).  If the
     argument POINT_SIZE is non-negative, font size will be POINT_SIZE
     times MAG_X (MAG_Y) large for horizontal (vertical) direction.

Return Value
      A non-negative integer is returned on success.  This value is a
     font identifier (font id); it is used to specify a font for
     further font operations.  If `VF_OpenFont1()' fails, a negative
     integer is returned.




File: VFlib-36.info, Node: VF_OpenFont2(), Next: VF_CloseFont(), Prev: VF_OpenFont1(), Up: Functions and variables

`VF_OpenFont2()'
----------------

     int  VF_OpenFont2(char* FONT_NAME,
                       int PIXEL_SIZE, double MAG_X, double MAG_Y)

Functionality
      Open a font.  (If the same font is opened multiple times, VFlib
     keeps track of the number of opened font instances of the font.)
     Since the font is opened with pixel size and magnification, a
     font opened by this function may be useful for low resolution
     devices such as CRT display.

Arguments
      The argument FONT is a name of the font to be opened.  The
     argument PIXEL_SIZE specifies the size of the bitmap.  If this
     argument is negative the bitmap size will be the inherent size of
     the font.  To obtain a magnified bitmap, give a magnification
     factor to the argument MAG_X (horizontal) and MAG_Y (vertical).
     If the argument POINT_SIZE is non-negative, font size will be
     PIXEL_SIZE times MAG_X (MAG_Y) large for horizontal (vertical)
     direction.

Return Value
      A non-negative integer is returned on success.  This value is a
     font identifier (font id); it is used to specify a font for
     further font operations.  If `VF_OpenFont2()' fails, a negative
     integer is returned.




File: VFlib-36.info, Node: VF_CloseFont(), Next: VF_GetBitmap1(), Prev: VF_OpenFont2(), Up: Functions and variables

`VF_CloseFont()'
----------------

     int  VF_CloseFont(int FONT_ID)

Functionality
      Close a font.

Arguments
      The argument FONT_ID is a font id to be closed.

Return Value
      A non-negative integer is returned on success.  A negative
     integer is returned on failure.




File: VFlib-36.info, Node: VF_GetBitmap1(), Next: VF_GetBitmap2(), Prev: VF_CloseFont(), Up: Functions and variables

`VF_GetBitmap1()'
-----------------

     VF_BITMAP  VF_GetBitmap1(int FONT_ID, long CODE_POINT,
                              double MAG_X, double MAG_Y)

Functionality
       Obtain a glyph bitmap of given font id and code point.  The
     font id FONT_ID must be an id by `VF_OpenFont1()'.  Size of
     bitmap to be obtained can be specified by MAG_X and MAG_Y
     arguments.

Arguments
      FONT_ID specifies the font; CODE_POINT specifies the code point
     of a character.  To obtain a magnified bitmap, give a
     magnification factor to the argument MAG_X (horizontal) and MAG_Y
     (vertical).  If a font is opened with magnification factor 2 and
     an bitmap is obtained by this function with magnification factor
     2, then the size of yielding bitmap will be 4 times larger than
     the original size.

Return Value
       The return value is a pointer to a newly allocated bitmap
     object.  If it fails to obtain a bitmap, the null pointer is
     returned.  If the bitmap object is no longer needed, it must be
     released by the function `VF_FreeBitmap()'.  The font may not
     have the specified size; in such case, VFlib internally enlarges
     or shrinks the glyph to obtain a bitmap of the requested size.




File: VFlib-36.info, Node: VF_GetBitmap2(), Next: VF_GetMetric1(), Prev: VF_GetBitmap1(), Up: Functions and variables

`VF_GetBitmap2()'
-----------------

     VF_BITMAP  VF_GetBitmap2(int FONT_ID, long CODE_POINT,
                              double MAG_X, double MAG_Y)

Functionality
      Obtain a glyph bitmap of given font id and code point.  The font
     id 'font_id' must be an id by `VF_OpenFont2()'.  Size of bitmap
     to be obtained can be specified by PIXEL_SIZE, MAG_X and MAG_Y
     arguments.

Arguments
      FONT_ID specifies the font; CODE_POINT specifies the code point
     of a character.  To obtain a magnified bitmap, give a
     magnification factor to the argument MAG_X (horizontal) and MAG_Y
     (vertical).  If a font is opened with magnification factor 2 and
     an bitmap is obtained by this function with magnification factor
     2, then the size of yielding bitmap will be 4 times larger than
     the original size.

Return Value
      The return value is a pointer to a newly allocated bitmap
     object.  If it fails to obtain a bitmap, the null pointer is
     returned.  If the bitmap object is no longer needed, it must be
     released by the function `VF_FreeBitmap()'.  The font may not
     have the specified size; in such case, VFlib internally enlarges
     or shrinks the glyph to obtain a bitmap of the requested size.




File: VFlib-36.info, Node: VF_GetMetric1(), Next: VF_GetMetric2(), Prev: VF_GetBitmap2(), Up: Functions and variables

`VF_GetMetric1()'
-----------------

     VF_METRIC1  VF_GetMetric1(int FONT_ID, long CODE_POINT,
                               VF_METRIC1 METRIC1,
                               double MAG_X, double MAG_Y)

Functionality
      Obtain font metrics of a given font and code point.

Arguments
       Same arguments as of `VF_GetBitmap1()'.

Return Value
       A pointer to a metric1 object is returned.  If an error occurs,
     the NULL pointer is returned.  The obtained metric is a metric
     for a bitmap obtained by `VF_GetBitmap1()' with the same
     arguments, but the unit of the obtained metric is point. If the
     metric1 object is no longer needed it must be released by the
     function `VF_FreeMetric1()'.




File: VFlib-36.info, Node: VF_GetMetric2(), Next: VF_GetOutline(), Prev: VF_GetMetric1(), Up: Functions and variables

`VF_GetMetric2()'
-----------------

     VF_METRIC2  VF_GetMetric2(int FONT_ID, long CODE_POINT,
                               VF_METRIC2 METRIC2,
                               double MAG_X, double MAG_Y)

Functionality
      Obtain font metrics of a given font and code point.

Arguments
      Same arguments as of `VF_GetBitmap2()'.

Return Value
       A pointer to a metric2 object is returned.  If an error occurs,
     the NULL pointer is returned.  The obtained metric is a metric
     for a bitmap obtained by `VF_GetBitmap2()' with the same
     arguments, but the unit of the obtained metric is pixel.  If the
     metric2 object is no longer needed, it must be released by the
     function `VF_FreeMetric2()'.




File: VFlib-36.info, Node: VF_GetOutline(), Next: VF_OutlineToBitmap(), Prev: VF_GetMetric2(), Up: Functions and variables

`VF_GetOutline()'
-----------------

     VF_OUTLINE  VF_GetOutline(int FONT_ID, long CODE_POINT,
                               double MAG_X, double MAG_Y)

Functionality
      Obtain outline data from a given font and code point.

Arguments
      Same as `VF_GetBitmap1()'.

Return Value
       Return value is a pointer to a newly allocated outline data
     object.  If it fails to obtain a outline data, the NULL pointer
     is returned.  Even if the original font is a bitmap, VFlib
     internally creates outline data from the bitmap.  If the source
     font is a vector font, VFlib internally converts the data format
     to VFlib outline data style.  A bitmap of any specified size can
     be obtained from outline data by the function
     `VF_Outline2Bitmap()'.  (Default point size and device resolution
     is also kept in the outline data.)




File: VFlib-36.info, Node: VF_OutlineToBitmap(), Next: VF_GetFontBoundingBox1(), Prev: VF_GetOutline(), Up: Functions and variables

`VF_OutlineToBitmap()'
----------------------

     VF_OUTLINE  VF_OutlineToBitmap(VF_OUTLINE OUTLINE,
                                    double DPI_X, double DPI_Y, 
                                    double POINT_SIZE,
                                    double MAG_X, double MAG_Y)

Functionality
      Obtain a bitmap from outline data.

Arguments
      The argument OUTLINE is a pointer to an outline object to be
     rasterised.  The arguments DPI_X, DPI_Y, POINT_SIZE, MAG_X and
     MAG_Y are the same as the corresponding arguments of
     `VF_GetBitmap1()'.  The outline data contains information on
     device resolution and point size specified by `VF_GetOutline()'.
     (If not specified, default values are used. Thus, bitmaps with a
     default size can be obtained by giving -1 for the arguments).

Return Value
       A pointer to a bitmap object is returned.  The NULL pointer is
     returned on failure.  If the bitmap object is no longer needed it
     must be released by the function `VF_FreeBitmap()'.




File: VFlib-36.info, Node: VF_GetFontBoundingBox1(), Next: VF_GetFontBoundingBox2(), Prev: VF_OutlineToBitmap(), Up: Functions and variables

`VF_GetFontBoundingBox1()'
--------------------------

     int  VF_GetFontBoundingBox1(int FONT_ID, 
                                 double MAG_X, double MAG_Y,
                                 double* W, double* H,
                                 double* XOFF, double* YOFF)

Functionality
      Obtain font bounding box information of a given font.

Arguments
      The argument FONT_ID specify a font in interest.  The function
     writes the bounding box information to the locations pointed by
     W, H, XOFF, and YOFF.  W and H point to data objects for width
     and height of bounding box, respectively.  XOFF and YOFF point to
     data objects for largest horizontal and vertical displacement of
     lower left corner of bounding box from reference points.  Note
     that these values does not guarantee the minimality; they only
     guarantee that all characters can be contained in a box descrived
     by them.  If some values of W, H, XOFF, or YOFF are not in
     interest, NULL pointer can be given.

      The argument MAG_X and MAG_Y are maginification factor to be
     scaled for a given font FONT_ID.

Return Value
       If font bounding information is successfully obtained, a
     non-negative integer is returned; otherwize, negative integer is
     returned.

      Units of bounding box information is in point.





File: VFlib-36.info, Node: VF_GetFontBoundingBox2(), Next: VF_GetProp(), Prev: VF_GetFontBoundingBox1(), Up: Functions and variables

`VF_GetFontBoundingBox2()'
--------------------------

     int  VF_GetFontBoundingBox2(int FONT_ID, 
                                 double MAG_X, double MAG_Y,
                                 int* W, int* H,
                                 int* XOFF, int* YOFF)

Same as `VF_GetFontBoundingBox1()' except units of font bounding box
parameters are pixel.




File: VFlib-36.info, Node: VF_GetProp(), Next: VF_CopyBitmap(), Prev: VF_GetFontBoundingBox2(), Up: Functions and variables

`VF_GetProp()'
--------------

     char*  VF_GetProp(int FONT_ID, char* PROP_NAME)

Functionality
      Obtain a property of given font.  (This function is font class
     dependent. You must be very careful to use it!)

Arguments
      The argument FONT_ID specifies a font from which to obtain a
     property. PROPERTY_NAME specifies the property name.

Return Value
      If the given property exists, its value is returned as a string.
     The string for the property value is newly allocated and must be
     released by FREE() if it is no longer needed.  If the given
     property is undefined, the NULL pointer is returned.




File: VFlib-36.info, Node: VF_CopyBitmap(), Next: VF_MakeScaledBitmap(), Prev: VF_GetProp(), Up: Functions and variables

`VF_CopyBitmap()'
-----------------

     VF_BITMAP  VF_CopyBitmap(VF_BITMAP BM)

Functionality
      Make a copy of a bitmap object.

Arguments
      The argument BM is a pointer to a bitmap object to be copied.

Return Value
      A new bitmap object is allocated; all values are copied.  Return
     value is a pointer to a new bitmap.  The source bitmap BM remains
     unaffected.  If an error occurs, the NULL pointer is returned.
     The obtained bitmap object must be released by `VF_FreeBitmap()'
     if it is no longer needed.




File: VFlib-36.info, Node: VF_MakeScaledBitmap(), Next: VF_ReflectedBitmap(), Prev: VF_CopyBitmap(), Up: Functions and variables

`VF_MakeScaledBitmap()'
-----------------------

     VF_BITMAP  VF_MakeScaledBitmap(VF_BITMAP BM, 
                                    double MAG_X, double MAG_Y)

Functionality
      Make an enlarged or shrinked bitmap.

Arguments
      The argument BM specifies the source bitmap object, MAG_X and
     MAG_Y give the magnification factor in the horizontal and
     vertical direction respectively.  If the magnification factor is
     less than 1, a shrinked bitmap is obtained.  Values for MAG_X and
     MAG_Y can be arbitrary such as (MAG_X > 1 and MAG_Y < 1) or
     (MAG_X < 1 and MAG_Y > 1).

Return Value
      A bitmap object whose bitmap is enlarged or shrinked is created
     and a pointer to the new bitmap is returned.  If an error occurs,
     the NULL pointer is returned.  The source bitmap BM remains
     unaffected.  Use `VF_FreeBitmap()' if the returned bitmap object
     is no longer necessary.




File: VFlib-36.info, Node: VF_ReflectedBitmap(), Next: VF_RotatedBitmap(), Prev: VF_MakeScaledBitmap(), Up: Functions and variables

`VF_ReflectedBitmap()'
----------------------

     VF_BITMAP  VF_ReflectedBitmap(VF_BITMAP BM, 
                                   int REFL_X, double REFL_Y)

Functionality
      Make a bitmap with horizontally and/or vertically reflected
     image.

Arguments
      The argument BM specifies the source bitmap object, REFL_X and
     REFL_Y specify the reflection, respectively.  If REFL_X is
     non-zero, the image is holizontally reflected; if REFL_Y is
     non-zero, the image is vertically reflected.  In case RELF_X and
     REFL_Y are both zero, the effect is the same as
     `VF_CopyBitmap()'.

Return Value
      A new bitmap object is created and a pointer to the new bitmap
     is returned.  If an error occurs, the NULL pointer is returned.
     Metrics of created bitmap is the same as that of the original
     bitmap.  The source bitmap BM remains unaffected.  Use
     `VF_FreeBitmap()' if the returned bitmap object is no longer
     necessary.




File: VFlib-36.info, Node: VF_RotatedBitmap(), Next: VF_DumpBitmap(), Prev: VF_ReflectedBitmap(), Up: Functions and variables

`VF_RotatedBitmap()'
--------------------

     VF_BITMAP  VF_RotatedBitmap(VF_BITMAP BM, int ANGLE)

Functionality
      Make a bitmap image with rotated image.

Arguments
      The argument BM specifies the source bitmap object, ANGLE gives
     rotation angle in degree.  By the limitation of implementation,
     rotatin angle must be multiple of 90.  The rotation angle ANGLE
     must be one of the following:
     `VF_BM_ROTATE_0'
            Rotation angle is zero.  Thus, the effect is the same as
          `VF_CopyBitmap()'.
     `VF_BM_ROTATE_90'
            Rotation angle is 90 degree.
     `VF_BM_ROTATE_180'
            Rotation angle is 180 degree.
     `VF_BM_ROTATE_270'
            Rotation angle is 270 degree.

Return Value
      A bitmap object whose bitmap is rotated is created and a pointer
     to the new bitmap is returned.  If an error occurs, the NULL
     pointer is returned.  The source bitmap BM remains unaffected.
     Use `VF_FreeBitmap()' if the bitmap object is no longer
     necessary.

      This function rotates a bitmap with the reference point as
     origin.  The vector to the next reference point is also rotated.
     Therefore, position of the reference point and a vector to the
     next reference point of `VF_RotatedBitmap(BM, VF_BM_ROTATE_180)'
     and that of `VF_ReflectedBitmap(BM, 1, 1)' are different.




File: VFlib-36.info, Node: VF_DumpBitmap(), Next: VF_ImageOut_PBMAscii(), Prev: VF_RotatedBitmap(), Up: Functions and variables

`VF_DumpBitmap()'
-----------------

     void  VF_DumpBitmap(VF_BITMAP BM)

Functionality
      Print a bitmap in ASCII-art-style to stdout.

Arguments
      The argument BM specifies a bitmap to be displayed.





File: VFlib-36.info, Node: VF_ImageOut_PBMAscii(), Next: VF_ImageOut_PGMAscii(), Prev: VF_DumpBitmap(), Up: Functions and variables

`VF_ImageOut_PBMAscii()'
------------------------

     int  VF_ImageOut_PBMAscii(VF_BITMAP BM, FILE *FP, 
                               int IMAGE_WIDTH, int IMAGE_HEIGHT,
                               int POSITION_X, int POSITION_Y, 
                               int MARGIN_L, int MARGIN_R,
                               int MARGIN_T, int MARGIN_B,
                               int REVERSE, int SHRINK,
                               char *PROG, char *TITLE)

Functionality
      Print a bitmap BM in PBM ASCII format to a file stream FP.

Arguments
      BM is a bitmap to be written to a file stream FP.  Size of
     output image (in pixel) is specified by IMAGE_WIDTH and
     IMAGE_HEIGHT.  If -1 is given for these arguments, the image size
     should be minimum to contain the bitmap BM.

     Arguments POSITION_X and POSITION_Y specifies the horizontal and
     vertical position of a source bitmap BM in an output image file,
     respectively.  These parameters have effect when IMAGE_WIDTH and
     IMAGE_HEIGHT are specified.  Possible values for POSITION_X is
     `VF_IMAGEOUT_POSITION_NONE'
            Same as `VF_IMAGEOUT_POSITION_LEFT'.
     `VF_IMAGEOUT_POSITION_CENTER'
            BM is centered in output image.
     `VF_IMAGEOUT_POSITION_LEFT'
            BM is flushed left in output image.
     `VF_IMAGEOUT_POSITION_RIGHT'
            BM is flushed righted in output image.

     Possible values for POSITION_Y is
     `VF_IMAGEOUT_POSITION_NONE'
            Same as `VF_IMAGEOUT_POSITION_TOP'.
     `VF_IMAGEOUT_POSITION_CENTER'
            BM is centered in output image.
     `VF_IMAGEOUT_POSITION_TOP'
            BM is placed at the top in output image.
     `VF_IMAGEOUT_POSITION_BOTTOM'
            BM is placed at the bottom in output image.

     Arguments MARGIN_L, int MARGIN_R are used to speficy left and
     right margins, respectively.  Arguments MARGIN_T, int MARGIN_B
     are used to speficy top and bottom margins, respectively.

     If the argument REVERSE is not 0, black and white in an output
     image is reversed.  Argument SHRINK specifys shrink factor of
     image BM.  (If this value is 1, BM is not shrinked.  Note:
     Currently, shrinking image is not supported in PBM ASCII format.)

     Arguments PROG and TITLE are used to emmbed program name and
     title in an image file.





File: VFlib-36.info, Node: VF_ImageOut_PGMAscii(), Next: VF_ImageOut_PGMRaw(), Prev: VF_ImageOut_PBMAscii(), Up: Functions and variables

`VF_ImageOut_PGMAscii()'
------------------------

     int  VF_ImageOut_PGMAscii(VF_BITMAP BM, FILE *FP, 
                               int IMAGE_WIDTH, int IMAGE_HEIGHT,
                               int POSITION_X, int POSITION_Y, 
                               int MARGIN_L, int MARGIN_R,
                               int MARGIN_T, int MARGIN_B,
                               int REVERSE, int SHRINK,
                               char *PROG, char *TITLE)

Functionality
      Print a bitmap BM in PGM ASCII format to a file stream FP.

Arguments
      Arguments are the same as that of `VF_ImageOut_PGMAscii()'.  If
     SHRINK is greater than 1, output image is anti-aliased
     (gray-scaled).




File: VFlib-36.info, Node: VF_ImageOut_PGMRaw(), Next: VF_ImageOut_EPS(), Prev: VF_ImageOut_PGMAscii(), Up: Functions and variables

`VF_ImageOut_PGMRaw()'
----------------------

     int  VF_ImageOut_PGMRaw(VF_BITMAP BM, FILE *FP, 
                             int IMAGE_WIDTH, int IMAGE_HEIGHT,
                             int POSITION_X, int POSITION_Y, 
                             int MARGIN_L, int MARGIN_R,
                             int MARGIN_T, int MARGIN_B,
                             int REVERSE, int SHRINK,
                             char *PROG, char *TITLE)

Functionality
      Print a bitmap BM in PGM Raw format to a file stream FP.

Arguments
      Arguments are the same as that of `VF_ImageOut_PGMAscii()'.  If
     SHRINK is greater than 1, output image is anti-aliased
     (gray-scaled).




File: VFlib-36.info, Node: VF_ImageOut_EPS(), Next: VF_ImageOut_ASCIIArt(), Prev: VF_ImageOut_PGMRaw(), Up: Functions and variables

`VF_ImageOut_EPS()'
-------------------

     int  VF_ImageOut_EPS(VF_BITMAP BM, FILE *FP, 
                          int IMAGE_WIDTH, int IMAGE_HEIGHT,
                          int POSITION_X, int POSITION_Y, 
                          int MARGIN_L, int MARGIN_R,
                          int MARGIN_T, int MARGIN_B,
                          int REVERSE, int SHRINK,
                          char *PROG, char *TITLE,
                          double PTSIZE, int PIXSIZE)

Functionality
      Print a bitmap BM in EPS (Encapsulated PostScript) format to a
     file stream FP.

Arguments
      Arguments are the same as that of `VF_ImageOut_PGMAscii()'.  If
     SHRINK is greater than 1, output image is anti-aliased
     (gray-scaled).  Arguments PTSIZE and PIXSIZE specify size of EPS
     bounding box; PIXSIZE pixels occupy PTSIZE points in physical
     paper.



File: VFlib-36.info, Node: VF_ImageOut_ASCIIArt(), Next: VF_ImageOut_ASCIIArtV(), Prev: VF_ImageOut_EPS(), Up: Functions and variables

`VF_ImageOut_ASCIIArt()'
------------------------

     int  VF_ImageOut_ASCIIArt(VF_BITMAP BM, FILE *FP, 
                               int IMAGE_WIDTH, int IMAGE_HEIGHT,
                               int POSITION_X, int POSITION_Y, 
                               int MARGIN_L, int MARGIN_R,
                               int MARGIN_T, int MARGIN_B,
                               int REVERSE, int SHRINK)

Functionality
      Print a bitmap BM in ASCII art format to a file stream FP.

Arguments
      Arguments are the same as that of `VF_ImageOut_PGMAscii()'.




File: VFlib-36.info, Node: VF_ImageOut_ASCIIArtV(), Next: VF_FreeBitmap(), Prev: VF_ImageOut_ASCIIArt(), Up: Functions and variables

`VF_ImageOut_ASCIIArtV()'
-------------------------

     int  VF_ImageOut_ASCIIArtV(VF_BITMAP BM, FILE *FP, 
                                int IMAGE_WIDTH, int IMAGE_HEIGHT,
                                int POSITION_X, int POSITION_Y, 
                                int MARGIN_L, int MARGIN_R,
                                int MARGIN_T, int MARGIN_B,
                                int REVERSE, int SHRINK)

Functionality
      Print a bitmap BM in ASCII art format to a file stream FP.
     Image is rotated in clockwise, 90 degree.

Arguments
      Arguments are the same as that of `VF_ImageOut_PGMAscii()'.




File: VFlib-36.info, Node: VF_FreeBitmap(), Next: VF_FreeMetric1(), Prev: VF_ImageOut_ASCIIArtV(), Up: Functions and variables

`VF_FreeBitmap()'
-----------------

     void  VF_FreeBitmap(VF_BITMAP BM)

Functionality
      Release a bitmap object.

Arguments
      The argument BM is a pointer to a bitmap object to be released.
       




File: VFlib-36.info, Node: VF_FreeMetric1(), Next: VF_FreeMetric2(), Prev: VF_FreeBitmap(), Up: Functions and variables

`VF_FreeMetric1()'
------------------

     void  VF_FreeMetric1(VF_METRIC1 METRIC)

Functionality
      Release a metric1 object.

Arguments
      The argument METRIC is a pointer to a metric1 object.




File: VFlib-36.info, Node: VF_FreeMetric2(), Next: VF_InstallFontDriver(), Prev: VF_FreeMetric1(), Up: Functions and variables

`VF_FreeMetric2()'
------------------

     void  VF_FreeMetric2(VF_METRIC2 METRIC)

Functionality
      Release a metric2 object.

Arguments
      The argument METRIC is a pointer to a metric2 object.





File: VFlib-36.info, Node: VF_InstallFontDriver(), Prev: VF_FreeMetric2(), Up: Functions and variables

`VF_InstallFontDriver()'
------------------------

     int  VF_InstallFontDriver(char* CLASS_NAME, 
                               int(*driver)(VF_FONT FONT, 
                                            char* CLASS_NAME,
                                            char* FONT_NAME,
                                            int IMPLICIT_FLAG));

Functionality
      Install a font driver.

Arguments
     CLASS_NAME is a font class name, DRIVER is a pointer to a
     function of a font driver of the font class.  The function given
     by DRIVER is called when a font of this font class is opened by
     `VF_OpenFont1()' and `VF_OpenFont2()'.  The function DRIVER is
     called with parameters of the font to be opened: FONT is a data
     object for font management defined by VFlib internally.
     CLASS_NAME is the font class name.  FONT_NAME is the name of the
     font to be opened.  This argument is the same as the argument of
     `VF_OpenFont1()' and `VF_OpenFont2()'.  IMPLICIT_FONT is a flag
     whose value is 1 if a font is to be opened as an implicit font (a
     font which does not explicitly appear in vflibcap) and 0 if it is
     to be opened as an explicit font (a font that does appear in
     vflibcap).

Return Value
     If successful, a non-negative integer is returned.  A negative
     integer is returned if the installation of the font driver fails.





File: VFlib-36.info, Node: Building an application software with VFlib, Next: A simple example, Prev: Functions and variables, Up: Programming with VFlib

Building an application software with VFlib
===========================================

An application software that use VFlib must include a header file
`VFlib-3_6.h'.  Typically, this file is installed
`/usr/local/include/' directory.

Never forget, that application software that uses VFlib must be linked
against FreeType 1.2 or later (`libttf.a' or `libttf.so'), T1Lib 5.1
or later (`libt1.a' or `libt1.so'), and kpathsea 3.2 (`libkpathsea.a'
or `libkpathsea.so'), if you configure VFlib to use them.  (If VFlib
is configured not to use them, they are not necessary.)

I recommend shared library versions for these optional libraries if
you built a shared library version of VFlib.


     #include <VFlib-3_6.h>

VFlib must be initialized before it is used.

     char* vflibcap = "vflibcap";
     char* params =  "TeX_DPI=300, KPATHSEA_MODE=cx";

     if (VF_Init(vflibcap, params) < 0){
       fprintf(stderr, "Initializing VFlib: failed\n");
       exit(1);
     }

Following program fragment opens a font, obtains a bitmap, and print
obtained bitmap.

     int         fid;
     VF_BITMAP   bm;

     if ((fid = VF_OpenFont2("timR24.pcf", -1, 1.0, 1.0)) < 0){
       fprintf(stderr, "Opening font: failed\n");
       exit(1);
     }

     bm = VF_GetBitmap2(fid, 0x67, 1.0, 1.0);

     VF_DumpBitmap(bm);




File: VFlib-36.info, Node: A simple example, Prev: Building an application software with VFlib, Up: Programming with VFlib

A simple example
================

The following program code is a "banner" like using VFlib.  For
simplicity, this program accepts only 1-byte encoded characters.  It
reads an input from standard input and prints characters in ascii-art
form to standard output.

     /* 
      * vflbanner.c - a banner by VFlib
      * by Hirotsugu Kakugawa
      *
      *
      */
     /*
      * Copyright (C) 1998 Hirotsugu Kakugawa. 
      * All rights reserved.
      *
      * This program is free software; you can redistribute it and/or modify
      * it under the terms of the GNU General Public License as published by
      * the Free Software Foundation; either version 2, or (at your option)
      * any later version.
      * 
      * This program is distributed in the hope that it will be useful,
      * but WITHOUT ANY WARRANTY; without even the implied warranty of
      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      * GNU General Public License for more details.
      * 
      * You should have received a copy of the GNU General Public License
      * along with this program; if not, write to the Free Software
      * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
      */

     #include "config.h"
     #include <stdio.h>
     #include <stdlib.h>
     #include <ctype.h>
     #include "VFlib-3_6.h"

     #define  DEFAULT_FONT  "timR18.pcf"


     char    *vflibcap;
     char    *fontname;

     void  usage(void);
     void  vflbanner(FILE *fp);


     int
     main(int argc, char **argv)
     {
       vflibcap = NULL;
       fontname = DEFAULT_FONT;

       --argc; argv++;
       while (argc > 0){
         if ((argc >= 1)
             && ((strcmp(argv[0], "-h") == 0) || (strcmp(argv[0], "--help") == 0))){
           usage();
           exit(0);
         } else if ((argc >= 2) && (strcmp(argv[0], "-v") == 0)){
           --argc; argv++;
           vflibcap = argv[0];
           --argc; argv++;
         } else if ((argc >= 2) && (strcmp(argv[0], "-f") == 0)){
           --argc; argv++;
           fontname = argv[0];
           --argc; argv++;
         } else {
           break;
         }
       }

       vflbanner(stdin);

       return 0;
     }

     void usage(void)
     {
       printf("vflbanner - a banner program using VFlib\n");
       printf("Usage: vflbanner [-v vflibcap] [-f fontname]\n"); 
       printf("This program reads a text from standard input.  It supports\n");
       printf("1-bit encoded font only. Thus, `ctextpgm' is better than this.\n");
     }


     void
     vflbanner(FILE  *fp)
     {
       int  fid;
       int  ch; 
       int  pos_x, pos_y; 
       VF_BITMAP  bm, page_bm;
       struct vf_s_bitmaplist  PageBuff;

       if (VF_Init(vflibcap, NULL) < 0){
         printf("VFlib initialization error");
         switch (vf_error){
         case VF_ERR_INTERNAL:
           printf(" - Internal error.\n"); break;
         case VF_ERR_NO_MEMORY:
           printf(" - Server runs out of memory.\n"); break;
         case VF_ERR_NO_VFLIBCAP:
           printf(" -  No vflibcap.\n"); break;
         default: 
           printf(" -  Error code %d\n", vf_error); break;
         }
         fflush(stdout);
         exit(1);
       }

       if ((fid = VF_OpenFont1(fontname, -1, -1, -1, 1, 1)) < 0)
         return;
    
       VF_BitmapListInit(&PageBuff);

       pos_x = pos_y = 0; 
       while ((ch = getc(fp)) != EOF){
         if (!isprint(ch))
           ch = ' ';
         if ((bm = VF_GetBitmap1(fid, (long)ch, 1, 1)) == NULL)
           continue;
         VF_BitmapListPut(&PageBuff, bm, pos_x, pos_y);
         pos_x = pos_x + bm->mv_x;
       }

       page_bm = VF_BitmapListCompose(&PageBuff);
       VF_DumpBitmap(page_bm);
       VF_BitmapListFinish(&PageBuff);
       VF_FreeBitmap(page_bm);

       VF_CloseFont(fid);
     }

     /*EOF*/


By the following commands is used to comple the program.

     % gcc -c `VFlib3-config --cflags` vflbanner.c
     % gcc -o vflbanner vflbanner.o `VFlib3-config --libs` 

`VFlib3-config' is a program to print misc information on
configuration of VFlib. It prints C compiler option to specify include
directory (`--cflags'), dependent libraries (`--libs'), for example.
Run `VFlib3-config' with `--help' option for detail.

 



File: VFlib-36.info, Node: Writing a vflibcap, Next: Debugging a vflibcap, Prev: Programming with VFlib, Up: Top

Writing a vflibcap
******************

* Menu:

Introduction
* Introduction to vflibcap::
* Syntax of vflibcap::
* Macros in vflibcap::
* Searching font files::
* Fast font file search::
* Compressed font files::
* Explicit and implicit fonts::
* Variables in vflibcap::

Global definitions
* VFlib defaults::

Font drivers
* BDF font class::
* PCF font class::
* HBF font class::
* TrueType font class::
* Type1 font class::
* Zeit font class::
* JG font class::
* eKanji font class::
* TeX default and TeX font mapping font class::
* PK font class::
* GF font class::
* TFM font class::
* VF font class::

Font drivers that map to another fonts
* ASCII Japanese TeX Kanji font class::
* Japanese comic font class::
* Try font class::
* Mojikyo font mapping class::

Examples of vflibcaps
* Example vflibcap 1::
* Example vflibcap 2::
* Example vflibcap 3::




File: VFlib-36.info, Node: Introduction to vflibcap, Next: Syntax of vflibcap, Up: Writing a vflibcap

Introduction to vflibcap
========================

A vflibcap file is a database of font definitions for the VFlib
library.  A vflibcap font definition is described in a format similar
to termcap and printcap.  Vflibcap provides logical font names and
logical font names may not corresponds to font files to be accessed.
In this document, we simply say "font" to denote logical fonts.

Each VFlib fonts have its own parameters listed below:

   * Pixel size,
   * Point size, and
   * Resolution of target device.

These parameters may not be available in font file.  For instance,
these parameters are lacking in TrueType fonts.  Lacking information
is given in vflibcap file, or it is given by a font driver as default
values.

Note: If you want to use VFlib for TeX DVI drivers, such as previewers
and pronter driver, use `vflmkcaptex' program to generate vflibcap
file automatically.




File: VFlib-36.info, Node: Syntax of vflibcap, Next: Macros in vflibcap, Prev: Introduction to vflibcap, Up: Writing a vflibcap

Syntax of vflibcap
==================

The syntax of vflibcap file is lisp-like form.  A semicolon `;' starts
a comment and following text is ignored until the end of line.  A
colon in a string which is enclosed by double colons is not considered
as a comment character and forms a part of string.  In the following
explanation, we ignore comments.

A vflibcap file is a sequence of expressions called s-expressions.
Basic data item of s-expression is string.  Unlike lisp, there is no
"number" type.  A sequence of digits is parsed as a string.  To
include a special characters in a string such as double quotation,
control code, and parenthesis, escape sequence can be used.  String is
a sequence of characters of the following form:

String Form 1:
        Sequence of characters enclosed by double quotations.

        Examples:
             "hello world"
             "a, b, c, d"
             "He said \"Thanks!\"."
             "a*(b+c)"

String Form 2:
        Sequence of characters except space, tab, newline, and closing
     parenthesis. A start character must not be a double quotation.

        Examples:
             font-file
             hello\ world
             He\ said\ \"Thanks!\".
             a*\(b+c\)

Unlink lisp, there is no distinction between string and symbol in
vflibcap; they are the same data type.  That is, `HELLO' and `"HELLO"'
are the same.

Parentheses is used to form a "list" like in lisp.  For example, `(A B
C)' is a list of three strings.  List can be nested any depth, e.g.,
`(A (B1 B2 B3) (C1 (C21 C22) C3))'.

A vflibcap must be a sequence of s-expression of the following forms:

`(define-default FONT-CLASS CAPABILITY-DEF ... )'
       This expression defines a default values for a font class.

`(define-font NAME CAPABILITY-DEF ... )'
       This expression defines a font.

`(define-macro NAME CAPABILITY-DEF ... )'
       This expression defines a macro NAME.

CAPABILITY-DEF must be a list of form `(CAPABILITY-NAME VALUE)', e.g.,
`(font-file "/usr/local/share/fonts/"'.  Each font class defines its
own set of capabilities and capability sets can be different by font
classes.
 

This is an example of vflibcap file.

     ;; vflibcap
     (define-default VFlib
       (extension-hints         (".bdf" bdf) (".pcf" pcf))
       (uncompression-programs  (".Z" "zcat") (".gz" "gzip -cd")
                                ("pk" ascii-jtex-kanji))
       (implicit-font-classes   bdf pcf hbf ascii-jtex-kanji)
       (variable-values     ("TeX_DPI" "300"))

     (define-default bdf
       (filename-extensions ".bdf")
       (font-directories
          "/usr/X11R6/lib/X11/fonts//" "/usr/local/share/fonts/X11//")
       (compression-extensions ".gz" ".Z"))

     (define-font timR24  ; times roman 24
       (font-class bdf)
       (font-file "timR24.bdf"))

     (define-font timR18  ; times roman 18
       (font-class bdf)
       (font-file "timR18.bdf"))




File: VFlib-36.info, Node: Macros in vflibcap, Next: Searching font files, Prev: Syntax of vflibcap, Up: Writing a vflibcap

Macros in vflibcap
==================

To avoid writing the same capabilities, macro feature is provided in
vflib.  In case of CAPABILITY-DEF is a string, it is treated as a
macro and a macro definition for it is expanded.  For instance,

     (define-font timR18
       MACRO-NAME
       (font-file "timR18.bdf"))

is a font definition using a macro `MACRO-NAME'.  Suppose a macro
`MACRO-NAME' is defined as follows.

     (define-macro MACRO-NAME
       (font-class bdf)
       (dpi 300))

Then, the font definition for `timR24' is the same as follow.

     (define-font timR18
       (font-class bdf)
       (dpi 300))
       (font-file "timR18.bdf"))


The rule of macr expand is as following procedure.

  1. Looks for use of macros.  From the first CAPABILITY-DEF to the
     last one, it is checked if it is a string (thus a macro) or not
     in order.  If it is a macro, corresponding macro definition is
     substituted.  Then, next CAPABILITY-DEF is checked.

  2. Macro expand is done recursively.  Thus, a macro can be used in
     another macro.





File: VFlib-36.info, Node: Searching font files, Next: Fast font file search, Prev: Macros in vflibcap, Up: Writing a vflibcap

Searching font files
====================

Some font classes (e.g., BDF, PCF) defines a `font-directories'
capability in vflibcap file.  This capability specifies a list of font
directories, for instance, `(font-directories "/usr/local/fonts/"
"/opt/fonts" "/usr/local/share/fonts//")'.  A font file can be
searched recursively in a directory tree if a font directory name ends
by double slashes `//'.

Some font drivers support file search by kpathsea.  Typically, font
files are located under `/usr/local/share/texmf'.  This directory is
used to hold TeX-related files.  If a font driver supports searching
by kpathsea, a special name `TEXMF' can be given in a list of
`font-directories' capability. For instance, suppose that
`(font-directories "/opt1/fonts//" "TEXMF" "/opt2/fonts//")' is
specified.  Then files are searched under `/opt1/fonts', by kpathsea,
and then `/opt2/fonts', in this order.

Currently, pk, gf, tfm, vf, truetype, and type1 font classes suport
searcing files by kpathsea.




File: VFlib-36.info, Node: Fast font file search, Next: Compressed font files, Prev: Searching font files, Up: Writing a vflibcap

Fast font file search
=====================

In case there are many font directories and sub-directory which
contains many font file, searching a font file take long time, since
font directories are traversed to find a requested font file.  For
fast font file search, font file hint database (FDB for short) can be
used.  It is placed in a root of a font directory, and it contains
pairs of font file name and relative pathname of the font file from
the font directory.  The file name of FDB is `VFlib.fdb'.

The following is an example of FDB file.
     times__m.pfb	type1/t/times__m.pfb
     times__m.afm	type1/t/times__m.afm
     zac_____.ttf	ttf/z/zac_____.ttf
     zalescap.ttf	ttf/z/zalescap.ttf

Suppose that this FDB file is located in `/foo/bar/', for instance.
The file tells us that there is a file `times__m.pfb' and absolute
path name of the file is `/foo/bar/type1/t/times__m.pfb'.

If FDB file is found in a root directory of font directory, the FDB
file is opened to find a requested font file.  If a requested font
file is not found, other font directory is searched, i.e., the
directory is not traversed at all.  In case FDB file is not found, a
font directory is traversed to find a requested font file.

It is important to remember that you must not forget to update FDB
file after you added new font files in a font directory.  If you
forget, installed font files are not found evenif they are in a font
directory.  To update a FDB file, run the utility program `vflmkfdb'.
See *Note vflmkfdb::, for details of the program.

A FDB file must be located in a root of a font directory and its name
must be `VFlib.fdb'.  Even if there is a FDB file in a sub-directory
of a font directory, VFlib does not look for it.





File: VFlib-36.info, Node: Compressed font files, Next: Explicit and implicit fonts, Prev: Fast font file search, Up: Writing a vflibcap

Compressed font files
=====================

To reduce disk storage, compressed font files and uncompression on the
fly is supported by some font class.  Note that this feature is font
class dependent and not all font class support this.

In a vflibcap file, a font file name need not have a compressed type
extension, such as `.gz'.  When VFlib searches a font file, it
internally adds compressed type extension and finds a file.





File: VFlib-36.info, Node: Explicit and implicit fonts, Next: Variables in vflibcap, Prev: Compressed font files, Up: Writing a vflibcap

Explicit and implicit fonts
===========================

Fonts explicitly defined in a vflibcap file are called *explicit
fonts*.  Fonts does not appear vflibcap file and searched by font
drivers on demand are called *implicit fonts*.




File: VFlib-36.info, Node: Variables in vflibcap, Next: VFlib defaults, Prev: Explicit and implicit fonts, Up: Writing a vflibcap

Variables in vflibcap
=====================

In a vflibcap file, variables can be used as capability values.  A
capability value can be a value of a variable if a dollar sign (`$')
followed by a variable name is given.

For instance, `(dpi $TeX_DPI)' can be used instead of `(dpi 300)'.
The value for a variable must be defined somewhere.  Default value can
be given in `(define-default VFlib ...)', which will be explained
later.

Default values can be overridden on initialization function of VFlib
`VF_Init()', or Unix environment variables `VFLIBCAP_PARAM_VAR'.  For
example, `VFLIBCAP_PARAM_TeX_DPI' is defined, its value becomes the
value of the vflibcap variable `TeX_DPI'.

The value of an environment variable `VFLIBCAP_PARAM_VAR' is parsed as
an S-expression, not as an string.  Thus, if you want to specify a
string `ABC 123', the value of an environment variablue must be `\"abc
123\"'.  (Without double quotation, it will be a sequence of two
strings.  Only the first one is effective and the second one is
ignored.)



File: VFlib-36.info, Node: VFlib defaults, Next: BDF font class, Prev: Variables in vflibcap, Up: Writing a vflibcap

VFlib defaults
==============

To specify global behavior of VFlib, (virtual) font class `VFlib' is
defined.

The following capability are defined.

`implicit-font-classes' (optional)
     --- A list of implicit font classes. Font classes listed by
     this capability is candidates for implicit font searching.

     example: `(implicit-font-classes "bdf" "pcf" "gf")'

`extension-hints' (optional)
     --- A list of paris of font name postfix and corresponding font class name.
     This is hint information to find font class from a font name in
     case of searching an implicit font.  If an implicit font name
     matches with a postfix given by this capability, specified font
     class is invoked to search an implicit font.  This is effective
     to reduce time to search an implicit font.

     example: `(extension-hints (".pcf" pcf) (".bdf" bdf) ("gf" gf))'

`variable-values' (optional)
     --- A list of pairs of a name of vflibcap variable and its default value.

     example: `(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE"
     "cx") (v ("p1" "v1")'

`uncompression-programs' (optional)
     --- A list of pairs of file name extension and corresponding uncompression
     program.  This is used for reading compressed font files.  An
     uncompression program must output uncompressed data to standard
     output.

     This capability is just defines relations of an extension and an
     uncompression program.  A list of supported compressed types of a
     font class is given in a font class default description of each
     font class.

     example: `(uncompression-programs (".Z" "zcat") (".gz" "gzip
     -cd")'

`code-conversion-files' (optional)
     --- A list of file names for encoding conversion. 
     Currently, TrueType font class uses this.  See *Note Code
     conversion system::.

     example: `(code-conversion-files "iso8859-1_unicode.ccv".ccv")'

`use-kpathsea' (optional)
     --- A flag whether kpathsea is used or not to search TeX font files.
     Value of this capability must be one of `"Yes"' or `"No"'.

     example: `(use-kpathsea "Yes")'

`kpathsea-mode' (optional)
     --- A device mode name for kpathsea library.

     example: `(kpathsea-mode "cx")'

`kpathsea-dpi' (optional)
     --- Device resolution (in dpi) of a device mode for kpathsea library.

     example: `(kpathsea-mode 300)'

`kpathsea-program-name' (optional)
     --- An application program name for kpathsea library.

     example: `(kpathsea-mode "xgdvi")'






File: VFlib-36.info, Node: BDF font class, Next: PCF font class, Prev: VFlib defaults, Up: Writing a vflibcap

BDF font class
==============

The BDF format is a bitmap font format encoded in human-readable,
platform independent format for distributing X Window fonts.

This font class supports compressed font files and implicit fonts.


Font class name: `bdf'


Capabilities for font class default:


`font-directories' (optional)
     ---  A list of font directories for searching font files.
     Recursive searching of font files is support.

`compression-extensions'  (optional)
     --- A list of supported compression type for this font class.
     This font class supports only compression type given by this
     capability.  When a font is searched, a file followed by a
     compression extension is searched if given font file is not
     found.  (Note that `uncompression-programs' capability of VFlib
     class default description gives a uncompression programs.)

     example: `(compression-extensions ".gz" ".Z")'

`dpi'  (optional)
     --- Defualt device resolution.  
     Default horizontal and vertical resolutions will be the same
     value.
  
     example: `(dpi 300)'

`dpi-x' (optional)
     --- Default horizontal device resolution.
  
     example: `(dpi-x 300)'

`dpi-y' (optional)
     --- Default vertical device resolution.
  
     example: `(dpi-y 300)'

`aspect-ratio' (optional)
     --- Aspect ratio of characters. 
     If this value is 0.5 then width is half, and if 2 then width is
     doubled.

     example: `(aspect-ratio 0.8)'

`properties' (optional)
     --- A list of pairs of a property name and its value. 
     Property values given by this parameter is used by `VF_GetProp()'

     example: `(properties ("PROP-1" "value-1") ("PROP-2" "value-2"))'

`variable-values' (optional)
     --- A list of pairs of a vflibcap variable name and its default value.

     example: `(variable-values ("TeX_DPI" "300") ("TeX_KPATHSEA_MODE"
     "cx") ("TeX_KPATHSEA_PROGRAM" "/usr/X11R6/xldvi"))'



Capabilities for font definition:



`font-class' (essential)
     --- A font class name. This value must be `bdf'.

`font-directories' (optional)
     ---  A list of font directories for searching font files.
     Recursive searching of font files is support.  A font file is
     searched in the directories given by this capability.

     If this capability is not given, the font directory specified by
     the class default is used to search fonts.  If this capability is
     given, the font directory specified by the class default is not
     used to search fonts.

`font-file' (optional)
     --- A font file name string. 
     If this capability is not specified, the font name is used as the
     font file name.  Multiple font file names can be listed in this
     capability.  The driver tries to open a font listed first.  If it
     is impossible to open, then it tries to open the second font.
     This is repeated until a font is successfully opened.  If all
     fonts are impossible to open, font open fails.

     example: `(font-file "timI24.bdf" "timR24.bdf")'

`point-size' (optional)
     --- font size in points.  If the size is different
     from the size defined in the BDF font file, the bitmap is
     enlarged or shrinked to yield the specified size.  This
     capability has effect for the VFlib functions `VF_GetBitmap1()'
     and `VF_GetMetric1()'.

     example: `(point-size 24.0)'

`pixel-size' (optional)
     --- font size in pixels. 
     If the size is different from the size defined in the BDF font
     file, the bitmap is enlarged or shrinked to yield the specified
     size.  This capability has effect for the VFlib functions
     `VF_GetBitmap2()' and `VF_GetMetric2()'.

     example: `(pixel-size 24)'

`magnification' (optional)
     --- magnification factor.
     The font is magnified by this factor.

     example: `(magnification 1.20)'

`character-set' (optional)
     --- This is used for code point conversion.
     Value of this capability gives an external view of a character
     set of a font.  Code conversion (ccv) is determined by this value
     and the following three capabilities.

`encoding' (optional)
     --- This is used for code point conversion.
     Value of this capability gives an external view of an encoding of
     a font.

`font-character-set' (optional)
     --- This is used for code point conversion.
     Value of this capability gives an internal view of a character
     set of a font.  Therefore, this value must match the character
     set of the font file given by `font-file' capability.

`font-encoding' (optional)
     --- This is used for code point conversion.
     Value of this capability gives an internal view of an encoding of
     a font.  Therefore, this value must match the encoding of the
     font file given by `font-file' capability.

     The following example defines a font named `iso8859_5-font' with
     ISO-8859-5 encoding by using a KOI8-R encoded font file.

          (define-font iso8859_5-font
            (font-class pcf)
            (character-set "ISO8859-5")   (encoding "ISO")
            (font-character-set "KOI8-R") (font-encoding "KOI8-R")
            (font-file "koi8x13.pcf"))

     Code conversion is done by a subsystem named CCV.  See *Note Code
     conversion system:: for detail.






