\ProvidesPackage{culmus}[0000/00/00 $Revision: 32 $ Culmus Fonts for Hebrew]
% $Id: culmus.sty 32 2008-05-26 10:50:05Z guyru $

% Add option to use legacy (small) font size (this font size was used
% until culmus-latex-0.6
\DeclareOption{small-size}{
	\def\font@scale{1}
}

% whether to use David as the default Roman font.
\def\culmus@useDavid{0}
\DeclareOption{use-david}{
	\def\culmus@useDavid{1}
}
% Set multipliers to adjust font size to be some sane value (make it about
% the same size as the old Hebrew fonts.
\def\font@scale{1.20}

% Process options now to overide the size multipliers
\ProcessOptions\relax

\DeclareFontEncoding{HE8}{}{}
\providecommand{\HeblatexEncoding}{HE8}%
\providecommand{\HeblatexEncodingFile}{he8enc}%

% an attempt to give some replacements to the original hebfonts:
% 
\DeclareTextFontCommand{\textcrml}{\fontfamily{david}\selectfont}
\DeclareTextFontCommand{\textfr}{\fontfamily{frank}\selectfont}
\DeclareTextFontCommand{\textredis}{\fontfamily{aharoni}\selectfont}
\DeclareTextFontCommand{\textclas}{\fontfamily{drugulin}\selectfont}
\DeclareTextFontCommand{\textshold}{\fontfamily{frank}\selectfont}
\DeclareTextFontCommand{\textshscr}{\fontfamily{yad}\selectfont}
% note that redis is larger than shstk
\DeclareTextFontCommand{\textshstk}{\fontfamily{aharoni}\selectfont}

%%The following is the prefered way to set default fonts but it causes problems with english text
% set default fonts
%\ifnum \culmus@useDavid=0
	%\renewcommand{\rmdefault}{frank}
%\else
	%\renewcommand{\rmdefault}{david}
%\fi
%\renewcommand{\sfdefault}{nachlieli}
%\renewcommand{\ttdefault}{miriam}

% and finally: make it the default of HE8:
% this is done by defining font substitues for cm and lm
\DeclareFontFamily{HE8}{cmr}{}
\DeclareFontFamily{HE8}{lmr}{}
\ifnum \culmus@useDavid=0
	\DeclareFontShape{HE8}{cmr}{m}{n} {<-> s*[\font@scale]frank}{}
	\DeclareFontShape{HE8}{cmr}{m}{it} {<-> s*[\font@scale]franki}{}
	\DeclareFontShape{HE8}{cmr}{m}{sl} {<-> s*[\font@scale]franki}{}
	\DeclareFontShape{HE8}{cmr}{b}{n} {<-> s*[\font@scale]frankb}{}
	\DeclareFontShape{HE8}{cmr}{bx}{n} {<-> s*[\font@scale]frankb}{}
	\DeclareFontShape{HE8}{cmr}{bx}{it} {<-> s*[\font@scale]frankbi}{}

	\DeclareFontShape{HE8}{lmr}{m}{n} {<-> s*[\font@scale]frank}{}
	\DeclareFontShape{HE8}{lmr}{m}{it} {<-> s*[\font@scale]franki}{}
	\DeclareFontShape{HE8}{lmr}{m}{sl} {<-> s*[\font@scale]franki}{}
	\DeclareFontShape{HE8}{lmr}{b}{n} {<-> s*[\font@scale]frankb}{}
	\DeclareFontShape{HE8}{lmr}{bx}{n} {<-> s*[\font@scale]frankb}{}
	\DeclareFontShape{HE8}{lmr}{bx}{it} {<-> s*[\font@scale]frankbi}{}
\else
	\DeclareFontShape{HE8}{cmr}{m}{n} {<-> s*[\font@scale]david}{}
	\DeclareFontShape{HE8}{cmr}{m}{it} {<-> s*[\font@scale]davidi}{}
	\DeclareFontShape{HE8}{cmr}{m}{sl} {<-> s*[\font@scale]davidi}{}
	\DeclareFontShape{HE8}{cmr}{b}{n} {<-> s*[\font@scale]davidb}{}
	\DeclareFontShape{HE8}{cmr}{bx}{n} {<-> s*[\font@scale]davidb}{}
	\DeclareFontShape{HE8}{cmr}{bx}{it} {<-> s*[\font@scale]davidbi}{}

	\DeclareFontShape{HE8}{lmr}{m}{n} {<-> s*[\font@scale]david}{}
	\DeclareFontShape{HE8}{lmr}{m}{it} {<-> s*[\font@scale]davidi}{}
	\DeclareFontShape{HE8}{lmr}{m}{sl} {<-> s*[\font@scale]davidi}{}
	\DeclareFontShape{HE8}{lmr}{b}{n} {<-> s*[\font@scale]davidb}{}
	\DeclareFontShape{HE8}{lmr}{bx}{n} {<-> s*[\font@scale]davidb}{}
	\DeclareFontShape{HE8}{lmr}{bx}{it} {<-> s*[\font@scale]davidbi}{}
\fi

\DeclareFontFamily{HE8}{cmtt}{}
\DeclareFontShape{HE8}{cmtt}{m}{n} {<-> s*[\font@scale]miriam}{}
\DeclareFontShape{HE8}{cmtt}{m}{it} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{cmtt}{m}{sl} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{cmtt}{b}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{cmtt}{bx}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{cmtt}{bx}{it} {<-> s*[\font@scale]miriambi}{}

\DeclareFontFamily{HE8}{lmtt}{}
\DeclareFontShape{HE8}{lmtt}{m}{n} {<-> s*[\font@scale]miriam}{}
\DeclareFontShape{HE8}{lmtt}{m}{it} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{lmtt}{m}{sl} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{lmtt}{b}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{lmtt}{bx}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{lmtt}{bx}{it} {<-> s*[\font@scale]miriambi}{}

\DeclareFontFamily{HE8}{cmss}{}
\DeclareFontShape{HE8}{cmss}{m}{n} {<-> s*[\font@scale]nachlieli}{}
\DeclareFontShape{HE8}{cmss}{m}{it} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{cmss}{m}{sl} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{cmss}{b}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{cmss}{bx}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{cmss}{bx}{it} {<-> s*[\font@scale]nachlielibi}{}

\DeclareFontFamily{HE8}{lmss}{}
\DeclareFontShape{HE8}{lmss}{m}{n} {<-> s*[\font@scale]nachlieli}{}
\DeclareFontShape{HE8}{lmss}{m}{it} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{lmss}{m}{sl} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{lmss}{b}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{lmss}{bx}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{lmss}{bx}{it} {<-> s*[\font@scale]nachlielibi}{}

% Declare all font famelies used (this should go into *.fd files one day)
% fonts that are missing are commented out.
\DeclareFontFamily{HE8}{frank}{}
\DeclareFontShape{HE8}{frank}{m}{n} {<-> s*[\font@scale]frank}{}
\DeclareFontShape{HE8}{frank}{m}{it} {<-> s*[\font@scale]franki}{}
\DeclareFontShape{HE8}{frank}{m}{sl} {<-> s*[\font@scale]franki}{}
\DeclareFontShape{HE8}{frank}{b}{n} {<-> s*[\font@scale]frankb}{}
\DeclareFontShape{HE8}{frank}{bx}{n} {<-> s*[\font@scale]frankb}{}
\DeclareFontShape{HE8}{frank}{bx}{it} {<-> s*[\font@scale]frankbi}{}

\DeclareFontFamily{HE8}{david}{}
\DeclareFontShape{HE8}{david}{m}{n} {<-> s*[\font@scale]david}{}
\DeclareFontShape{HE8}{david}{m}{it} {<-> s*[\font@scale]davidi}{}
\DeclareFontShape{HE8}{david}{m}{sl} {<-> s*[\font@scale]davidi}{}
\DeclareFontShape{HE8}{david}{b}{n} {<-> s*[\font@scale]davidb}{}
\DeclareFontShape{HE8}{david}{bx}{n} {<-> s*[\font@scale]davidb}{}
\DeclareFontShape{HE8}{david}{bx}{it} {<-> s*[\font@scale]davidbi}{}

\DeclareFontFamily{HE8}{miriam}{}
\DeclareFontShape{HE8}{miriam}{m}{n} {<-> s*[\font@scale]miriam}{}
\DeclareFontShape{HE8}{miriam}{m}{it} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{miriam}{m}{sl} {<-> s*[\font@scale]miriami}{}
\DeclareFontShape{HE8}{miriam}{b}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{miriam}{bx}{n} {<-> s*[\font@scale]miriamb}{}
\DeclareFontShape{HE8}{miriam}{bx}{it} {<-> s*[\font@scale]miriambi}{}

\DeclareFontFamily{HE8}{nachlieli}{}
\DeclareFontShape{HE8}{nachlieli}{m}{n} {<-> s*[\font@scale]nachlieli}{}
\DeclareFontShape{HE8}{nachlieli}{m}{it} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{nachlieli}{m}{sl} {<-> s*[\font@scale]nachlielii}{}
\DeclareFontShape{HE8}{nachlieli}{b}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{nachlieli}{bx}{n} {<-> s*[\font@scale]nachlielib}{}
\DeclareFontShape{HE8}{nachlieli}{bx}{it} {<-> s*[\font@scale]nachlielibi}{}

\DeclareFontFamily{HE8}{aharoni}{}
\DeclareFontShape{HE8}{aharoni}{m}{n} {<-> s*[\font@scale]aharoni}{}
\DeclareFontShape{HE8}{aharoni}{m}{it} {<-> s*[\font@scale]aharonii}{}
\DeclareFontShape{HE8}{aharoni}{m}{sl} {<-> s*[\font@scale]aharonii}{}
\DeclareFontShape{HE8}{aharoni}{b}{n} {<-> s*[\font@scale]aharonib}{}
\DeclareFontShape{HE8}{aharoni}{bx}{n} {<-> s*[\font@scale]aharonib}{}
\DeclareFontShape{HE8}{aharoni}{bx}{it} {<-> s*[\font@scale]aharonibi}{}

\DeclareFontFamily{HE8}{ellinia}{}
\DeclareFontShape{HE8}{ellinia}{m}{n} {<-> s*[\font@scale]ellinia}{}
\DeclareFontShape{HE8}{ellinia}{m}{it} {<-> s*[\font@scale]elliniai}{}
\DeclareFontShape{HE8}{ellinia}{m}{sl} {<-> s*[\font@scale]elliniai}{}
\DeclareFontShape{HE8}{ellinia}{b}{n} {<-> s*[\font@scale]elliniab}{}
\DeclareFontShape{HE8}{ellinia}{bx}{n} {<-> s*[\font@scale]elliniab}{}
\DeclareFontShape{HE8}{ellinia}{bx}{it} {<-> s*[\font@scale]elliniabi}{}

\DeclareFontFamily{HE8}{yehuda}{}
\DeclareFontShape{HE8}{yehuda}{m}{n} {<-> s*[\font@scale]yehuda}{}
%\DeclareFontShape{HE8}{yehuda}{m}{it} {<-> s*[\font@scale]yehudai}{}
\DeclareFontShape{HE8}{yehuda}{m}{sl} {<-> s*[\font@scale]yehudai}{}
\DeclareFontShape{HE8}{yehuda}{b}{n} {<-> s*[\font@scale]yehudab}{}
\DeclareFontShape{HE8}{yehuda}{bx}{n} {<-> s*[\font@scale]yehudab}{}
%\DeclareFontShape{HE8}{yehuda}{bx}{it} {<-> s*[\font@scale]yehudabi}{}

\DeclareFontFamily{HE8}{drugulin}{}
%\DeclareFontShape{HE8}{drugulin}{m}{n} {<-> s*[\font@scale]drugulin}{}
%\DeclareFontShape{HE8}{drugulin}{m}{it} {<-> s*[\font@scale]drugulini}{}
%\DeclareFontShape{HE8}{drugulin}{m}{sl} {<-> s*[\font@scale]drugulini}{}
\DeclareFontShape{HE8}{drugulin}{b}{n} {<-> s*[\font@scale]drugulinb}{}
\DeclareFontShape{HE8}{drugulin}{bx}{n} {<-> s*[\font@scale]drugulinb}{}
\DeclareFontShape{HE8}{drugulin}{bx}{it} {<-> s*[\font@scale]drugulinbi}{}

%Fix some nikud naming problems
\let\hebsheva=\sheva
\let\hebhatafsegol=\hatafsegol
\let\hebhatafpatah=\hatafpatah
\let\hebhatafqamats=\hatafqamats
\let\hebhiriq=\hiriq
\let\hebtsere=\tsere
\let\hebsegol=\segol
\let\hebpatah=\patah
\let\hebqamats=\qamats
\let\hebholam=\holam
\let\hebqubuts=\qubuts
\let\hebdagesh=\dagesh
\let\hebmeteg=\meteg
\let\hebmaqaf=\maqaf
\let\hebrafe=\rafe
\let\hebpaseq=\paseq
\let\hebshindot=\shindot
\let\hebsindot=\sindot
\let\hebsofpasuq=\sofpasuq

