% "Pierre Marchand ne doute de rien :-)"
% We’ll try to give the relevant syntax for the
% 16 rules edicted in chapter 9 section 1 of
% Unicode 5.0 for the rendering of Devanagari.
%   Note: knowing average nothing in Devanagari,
% expect that it will be all wrong.
%   Note2: I try to always use Unicode value when
% it’s possible to clearly distinguish between
% fixed and dynamic points. In real world a compact form
% with only char properties would be appropriate.
%   Note3: To have it actually working, one wants to
% reorder so longer patterns come first.
%   Note4: OTF Features are basically those that give good
% results with Lohit Hindi font, I tried sometimes to 
% get the same result with Gargi font by appending other
% features (e.g. R14 "blws").
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% CUSTOM %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
.(R) .(H) .(C) .(H) .(C) .(H) .(C) .(H) .(C) | .3(half) .4(half) .5(half) .6(half) .7(half) .8(half) .9 .1(rphf) .2(rphf)
.(C) .(H) .(C) .(H) .(R) |  .1(half;pres) .2(half;pres) .3(half;pres) .5(blwf) .4(blwf)
.(C) .(H) .(R) .(H) .(C) .(m) | .6 .1(half;blwf;vatu) .2(half;blwf;vatu) .3(half;blwf;vatu) .4(half;blwf;vatu) .5(half)
.(C) .(H) .(R) .(H) | .1(half;blwf;vatu) .2(half;blwf;vatu) .3(half;blwf;vatu) .4(half;blwf;vatu)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% - R16 -
% TAd + [ZWNJ] + RAl + Ivs => TAd + Ivs + RAl
.(C) .(H) .(ZWNJ) .(R) .(m) | .1(blwm) .2(blwm) .5 .4 
%
% - R15 -
% TAd + RAl + Ivs => T.RAn + Ivs => Ivs + T.RAd
.(C) .(H) .(R) .(m) | .4 .1(blwf;vatu;half) .3(blwf;vatu;half) .2(blwf;vatu;half)
%
%% - Figure 9-8 -
% Still here but I guess that, at some point, we’ll have to put it at the end
% KAn + Ivs => Ivs + KAn
.(C) .(m) | .2 .1
%
%% - R14 -
% RAl + Uvs => RUn
.(R) .(b) | .1(psts;blws) .2(psts;blws)
%
%% - R13 -
% KAn + RAsub => K.RAn
.(C) .(R) .(H) .(C) | .1 .4 .2(rphf;abvm) .3
.(C) .(R) .(m) | .3 .1 .2(blwf)
.(C) .(R) | .1 .2(blwf)
%
%% - R12 -
% SAd + TAd + RAn => SAd + T.RAn => S.T.RAn
.(C) .(H) .(C) .(H) .(R) | .1(akhn;half) .2(akhn;half) .3(akhn;half) .4(akhn;half) .5
%
%% - R11 -
% JAd + NYAl => J.NYAn
% We need to match CHCH before CHC.
.(C) .(H) .(C) .(H) | .1(akhn;half) .2(akhn;half) .3(akhn;half) .4(akhn;half)
.(C) .(H) .(C) .(m)| .4 .1(akhn;half) .2(akhn;half) .3(akhn;half) 
.(C) .(H) .(C) | .1(akhn;half;pres) .2(akhn;half;pres) .3(akhn;half;pres)
%
%% - R10 -
% KAn + AAvs + CANDRABINDUn
% I must be under-equiped with brain, I can’t get it.
%
%% - R9 -
% KAn + NUKTAn + VIRAMAn => QAd 
.(C) .(Nukta) .(H) .(m) | .4 .1(nukt) .2(nukt) .3
.(C) .(Nukta) .(H) | .1(nukt) .2(nukt) .3
%
%% - R8 -
% T.RAd + YAl => T.R.YAn
.(C) .(H) .(R) .(H) .(C) .(m) | .6 .1(half) .3(blwf;vatu;half) .4(half) .5
.(C) .(H) .(R) .(H) .(C) | .1(half) .3(blwf;vatu;half) .4(half) .5
% TAd + RAd => TAn + RAsub + VIRAMAn => T.RAd
.(C) .(H) .(R) .(H) | .1 .3(blwf;vatu) .2
%
%% - R7 -
% "For certain consonants"? "may"? It’s not how
% a _rule_ should be written IYWMO. But the most important
% point is that I don’t know what’s different in pattern
% from R6. #TODO ask to RahulB
% PHAd + RAl => PHAn + RAsub
.(C) .(H) .(R) .(m) | .4 .1(blwf;vatu) .3(blwf;vatu) .2(blwf;vatu)
.(C) .(H) .(R) | .1(blwf;vatu) .3(blwf;vatu) .2(blwf;vatu)
%
%% - R6 -
% TTHAd + RAl => TTHAn + RAsub
.(C) .(H) .(R) .(m) | .4 .1 .3(blwf) .2(blwf)
.(C) .(H) .(R) | .1 .3(blwf) .2(blwf)
%
%% - R5a -
% RAd + ZWJ => RAh
.(R) .(H) .(ZWJ) .(m) | .3 .1(half) .2(half)
.(R) .(H) .(ZWJ) | .1(half) .2(half)
%
%% - R5 -
% RRAn + VIRAMAn => RRAh
.(RR) .(H) .(m) | .3 .1(half) .1(half)
.(RR) .(H) | .1(half) .1(half)
%
%% - R4 -
% RAd + GAd + [ZWJ] + GHAl => GAh + GHAl + RAsup
.(R) .(H) .(C) .(H) .(ZWJ) .(C) .(m) | .7 .3(half) .6 .1(rphf) .2
.(R) .(H) .(C) .(H) .(ZWJ) .(C) | .3(half) .6 .1(rphf) .2
%
%% - R3 -
% RAd + JAd + NYAl => J.NYAn + RAsup
.(R) .(H) .(C) .(H) .(C) .(m) | .6 .3(akhn;half) .5(akhn;half) .1(rphf) .2
.(R) .(H) .(C) .(H) .(C) | .3(akhn;half) .5(akhn;half) .1(rphf) .2
%
%% - R2 -
% RAd + KAl => KAl + RAsup
.(R) .(H) .(C) .(H) .(R) .(m) .(A) | .6 .3(blwf;vatu) .1(blwf;vatu) .2(blwf;vatu) .1(rphf;abvs) .2(rphf;abvs) .7(abvs)
.(R) .(H) .(C) .(m) | .4 .3 .1(rphf) .2
.(R) .(H) .(C) | .3(abvm) .1(rphf;abvm) .2
%
%% - R1 - 
% If "dead" feature would exist, it would give:
% .(C)U094D|.1(dead) 
%
% 
% Follow some "guessed rules". Ça vaut ce que ça vaut :)
.(N) .(H) | .1(blwm) .2(blwm)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%