%
% Q&A in English
%   Translation of Q&A 1.4 
%   Contribution by Matt Gushee, Science University of Tokyo
%   
%    Updated by H.Kakugawa for Q&A 1.5
%
\documentstyle[linuxdoc-sgml,isolatin,qwertz,null]{article}
\input{epsf.tex}
\title{VFlib 2.23 Q \& A}
\author{Hirotsugu Kakugawa}
\date{v. 1.5, May 1998}
\abstract{{\em Redistribution:\/} 
This document is distribued under the terms of
GNU General Public License.
{\em Disclaimer:\/} The author assumes no liability for any loss or
damage suffered as a result of, or incidental to, the use of this
document.}


\begin{document}
\raggedright
\maketitle
\tableofcontents

\section{What is VFlib?}


\subsection{What is VFlib?}

VFlib is a library for converting vector
fonts \footnote{({\em Translator's note:\/} also known as outline fonts)} to bitmap
data. Its functions include rotation, shrinking, and changing the
slant of characters.
VFlib is used by 
localized software for Japanese document processing that requires Kanji fonts,
for example xdvi, dvi2ps, ghostscript.


\subsection{What are the benefits of using VFlib?}

Currently, there is a wide variety of commercial fonts
produced by various companies, on the market. Most of these fonts are
designed to be used with specific PC applications; VFlib enables you
to use them on UNIX and similar systems.

Most application programs can use only a particular font
format, and cannot use different formats simultaneously. VFlib absorbs 
the differences in format, providing a format-independent interface to 
fonts. Thus you can use a mixture of different font formats in one application.


\section{Using Kanji Fonts with VFlib}


\subsection{What outline fonts does VFlib support?}

As of April 23, 1997, the following fonts are supported:
\begin{description}
\item[Sony Corporation: NWF-605, NWF-629] \mbox{}

These are vector fonts designed for Sony's Workstation NEWS. There have been reports of bus errors when using Sony Heisei Gothic. Other fonts, such as Standard Mincho and Heisei Mincho, do not have this problem.

\item[Zeit Corporation: "Shoutai Club" font series] \mbox{}



\item[Zeit Corporation: "JG Font" series (distributed by ASCII Corp.):] \mbox{}

These are vector fonts for the JG word processor.

\item[TrueType fonts:] \mbox{}

As used in Microsoft Windows 3.1, Windows 95, and so on. Note that some fonts in the DynaFont series are unusable with VFlib. The following fonts have been reported to work with VFlib.

\begin{description}
\item[Windows 3.1J:] \mbox{}

MS Mincho, MS Gothic.

\item[Windows 95:] \mbox{}

MS Mincho, MS Gothic.

\item[OS/2] \mbox{}

Ryobi Hon-Mincho-L, Ryobi
Hon-Mincho-B II, Ryobi Gothic-M II, Ryobi Gothic-B, Ryobi Sirius-L II, 
Ryobi Sirius-M, Ryobi Medium Kaisho

\item[Ricoh TrueType World HG series:] \mbox{}

HG Heisei Mincho 
(W3, W9), HG Heisei Kaku Gothic (W3, W5, W7, W9), HG Souei Kaku Pop,
HG Souei Maru Pop, Heisei True Kaisho, HG Maru Gothic L, HG Maru
Gothic B, HG Textbook, HG Semicursive, HG Extended Mincho L, HG
Extended Gothic B

\item[Fujitsu Fontcity TrueType collection:] \mbox{}

FC
Mincho-L, FC Mincho-B, FC Gothic-L, FC Gothic-B

\item[DynaFont:] \mbox{}

DynaFont Ryobi Premium 17 pack

\item[DynaFont:] \mbox{}

DynaFont Premium 30 pack

\item["GuManTan" DynaFont fonts] \mbox{}



\item[Ichitarou V. 7 TrueType fonts (JustSystem
Corp.):] \mbox{}

JS Mincho (jsmincho.ttc), JS Gothic

\item["Haku Syu Syotai" http://www.net135.or.jp/~maruoka/] \mbox{}

Several free Kanji fonts (``Tensyo face'', ``Kaisyo face'', 
``Gyosyo face'', and ``Kointai'' face) are available, and
each font fontains about 1000 kanji characters.

\item[Note:] \mbox{}

The TrueType fonts packaged with AmiPro
are known to be {\bf unusable.}

\end{description}


\item[BDF fonts] \mbox{}

The BDF bitmap fonts used with verson 11 of the X
Window System (X11).

\item[HBF fonts] \mbox{}

HBF (Hanzi Bitmap Font) is a format often
used for Chinese-language fonts. 

\end{description}





\subsection{My DynaFonts are unusable with VFlib. Can
anything be done about this?}

The DynaFont product line includes some fonts containing
data that requires functionality not available in the current version
of VFlib. Unfortunately, these fonts cannot be used.

If you really must use one of these fonts, then analyze the 
internal format of the font files, and write a DynaFont driver for
VFlib. By all means contribute the results of your work! {$<$}grin{$>$}


\subsection{I can't afford to buy commercial fonts. What can I
do?}

There are a number of freeware outline fonts in
circulation. One example of these is the so-called "Watanabe fonts."
These are a set of fonts produced by transforming bitmap font data to
an outline format. They are in the Shoutai Club format, so of course
they are supported by VFlib. However, only the Mincho font family is
available, and since they are made from bitmap fonts, their quality
suffers accordingly. Still, we ought to be thankful that we can get
them for free.

Another option is the "Wadalab fonts." These are the
product of research into the automatic generation of various styles
from skeletal font data. I have no detailed knowledge of these, so you 
will need to investigate for yourself.

Either of the above font sets can almost certainly be found 
at any major TeX/LaTeX ftp site. Using {\tt archie}, you might be
able to locate them using keywords such as {\tt watanabe-vector} or 
{\tt wada-vector}.

Finally, with versions 2.21 and later of VFlib, you can use 
the BDF fonts supplied with X11. Since scaling these fonts just gives
you larger bitmaps, the results are rather ugly, but at least they're free.


\subsection{I only have the Mincho font, but I need to print
documents containing Gothic.}

You need to edit the {\tt vfontcap} database. Set the
the Gothic entry to use the same font as Mincho.


\subsection{My printer driver/previewer supports only Dai Nippon
Printing (DNP) fonts. What should I do about this?}

There is a program that works in conjunction with VFlib to
convert vector fonts to DNP format. This enables you to use a DNP-only 
printer driver or previewer.

The program, by Hiroshi Okagawa of Tokyo University, is
called {\tt vf2dnp}. You can obtain it by FTP from
{\tt gull.se.hiroshima-u.ac.jp:/pub/VFlib/} (I believe it is also
available from other sites).


\subsection{My Linux distribution includes some kanji fonts. Can
I use those?}

Although I haven't thoroughly investigated this question,
the fonts in {\tt packages/font/vmincho1.tgz} and
{\tt packages/fonts/vmincho2.tgz} appear to be the Shoutai Club
format "Watanabe fonts." So it is probably possible to use them.


\section{Installing VFlib}


\subsection{I want to install VFlib, but the installation manual
itself is in LaTeX/PostScript format. How on earth am I supposed to
read it?!}

I'm sorry. I didn't notice this until
recently. 
\begin{verbatim}
\(^-^;)/
\end{verbatim}
 I have produced a GIF version of the
manuals (man.dvi/man.ps) for versions 2.20 and later, and posted it on 
the WWW. The URL is as follows:\\ 
{\tt \url{http://www.se.hiroshima-u.ac.jp/\~{}kakugawa/Hacks/VFlibMan/Index.html}{}}


\subsection{I have installed VFlib and a TeX previewer, but I
can't display any characters at all.}

First of all, please check whether VFlib is correctly
installed or not. The {\tt \~{}tools/} directory in the VFlib
distribution contains some test programs. Compile {\tt ktest} and
run it in an X Window session:
\begin{tscreen}
\begin{verbatim}
% ktest [Return]
\end{verbatim}
\end{tscreen}

or
\begin{tscreen}
\begin{verbatim}
% ktest -f FONTNAME [Return]
\end{verbatim}
\end{tscreen}

If {\tt FONTNAME} is omitted, its value defaults to
{\tt min}. You should enter the font name registered in
{\tt vfontcap}, not the name of the font file.

If {\tt ktest} displays characters, this indicates that
VFlib is correctly installed. In that case, there is probably an error 
in the previewer installation. If {\tt ktest} displays nothing at
all, or displays an error message and then exits, then VFlib is
incorrectly installed. The most likely cause is incorrect information
in {\tt vfontcap}, so you should check this first.


\subsection{I've been asked by a foreigner whether there was an
English manual. Is there an English version of the VFlib installation
manual?}

Not yet.
So, please translate it into English.
I'm planning to write a manual of VFlib version 3 in English.


\section{Using VFlib with TeX/LaTeX}


\subsection{I'd like to use not just Mincho and Gothic, but a
number of different fonts with TeX or LaTeX. How can I do
this?}

In my laboratory, we are able to print or preview documents 
including over 50 different fonts. You're envious? Well, let me
explain how we do it:

First of all, in order to use a new font with TeX/LaTeX,
you need JFM files. Then, in order to display your work 
on the screen or print it out, you need a suitable previewer and
device driver.


\subsubsection{JFM files}

TeX and LaTeX require a JFM file for each font you use. This file contains information about the height and width of characters, and TeX/LaTeX composes
type based on this information. Although the JFM file specifies the size of
each character, it contains no information about the {\em shape\/}
of the character. Thus, you can use kanji fonts such as Mincho and
Gothic simply by copying their original TFM files. For example, if you 
do the following:
\begin{tscreen}
\begin{verbatim}
% cp min10.tfm wmin10.tfm
\end{verbatim}
\end{tscreen}

you can use TeX/LaTeX to process documents containing the
{\tt wmin} font.

Using a font selection command like
\begin{tscreen}
\begin{verbatim}
\font\wmin=wmin10
\end{verbatim}
\end{tscreen}

you can use the font name {\tt wmin} in a TeX/LaTeX source file.


\subsubsection{About previewers and printer drivers\label{Previewers}}

Among the various previewers available, there are some that are 
designed to display only the Mincho and Gothic fonts. It is simply
impossible to display documents with various fonts using this type of
previewer.

If you really need to display a variety of fonts, then
rather than trying to use one of the above previewers, you should use
one that is designed to support multiple fonts. One such previewer is
available at:
\begin{tscreen}
\begin{verbatim}
gull.se.hiroshima-u.ac.jp:/pub/VFlib/dvi2nwp.lsz-1.44.tar.gz
\end{verbatim}
\end{tscreen}
It includes support for X11R5 and R6, ESC/Page, and
NWP533/537.

In the case of TeX/LaTeX output converted to PostScript
using {\tt dvi2ps}, and then printed using ghostscript or
PostScript, I believe that only the Mincho and Gothic fonts are
supported (but I don't have detailed knowledge of PS, so . . .) It's
rumored that eventually there will be VFlib-enabled version of
{\tt dvi2ps}, so you might want to wait for that.


\subsubsection{VFlib configuration}

You can indicate the fonts you want to use by registering 
them in the font database file, {\tt vfontcap}.


\subsection{Copying all the JFM files by hand is a lot of
work. Isn't there an easier method?}

In the {\tt \~{}jTeX/jfonts} directory of the VFlib
distribution, you will find a script and a Makefile for generating the 
necessary JFM files for the Mincho and Gothic fonts. If you add to the 
Makefile a description of any fonts you want to build, you can
generate them automatically with a single {\tt make} command.


\subsection{I'd like to use italic fonts, but if I use the JFM
files for Mincho and Gothic, I don't get clean output. What should I
do?}

For italic fonts, it's not enough just to copy the JFM
files. I have prepared JFM files for italic fonts to be used with
ASCII Nihongo TeX. You can use the script and Makefile in
{\tt \~{}jTeX/fonts} to create these italic fonts.


\section{Other Questions}


\subsection{Can you tell me the difference between VFlib versions 1 and 2?}

There is little difference in the essential functionality of
the two versions. So it shouldn't be particularly difficult to adapt
version 1 dependent software to work with version 2. 
\begin{enumerate}
\item Function names have changed.\\ 
But the arguments they take have not changed much. The character code
for version 1 was {\it renzoku moji koodo\/}, but version 2 uses
JIS.
\item I have changed the format of the font database file.
\end{enumerate}



\subsection{I want to modify VFlib to use some new fonts, but I'm not sure what
to do . . .}

Internally, VFlib uses a single module to process various 
font formats. This module is responsible for performing the
characteristic ``procedures" of each font, such as opening and closing the
font, abstracting outline data and expanding it to bitmap form.

This module must also have a function to generate ``font
objects." The font object generation function records the
characteristic behavior of each font by allocating a ``font object
structure," and substituting a pointer to the above-mentioned
``procedures" in the elements of that structure.

When the bitmaps for the characters of a font are
installed, VFlib consults the function pointers in the corresponding
font object, and is thus able to emulate the characteristic behavior
of the font.

This explanation is getting rather long. It might be best
to read the source code.


\subsection{In addition to TrueType kanji fonts, can I also use
English TrueType fonts?}

No, you can't.

VFlib does not employ the notion of font metrics at all. It 
treats the height, width, and depth of all characters equally--in
fact, it treats every character as square.

With English TrueType fonts, it is not possible to
disregard the font metrics. Accomodating English fonts would require
drastic revisions in the code. In any case, I don't know the format of 
English TrueType fonts. {\tt (\^{}o\^{})}


\subsection{The manual mentions `VFlibd.' Where can I get
that?}

As of this writing (December 23, 1995), VFlibd is not ready 
for distribution yet. Although I have a functioning version of the
program, it is not working very well and needs major improvements. The 
manual is also not up-to-date. If I can find the time, and if I feel
like it, I will finish these tasks, but don't hold your breath.


\subsection{What's so great about using a lot of fonts in one
document?}

If you have to ask, you wouldn't understand. {$<$}grin{$>$}


\subsection{The Ricoh TrueType World series includes ``extended
glyph" font files that contain various symbols. Can I use these with
VFlib?}

Yes, you can. The {\tt ktest} program provided with
VFlib will display these symbols. However, because they are assigned
to a different part of the character code table from regular fonts,
some previewers and printer drivers may not support them.

{\tt dvi2nwp.lsz-1.47} and later versions (see section \ref{Previewers}) are designed to support the extended glyphs.


\subsection{My machine doesn't have a floating-point processor,
so it's very slow. Is there a workaround for this?}

With versions 2.21 and later of VFlib, you can use BDF font 
files. That way, very few floating-point operations are required. You
can use {\tt vf2bdf}, supplied with versions 2.22 and later of
VFlib, to make BDF files.

{\tt vf2bdf} is a program that uses VFlib to generate
BDF fonts from vector font files. By using these fonts, you
{\em might\/} be able to increase your processing speed. (these are
very makeshift BDF fonts, so you had best think of them as being only
usable with VFlib)

Since I do not have access to a machine without a
floating-point processor, I can't actually test this. I should
mention, however, that on a Pentium 90 running FreeBSD 2.0.5, the
speed actually dropped with {\tt vf2bdf} (the BDF files used an
80x80 bitmap for each character). I don't really know what will happen 
on a machine with no floating-point processor. If you test this,
please let me know what kind of results you get.


\section{Distribution}


\subsection{What are the terms of distribution for
VFlib?}

VFlib is distributed in accordance with the GNU Library General
Public License.


\subsection{Where can I find the most recent version of
VFlib?}

You can obtain it by anonymous ftp from:
\begin{tscreen}
\begin{verbatim}
ftp.se.hiroshima-u.ac.jp
\end{verbatim}
\end{tscreen}

The latest version of VFlib can be found in the
{\tt /pub/VFlib/} or {\tt /pub/TypeHack/}  directory.

The above site is mirrored at a number of locations. You
should be able to find the mirror sites with an {\tt archie}
search; then you can download the package from the site nearest you.

\end{document}

