% $Id: fontanvil.tex 4451 2015-11-26 21:08:08Z mskala $

\documentclass{mitsuba}

\usepackage{framed}
\usepackage{makeidx}
\usepackage{tikz}

\makeindex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\FrameRule}{\fboxrule}
\setlength{\FrameSep}{0.5em}
\setlength{\OuterFrameSep}{0.5em}

\newcommand{\smhv}[1]{\textsf{\textbf{#1}}}

\newcommand{\PEFuncRef}[1]{%
\section*{#1}\label{func:#1}%
\index{#1@{\texttt{#1()}}|smhv}

}

\newcommand{\FFdiff}{\marginpar{\LARGE \raisebox{-1.0ex}{\textit{ff}}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{FontAnvil 0.4}
\author{Matthew Skala}
\date{\today}

\begin{document}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{copyrightpage}
Visit the FontAnvil home page at
\url{http://tsukurimashou.osdn.jp/fontanvil.php}

\vspace*{1in}

FontAnvil user manual\\
Copyright \copyright\ 2014, 2015\quad Matthew Skala

\vspace{\baselineskip}

This document is free: 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 3 of the License, or
(at your option) any later version.

\vspace{\baselineskip}

This document 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.

\vspace{\baselineskip}

You should have received a copy of the GNU General Public License
along with this document.  If not, see \url{http://www.gnu.org/licenses/}.

\vspace*{0.75in}

\emph{The above license for the document itself notwithstanding,} the
FontAnvil software described in this document comprises the work of many
different copyright holders who have licensed their contributions under a
variety of terms.  The package as a whole is GPL, but some portions of it
are also available under less restrictive licenses.  See the ``Licensing''
chapter of this document for more information.

\vspace{\baselineskip}

Anvil clip-art by ``Gerald\_{}G,'' public domain.
\end{copyrightpage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\tableofcontents

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input{intro.tex}
\input{building.tex}
\input{running.tex}
\input{datamodel.tex}
\input{language.tex}
\input{reference.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\iffalse
\chapter{SFD file format}

FIXME should have some more real information here instead of just
injunctions to the sinful.

\begin{framed}
I did not invent the SFD file format, and the person who did never fully
specified or documented it.  SFD is not a standardized format.  This
documentation is based partly on reverse engineering and it is descriptive,
not prescriptive.  That means if you create an SFD file with software other
than FontAnvil, you are not entitled to expect FontAnvil to read it,
\emph{not even if your file conforms to this documentation}; and that
applies to every piece of software that wrote the file as SFD,
not only the most recent one.  A problem was once observed in which
someone created a bad SFD file using homemade software, loaded it, saved
it, loaded it again, and it blew up after the second load because the data
really was invalid all along, but in a subtle way that survived
the first load/save pass.  The \emph{only}
supported way to create SFD files for FontAnvil to read is by writing them
originally with FontAnvil, using no data that ever passed through an SFD
file created by other software.  In particular, exchanging SFD files
between FontAnvil and FontForge, although I expect it will usually work,
is not supported.
\end{framed}

An SFD file is not a canonical form, in the sense of that term used by
mathematicians.  It is normal and expected that loading an SFD file and then
saving it may produce a file not byte-for-byte identical to the original. 
Loading and saving should identically preserve the  ``font,'' that is to
say the abstract entity consisting of glyph outlines associated to slot
numbers, named metadata strings, and so on; but many different SFD files can
realize any given font, and the only way to preserve a specific file
identically is to retain a copy outside FontAnvil.  This fact may have
implications for storing fonts in version control systems.  Note that few,
if any, other font file formats are canonical forms either.

FIXME

It should be obvious that the purpose of using UTF-7 encoding here is to
hide characters like newline (which would otherwise end the field) from the
parser, so it is absolutely necessary to encode such characters using the
Base64-style escape sequences of UTF-7 even if you think a string that left
these characters literal could also be syntactically valid UTF-7 under some
third-party definition of UTF-7.  Without the requirement for newlines to be
encoded there would be no way to distinguish a multi-line value that
happened to contain what looked like SFD field names, from a single-line
value followed by the rest of the file.  Exactly which characters must be
encoded for safe parsing is not defined beyond the general rule that
FontAnvil should read anything that FontAnvil wrote uninfluenced.  The
safest thing for other software to do is to put the entire field value in a
single Base64-style escape sequence whether it needs it or not.  (That is
what Tsukurimashou does.) Note that RFC-2152 does not require any specific
characters to ever be literal in UTF-7 (it at most \emph{allows} some
literal characters), and in any case RFC-2152 would not be authoritative
over the observed behaviour of the code.

The number of glyphs must meet the constraints of the font's encoding. 
FontAnvil checks, as does the latest FontForge; but some versions of
FontForge still in popular use do not, and may crash if this rule is not
observed.  See Section~\ref{sec:data-model} for more information about
encodings.

The order in which glyphs are stored in an SFD file is not significant, will
not in general be preserved through a load/save cycle, and will not affect
the order in which glyphs are stored when generating any non-SFD format,
such as TrueType.  Slot numbers, not the physical sequence of the records in
the file, define the significant ordering of glyphs in a font.

\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\appendix

\onecolumn

\chapter{Licensing}

George Williams put most of his work on PfaEdit, and subsequently FontForge,
under licensing notices such as this one:

\begin{quotation}
Copyright \copyright\ [years] by George Williams

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\end{quotation}

That is what is commonly called a \emph{Three-Clause BSD License}.  There
were many subsequent contributors to the software (see the \texttt{AUTHORS}
file in the root of a distribution tarball or version control checkout) and
many of them were content to keep the same license terms in place, with or
without adding their own names and years to the copyright notice at the
top.

However, some contributors have placed additional restrictions on their
work, most notably \emph{GNU GPL3+} licenses like this one:

\begin{quotation}
Copyright \copyright\ [year] [contributor's name]

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 3 of the License, 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, see
\url{http://www.gnu.org/licenses/}.
\end{quotation}

The Free Software Foundation takes the position that the three-clause BSD
license is GPL-compatible,%
\footnote{\url{http://www.gnu.org/licenses/license-list.html\#ModifiedBSD}}
meaning that it is legally permissible for a package that is under GPL3+ as
a whole to include material that is under three-clause BSD.  The presence of
GPL3+ contributions, however, forces the package as a whole to be licensed
GPL3+.  That being the case, both FontForge and FontAnvil should be treated
as GPL3+, just with the awareness that some files may also be used
separately from the package under the less restrictive three-clause BSD
license.

It is the current practice of the FontForge project to encourage
contributors of new material to apply GPL3+ notices to any new files, but
retain the BSD notices on files that already have those.  There was an
incident in which someone tried to apply a patch someone else had written to
a currently BSD-licensed file in FontForge---with the patch to become
roughly 1/1000th of the file's total volume.  The author of the patch
demanded that the whole file should become GPL3+, overriding the BSD notice
on it and the apparent intentions of the previous contributors to that file. 
I would like to avoid such incidents.

A few files have other distribution terms.  In particular, some parts of the
build system have very permissive licenses.

FontForge attempts to maintain a list of all the licensing terms of all the
files in the project; but their list has never been up to date, cannot
reasonably be expected to ever be up to date nor to stay up to date even if
it ever is at one moment, currently contains incorrect information, and
seems unnecessary.  I do not propose to make such a list for FontAnvil.

The current licensing policy for FontAnvil is substantially the same as that
of FontForge:
\begin{itemize}
\item FontAnvil as a whole is covered by the GPL version 3, or any later
version.
\item Some files in FontAnvil are also available under less restrictive
licenses.  You must consult the notices in those files for details.
\item I will place GPL3+ notices on new files I create within FontAnvil,
and encourage others to do the same.
\item I will leave files with existing broader-than-GPL notices under their
existing notices (possibly adding my own name and year copyright lines), and
encourage others to do the same.
\item I will not accept contributions that entail drastic changes to the
licensing status of work done by persons other than the contributor, and I
will discourage the submission of such contributions.
\end{itemize}

Finally, note that although FontAnvil is associated with the Tsukurimashou
Project, its licensing is not identical to that of other things included in
the Tsukurimashou Project.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\twocolumn

\clearpage
\phantomsection\currentpdfbookmark{Index}{bkm:index}
\printindex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
