%D \module
%D   [       file=type-imp-husayni,
%D        version=2008.08.08, % or whatever ... onwards
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Husayni,
%D         author=Idris Samawi Hamid \& Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D For a detailed list of features and names, see husayni.lfg. In fact, the following
%D sets will go there.

\definefontfeature
  [husayni-default]
  [analyze=yes,
   mode=node,
   language=dflt,
   script=arab,
   ccmp=yes, % adds identity dots to unicode letters; includes dynamic dot placement
   init=yes, % contextual analysis
   medi=yes, % contextual analysis
   fina=yes, % contextual analysis
   rlig=yes, % indispensable
   calt=yes, % ayah+numerals
   salt=yes, % includes manual justification with Tatwiil
   anum=yes, % replace latin numerals with arabic-script ones
   ss01=yes, % Allah, Muhammad,
   ss03=yes, % level-1 stack over Jiim, initial entry only
   ss10=yes, % basic dipped Miim, initial-entry B_S-stack over Miim
   ss12=yes, % XBM_im initial-medial entry B_S-stack over Miim,
   ss15=yes, % full stacked Laam-on-Miim
   ss16=yes, % initial entry, stacked Ayn-on-Miim
   ss19=yes, % LM_im
   ss24=yes, % BR_i_mf, BN_i_mf
   ss25=yes, % basic LH_im % might merge with ss24
   ss26=yes, % full Yaa.final special strings: BY_if, BY_mf, LY_mf
   ss27=yes, % basic thin Miim.final
   ss31=yes, % basic Raa.final strings: JR and SR
   ss34=yes, % AyR style % also available in jsnn
   ss35=yes, % full Kaaf contexts
   ss36=yes, % full Laam contexts
   ss37=yes, % Miim-Miim contexts
   ss38=yes, % basic dipped Haa, B_SH_mm
   ss41=yes, % high and low Baa strings
   ss42=yes, % diagonal entry
   ss43=yes, % initial alternates
   ss60=yes, %
   js16=yes, % aesthetic medial Faa/Qaaf
   kern=yes, % includes kerning of dot-base pairs, and final pairs in continuous strings
   curs=yes, % we don't curs final pairs, padj for that
   mark=yes, % vowels
   mkmk=yes, % stacked vowels
   tlig=yes,
   goodies=husayni,
   colorscheme=default]

\definefontfeature
  [husayni-alternative] % was husayni-default2
  [analyze=yes,
   mode=node,
   language=dflt,
   script=arab,
   ccmp=yes, % adds identity dots to unicode letters; includes dynamic dot placement
   init=yes, % contextual analysis
   medi=yes, % contextual analysis
   fina=yes, % contextual analysis
   rlig=yes, % indispensable
   calt=yes, % ayah+numerals
   salt=yes, % includes manual justification with Tatwiil
   anum=yes, % replace latin numerals with arabic-script ones
   ss01=yes, % Allah, Muhammad,
   ss03=yes, % level-1 stack over Jiim, initial entry only
   ss10=yes, % basic dipped Miim, initial-entry B_S-stack over Miim
   ss12=yes, % XBM_im initial-medial entry B_S-stack over Miim,
   ss15=yes, % full stacked Laam-on-Miim
   ss16=yes, % initial entry, stacked Ayn-on-Miim
   ss19=yes, % LM_im
   ss24=yes, % BR_i_mf, BN_i_mf
   ss25=yes, % basic LH_im % might merge with ss24
   ss26=yes, % full Yaa.final special strings: BY_if, BY_mf, LY_mf
   ss27=yes, % basic thin Miim.final
   ss31=yes, % basic Raa.final strings: JR and SR
   ss34=yes, % AyR style % also available in jsnn
   ss35=yes, % full Kaaf contexts
   ss36=yes, % full Laam contexts
   ss37=yes, % Miim-Miim contexts
   ss38=yes, % basic dipped Haa, B_SH_mm
   ss41=yes, % high and low Baa strings
   ss42=yes, % diagonal entry
   ss43=yes, % initial alternates
   ss60=yes, %
   js16=yes, % aesthetic medial Faa/Qaaf
   kern=yes, % includes kerning of dot-base pairs, and final pairs in continuous strings
   curs=yes, % we don't curs final pairs, padj for that
   mark=yes, % vowels
   mkmk=yes, % stacked vowels
   tlig=yes]

\definefontfeature
  [husayni-tt]
  [analyze=yes,
   mode=node,
   language=dflt,
   script=arab,
   ccmp=yes,
   init=yes,
   medi=yes,
   fina=yes,
   rlig=yes,
   fchr=yes,
   kern=yes,
   curs=yes,
   mark=yes,
   mkmk=yes]

\definefontfeature
  [husayni-mono]
  [analyze=yes,
   mode=node,
   language=dflt,
   script=arab,
   ccmp=no,
   init=yes,
   medi=yes,
   fina=yes,
   isol=yes,
   mset=yes]

\definedelimitedtext
  [ornatequote]
  [left={‏\char"FD3F\penalty10000},
   right={‏\char"FD3E\penalty10000}]

\definedelimitedtext
  [arparenthesis]
  [left={‏\char"0028},
   right={‏\char"0029}]

\definedelimitedtext
  [arquotation]
  [left={‏\symbol[rightquotation]},
   right={‏\symbol[leftquotation]},
   leftmargin=standard]

\definedelimitedtext
  [arquote]
  [left={‏\symbol[rightquote]},
   right={‏\symbol[leftquote]},
   leftmargin=standard]

\definebodyfontenvironment
  [husayni-default]
  [default]
  [interlinespace=4.4ex]

\definefontfallback
  [husayni-latin]
  [file:lmroman12-regular*default]
  [basiclatin,latin-1supplement,latinextended-A,latinextendedadditional]
  [force=no,
   rscale=.7]

\definefontfallback
   [husayni-mono]
   [file:cour*husayni-mono]
   [arabic,arabicpresentationformsa,arabicpresentationformsb,arabicsupplement,0x200C,0x200D,0x200E,0x200F]
 % [force=no]

\definebodyfontenvironment[20.7pt]
\definebodyfontenvironment[24.8pt]
\definebodyfontenvironment[29.8pt]
\definebodyfontenvironment[35.8pt]

\starttypescriptcollection[husayni]

    \starttypescript [naskh] [husayni] [name]
        \definefontsynonym [Arabic-Light]       [name:husayni] [goodies=husayni,features=husayni-default]
        \definefontsynonym [Arabic-Bold]        [name:husayni] [goodies=husayni,features=husayni-default]
        \definefontsynonym [Arabic-Italic]      [name:husayni] [goodies=husayni,features=husayni-default]
        \definefontsynonym [Arabic-Bold-Italic] [name:husayni] [goodies=husayni,features=husayni-default]

        \definefontsynonym [Serif]           [Arabic-Light]
        \definefontsynonym [SerifItalic]     [Arabic-Italic]
        \definefontsynonym [SerifBold]       [Arabic-Bold]
        \definefontsynonym [SerifBoldItalic] [Arabic-Bold-Italic]
    \stoptypescript

    \starttypescript [husayni-default]
        \definetypeface [husayni-default] [rm] [naskh] [husayni]  [default] [fallbacks=husayni-latin]
        \definetypeface [husayni-default] [tt] [mono]  [modern]   [default] [fallbacks=husayni-latin]
        \definetypeface [husayni-default] [mm] [math]  [xitsbidi] [default]
    \stoptypescript

\stoptypescriptcollection
