<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
%
% Copyright (C) 2018 by Leah Grace Velleman
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any later
% version. The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
%
% \fi

% \iffalse
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[2018/01/01]
%&lt;package&gt;\ProvidesPackage{stoneipa}
%&lt;package&gt; [2018/07/07 v0.8 Stone Sans Phonetic font support] 
%
%&lt;*driver&gt;
\documentclass{ltxdoc}
\usepackage{stoneipa}
\setromanfont[Scale=MatchLowercase]{Cambria}
\setmonofont[Scale=MatchLowercase]{Consolas}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{stoneipa.dtx}
\end{document}
%&lt;/driver&gt;
%\fi


% \title{The \textsf{StoneIPA} package}
% \author{Leah Grace Velleman \\ leahvelleman@gmail.com}
% \maketitle
%
% \section{About}
% Stone Sans Phonetic is an excellent IPA font designed by Sumner Stone in the
% 1980s. It harmonizes well with its companions Stone Serif and Stone Sans, and
% also with a number of other popular text fonts.
%
%  It remains commercially available, but in an idiosyncratic
% pre-Unicode encoding. 
%
% This package --- designed for use with XeLaTeX --- sets
% up Stone Sans as the sans-serif document font, and sets up the Unicode
% characters in the IPA range so that they will produce the correct glyphs from
% Stone Sans Phonetic. It does not include the fonts themselves, which must be
% purchased separately.
%
%\begin{figure}
% \sffamily
%\begin{center}
%\begin{tabular}{lllllllllllllllllllll}
%    p &amp; b &amp;   &amp;   &amp;   &amp;   &amp; t &amp; d &amp;   &amp;   &amp; Êˆ &amp; É– &amp; c &amp; ÉŸ &amp; k &amp; g &amp; q &amp; É¢ &amp;   &amp; Ê” \\
%    Æ¥ &amp; É“ &amp;   &amp;   &amp;   &amp;   &amp; Æ­ &amp; É— &amp;   &amp;   &amp;   &amp;   &amp; Æˆ &amp; Ê„ &amp; Æ™ &amp; É&nbsp; &amp; Ê&nbsp; &amp; Ê› \\
%      &amp; m &amp;   &amp; É± &amp;   &amp;   &amp;   &amp; n &amp;   &amp;   &amp;   &amp; É³ &amp;   &amp; É² &amp;   &amp; Å‹ &amp;   &amp; É´ \\
%      &amp; Ê™ &amp;   &amp;   &amp;   &amp;   &amp;   &amp; r &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp; Ê€ \\
%      &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp; É¾ &amp;   &amp;   &amp;   &amp; É½ \\
%    É¸ &amp; Î² &amp; f &amp; v &amp; Î¸ &amp; Ã° &amp; s &amp; z &amp; Êƒ &amp; Ê’ &amp; Ê‚ &amp; Ê &amp; Ã§ &amp; Ê &amp; x &amp; É£ &amp; Ï‡ &amp; Ê &amp; Ä§ Ê• &amp; h É¦ \\
%      &amp;   &amp;   &amp;   &amp;   &amp;   &amp; É¬ &amp; É® \\
%      &amp;   &amp;   &amp; Ê‹ &amp;   &amp;   &amp;   &amp; É¹ &amp;   &amp;   &amp;   &amp; É» &amp;   &amp; j &amp;   &amp; É° \\
%      &amp;   &amp;   &amp;   &amp;   &amp;   &amp;   &amp; l &amp;   &amp;   &amp;   &amp; É­ &amp;   &amp; ÊŽ &amp;   &amp; ÊŸ\\
%\end{tabular}
%\caption{The IPA consonants in Stone Sans Phonetic}
%\end{center}
%\end{figure}
%\begin{figure}
%\sffamily
%\begin{center}
%\begin{tabular}{llllll}
%            i &amp; y &amp; É¨ &amp; Ê‰ &amp; É¯ &amp; u \\
%            Éª &amp; Ê &amp;   &amp;   &amp;   &amp; ÊŠ \\
%            e &amp; Ã¸ &amp; É˜ &amp; Éµ &amp; É¤ &amp; o \\
%              &amp;   &amp; É™ \\
%            É› &amp; Å“ &amp; Éœ &amp; Éž &amp; ÊŒ &amp; É” \\
%            Ã¦ &amp;   &amp; É \\
%            a &amp; É¶ &amp;   &amp;   &amp; É‘ &amp; É’\\
%\end{tabular} 
%\caption{The IPA vowels in Stone Sans Phonetic and Stone Sans Phonetic Alternates}
%\end{center}
%\end{figure}
%\begin{figure}
%\sffamily
%\begin{center}
%\begin{tabular}{lllll}
% Æ¥ &amp; Æ­ &amp; Æ™ &amp; Ê&nbsp; &amp; Ë€ \\
% Å¡ &amp; Ä &amp; Å¾ \\
% Î» &amp; Æ›
%\end{tabular}
%\caption{Non-IPA characters from Stone Sans Phonetic and Stone Sans Phonetic Alternates}
%\end{center}
%\end{figure}
%
%\section{Requirements}
% \textsf{StoneIPA} requires XeLaTeX, \textsf{fontspec}, \textsf{newunicodechar}, and \textsf{pdftexcmds}. It also requires the fonts Stone Sans, Stone Sans Phonetic
% and Stone Sans Phonetic Alternates.
%
%\section{Package options}
% \textsf{StoneIPA} uses your system installed versions of Stone Sans, Stone Sans
% Phonetic, and Stone Sans Phonetic Alternates. By default, it expects these
% fonts to be installed under the names |StoneSans|, |StoneSans-PhoneticIPA|, and
% |StoneSans-PhoneticAlternate|. If yours are installed under different names, 
% specify those names using the |sansfontname|, |phoneticfontname|, and
% |alternatefontname| options.
%
%\begin{verbatim}
%\usepackage[phoneticfontname=StoneSansIPA, 
%            alternatefontname=StoneSansAlt]{stoneipa}
%\end{verbatim}
%
% If some characters appear too small, use the |noalternatescaling| option. As
% of this writing, the version of Stone Sans Phonetic Alternates that is for sale
% on Adobe's website has characters about 10\% too large, and the \textsf{StoneIPA}
% package attempts to compensate for this. The |noalternatescaling| option
% turns off this compensation.
%\begin{verbatim}
%\usepackage[noalternatescaling]{stoneipa}
%\end{verbatim}

