3

The arev package provides extended version of BitStream Vera Sans fonts but without scaled option.

The bera package uses beraserif, berasans and beramono with scaled option (via t1fve.fd, t1fvm.fd and t1fvs.fd).

How to add a scaled option to arev package?

Or how to create a new virtual font (derived from arev package) with a scaled option?

4

The following example implements a package arevtext2, which is similar to the existing package arevtext, but adds option scaled. Also the font family names are suffixed with 2: fav2 instead of fav to avoid name clashes with the existing arev files.

%%% arevtext2.sty %%%
\NeedsTeXFormat{LaTeX2e}% 
\ProvidesPackage{arevtext2}%
[2015/06/09 v0.1 Arev Sans Text package with options]%

\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  prefix=arevtext@, 
}
\DeclareStringOption[1]{scaled}

% Optionally to accept option "scaled" only as local package option
% and to ignore it as global option.
% \DeclareLocalOptions{scaled}

\ProcessKeyvalOptions*

\RequirePackage[T1]{fontenc}
% Package "arevtext" loads package "textcomp", but
% real support for TS1 encoding is not present (missing ".TFM" files)
\RequirePackage{textcomp} % takes text symbols such as \S, \P, \textdagger
                          % from the text font

\renewcommand{\rmdefault}{fav2}
\renewcommand{\sfdefault}{fav2}
\renewcommand{\ttdefault}{fvm2}

\endinput

Then, as example, t1fav2.fd is implemented, fvm2.fd is left as exercise for the reader.

%%% fvm2.fd %%%
\ProvidesFile{t1fav.fd}
   [2015/06/09 Font definitions for T1/fav.]

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname arevtext@scaled\endcsname\relax
  \let\arevtext@@scaled\@empty
\else
  \edef\arevtext@@scaled{s*[\arevtext@scaled]}%
\fi

\DeclareFontFamily{T1}{fav2}{}

\DeclareFontShape{T1}{fav2}{m}{n}{
   <-> \arevtext@@scaled favr8t
}{}

\DeclareFontShape{T1}{fav2}{m}{it}{
   <-> \arevtext@@scaled favri8t
}{}

\DeclareFontShape{T1}{fav2}{b}{n}{
   <-> \arevtext@@scaled favb8t
}{}

\DeclareFontShape{T1}{fav2}{b}{it}{
   <-> \arevtext@@scaled favbi8t
}{}

\DeclareFontShape{T1}{fav2}{m}{sl}{<->ssub * fav/m/it}{}
\DeclareFontShape{T1}{fav2}{bx}{n}{<->ssub * fav/b/n}{}
\DeclareFontShape{T1}{fav2}{bx}{it}{<->ssub * fav/b/it}{}
\DeclareFontShape{T1}{fav2}{b}{sl}{<->ssub * fav/b/it}{}
\DeclareFontShape{T1}{fav2}{bx}{sl}{<->ssub * fav/b/sl}{}

\endinput

Test file:

%%% test.tex %%%
\documentclass{article}
\usepackage[scaled=1.5]{arevtext2}
\begin{document}
\noindent
Hello World! (scaled)\\
{\fontfamily{fav}\selectfont Hello World! (unscaled)}
\end{document}

Result

  • Much more work is needed for arevmath, but this is certainly a good starting point. – egreg Jun 9 '15 at 13:05
  • @egreg Is it really much more work? And if I try to do it, how to test it? – Paul Gaborit Jun 9 '15 at 13:15
  • Thanks for this starting point... The easiest solution for me would perhaps ask the author of arev package to provide a scaled option (for text and math) – Paul Gaborit Jun 9 '15 at 13:17
  • @PaulGaborit You have to modify ot1zavm.fd, omlzavm.fd, omszavm.fd, and create a new font family for the large symbols font that presently uses omsmdbch.fd at a fixed scaling, so this symbol font should be the same as the present one but scaled 4% less than what you specify in the package option. – egreg Jun 9 '15 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.