% \StopEventually{}
% \section{Implementation}
% \subsection{Option handling}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]

\RequirePackage{fontspec}
\RequirePackage{newunicodechar}
\RequirePackage{pdftexcmds}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=sipa, prefix=sipa@}
\DeclareStringOption[StoneSans]{fontname}
\DeclareStringOption[StoneSansSCITCTTMedium]{scfontname}
\DeclareStringOption[StoneSans-PhoneticIPA]{phoneticfontname}
\DeclareStringOption[StoneSans-PhoneticAlternate]{alternatefontname}
\DeclareBoolOption{noalternatescaling}
\ProcessKeyvalOptions*
%    \end{macrocode}
% \subsection{Font declarations}
%    \begin{macrocode}
\setsansfont{\sipa@fontname}[Scale=MatchLowercase, 
							 SmallCapsFont=\sipa@scfontname]

\newfontfamily{\sipafont}{\sipa@phoneticfontname}[Scale=MatchLowercase]

\ifsipa@noalternatescaling
    \newfontfamily{\sipaalternatefont}{\sipa@alternatefontname}[Scale=1.0]
\else
    \newfontfamily{\sipaalternatefont}{\sipa@alternatefontname}[Scale=0.9]
\fi
%    \end{macrocode}
% \subsection{Character macros}
% \DescribeMacro{\sipachoosephoneticchar} 
% \DescribeMacro{\sipachoosealternatechar}
% The Stone Sans Phonetic font is weirdly encoded. For instance, a symbol that 
% looks like \textsf{Ê·} is stored at the code point normally used for |+|. This means that
% sometimes, the Unicode in our |.tex| file will need to be translated. For
% instance, if we encounter a \textsf{Ê·} character when the current font family is Roman,
% we can print it as usual; but if we encounter the same character when the
% font family is sans serif, we should translate it to a |+| and print it in
% Stone Sans Phonetic. The |\sipachoosephoneticchar| and |\sipachoosealternatechar|% macros do this conditional translation:
% given two characters, when the current family is sans serif, they print the
% first in Stone Sans Phonetic; and when the current family is anything else,
% they print the second.
%    \begin{macrocode}
\def\sipachoosephoneticchar#1#2{%
    \ifnum\pdf@strcmp{\f@family}{\sfdefault}=\z@
        {\sipafont #1}%
    \else
        #2%
    \fi
}

\def\sipachoosealternatechar#1#2{%
    \ifnum\pdf@strcmp{\f@family}{\sfdefault}=\z@
        {\sipaalternatefont #1}%
    \else
        #2%
    \fi
}
%    \end{macrocode}
% \subsection{Character setup}
% \DescribeMacro{\sipasetup}\DescribeMacro{\sipaalternatesetup}
% Now we define two convenience functions that we will use to set up Unicode
% characters. The macro |\sipasetup#1#2| declares that the Stone Sans Phonetic glyph
% stored at |#1| should be used when the TeX source contains the Unicode character
% |#2|. The macro |\sipaalternatesetup| does the same, but for Stone Sans Phonetic
% Alternates.
%    \begin{macrocode}

\def\sipasetup#1#2{\newunicodechar{#2}{{\sipachoosephoneticchar{#1}{#2}}}}
\def\sipaalternatesetup#1#2{\newunicodechar{#2}{{\sipachoosealternatechar{#1}{#2}}}}

\sipasetup{a\$}{Ä}
\sipasetup{e\$}{Ä“}
\sipasetup{i\$}{Ä«}
\sipasetup{o\$}{Å}
\sipasetup{u\$}{Å«}
\sipasetup{y\$}{È³}
\sipasetup{+}{Ê·}
\sipasetup{:}{Ë}
\sipasetup{?}{Ê”}
\sipasetup{@}{É™}
\sipasetup{A}{É‘}
\sipasetup{B}{Ê™}
\sipasetup{C}{Ã§}
\sipasetup{D}{Ã°}
\sipasetup{E}{É›}
\sipasetup{F}{É¸}
\sipasetup{G}{É¢}
\sipasetup{H}{Êœ}
\sipasetup{I}{Éª}
\sipasetup{J}{ÉŸ}
%\sipasetup{K}{É¨}
\sipasetup{L}{ÊŸ}
\sipasetup{M}{É°}
\sipasetup{N}{É´}
\sipasetup{O}{É”}
\sipasetup{Q}{É¾}
\sipasetup{R}{Ê€}
\sipasetup{S}{Êƒ}
\sipasetup{T}{Î¸}
\sipasetup{U}{ÊŠ}
\sipasetup{V}{Ê‹}
\sipasetup{W}{Éº}
\sipasetup{X}{Ï‡}
\sipasetup{Y}{Ê}
\sipasetup{Z}{Ê’}
\sipasetup{\ }{Ê˜}
\sipasetup{\{}{Ã¦}
\sipasetup{Â®}{É²}
\sipasetup{Â¿}{Ê•}
\sipasetup{Ã}{É’}
\sipasetup{Ã‚}{Î²}
\sipasetup{Ãƒ}{É•}
\sipasetup{Ã„}{É–}
\sipasetup{Ã†}{Éœ}
\sipasetup{Ã‡}{Ê›}
\sipasetup{Ãˆ}{É¦}
\sipasetup{Ã‰}{Ä§}
\sipasetup{Ã‹}{É¬}
\sipasetup{ÃŒ}{É®}
\sipasetup{Ã}{É±}
\sipasetup{ÃŽ}{Å‹}
\sipasetup{Ã}{É¶}
\sipasetup{Ã}{É»}
\sipasetup{Ã‘}{É½}
\sipasetup{Ã’}{Ê}
\sipasetup{Ã”}{Êˆ}
\sipasetup{Ã•}{Éµ}
\sipasetup{Ã—}{Ê„}
\sipasetup{Ã˜}{É§}
\sipasetup{Ãš}{Ê‘}
\sipasetup{Ãž}{Ê¢}
\sipasetup{Ã&nbsp;}{É«}
\sipasetup{Ã¡}{É}
\sipasetup{Ã¢}{É“}
\sipasetup{Ã£}{Æˆ}
\sipasetup{Ã¤}{É—}
\sipasetup{Ã¥}{É£}
\sipasetup{\ae}{É¤}
\sipasetup{Ã‡}{É&nbsp;}
\sipasetup{Ã¨}{É¥}
\sipasetup{Ã©}{É¨}
\sipasetup{Ãª}{Ê}
\sipasetup{Ã«}{Æ™}
\sipasetup{Ã¬}{É­}
\sipasetup{Ã­}{É¯}
\sipasetup{Ã®}{É³}
\sipasetup{Ã¯}{Ã¸}
\sipasetup{\dh}{Æ¥}
\sipasetup{Ã±}{Ê&nbsp;}
\sipasetup{Ã²}{É¹}
\sipasetup{Ã³}{Ê‚}
\sipasetup{Ã´}{Æ­}
\sipasetup{Ãµ}{Ê‰}
\sipasetup{Ã¶}{ÊŒ}
\sipasetup{Ã·}{Ê}
\sipasetup{Ã¹}{ÊŽ}
\sipasetup{Ãº}{Ê}
\sipasetup{Ã»}{Å“}
\sipaalternatesetup{?}{Ë€}
\sipaalternatesetup{e}{É˜}
\sipaalternatesetup{Ã¥}{Éž}
\sipaalternatesetup{c}{Ä}
\sipaalternatesetup{s}{Å¡}
\sipaalternatesetup{z}{Å¾}
\sipaalternatesetup{l}{Î»}
\sipaalternatesetup{Ã¬}{Æ›}
%    \end{macrocode}
% \Finale
</pre></body></html>