% This file is part of the TeluguTeX Software Package. %Copyright (c) 1991 Lakshmankumar Mukkavilli % %The TeluguTeX Software Package is distributed in the hope that %it will be useful,but WITHOUT ANY WARRANTY. No author or distributor %accepts responsibility to anyone for the consequences of using it %or for whether it serves any particular purpose or works at all, %unless he says so in writing. Refer to the TeluguTeX Software Package %General Public License for full details. % %Everyone is granted permission to copy, modify and redistribute %the TeluguTeX Software Package, but only under the conditions described in the %TeluguTeX Software Package General Public License. A copy of this license is %supposed to have been given to you along with TeluguTeX Software Package so you %can know your rights and responsibilities. It should be in a %file named CopyrightLong. Among other things, the copyright notice %and this notice must be preserved on all copies. %%%%%% % % The macros in this file are used for recognizing the componants of % of a syllable and building the syllable from constituent symbols % from the current font. This file also contains macros for % processing various accents. % When tlxlate.tex recognizes a consonant X the macro \tlcbX is % invoked. When tlxlate.tex recognizes a vowel Y the macro \tlvoY % is invoked. \tlcbX invokes the macro \tlconsonant with certain % parameters concerning X. Similarly \tlvoY invokes the macro % \tlvowel with certain parameters concerning Y. \tlconsonant % and \tlvowel are key macros. % \tlcosonant: % If the consonant is the base consonant % then % set appropriate flags. initialize syllable box with % the base consonant. % else % (this is a consonant conjunct that modifies the last % base consonant.) save the token (\tlccX)on the consonant % conjunct list. This list is executed after base consonant % is modified by a vowel. % endif % % \tlvowel: % If the vowel is independent(stand alone) % then % syllable consists of just this vowel. % place this vowel in the syllable box. % else % (this is a vowel modifier.) % check if the base consonant when modified by this vowel % needs any special handling. % If yes then invoke the macro \tlcvXY macro % else invoke the standard vowel modifier macro(\tlvmY) % execute macros on consonant conjunct list. % endif % add space in the syllable box. % if preceeded by a box then insert a discretionary hyphen. % release the syllable box. % % processing accents: % when tlxlate.tex reads an accent it invokes a macro(there is a % macro for each accent) in this file. Typically processing an % accent involves pulling off the last box and applying the % accent. % \input tloffsets %macro naming conventions: %macro names begin with either tl or zz. Macros that begin with zz are those %that are invoked after declaration of active characters used in %transliteration. %\tlbmxxx These are used for box manipulation %\tlcbxxx When a consonant is read these macros are invoked(consonant base) %\tlvmxxx These process vowel modifiers %\tlvoxxx When a vowel is read these macros are invoked %\tlccxxx Process consonant conjuncts %\tlcvxxx Processes consonant+vowel combination. Existance of this % macros indicates that the con.+vowel combination % needs special treatment. The name of this macro is % \tlcv+consonant+vowel %Following are the declarations for fonts. If some of these are %not available then those statements must be commented out. %Else TeX will complain that 'TFM file is not found'. \font\tla=tel10 \font\tlanx=tel10nx \font\tlany=tel10ny \font\tlab=tel10b \font\tlas=tel10s \font\tlb=tel11 \font\tlbnx=tel11nx \font\tlbny=tel11ny \font\tlbb=tel11b \font\tlbs=tel11s \font\tlc=tel12 \font\tlcnx=tel12nx \font\tlcny=tel12ny \font\tlcb=tel12b \font\tlcs=tel12s \font\tld=tel15 \font\tldb=tel15b \font\tlds=tel15s \font\tle=tel18 \font\tleb=tel18b \font\tles=tel18s \font\tlf=tel20 \font\tlfb=tel20b \font\tlfs=tel20s \font\tlg=tel25 \font\tlgb=tel25b \font\tlgs=tel25s \font\tlh=tel30 \font\tlhs=tel30s \font\tli=tel35 \font\tlis=tel35s \font\tlj=tel40 \font\tljs=tel40s \font\tlk=tel55 \font\tlks=tel55s \font\tll=tel72 \font\tlm=tel100 \font\tln=tel172 \font\tlspa=telspa \font\tlspb=telspb \font\tlspc=telspc \newcount\cbcode % code for the base consonant of the syllable % zero if lone vowel \newcount\zzBCBF %contains code for telugu digit zero \zzBCBF=\dtzeroCODE \cbcode=0 %initialize \newtoks\cbtok %contains the macro name to process consonant+vowel \newtoks\votok %contains vowel \newtoks\cctok %contains the list of macros to process % consonant conjuncts \cctok={} %initialize \newdimen\vmpivot % offset from left edge of the boundingbox for the % base consonant. Used for alligning some vowel modifiers. % in em units. \newdimen\ccpivot % offset from left edge of the boundingbox for the % base consonant. used for alligning consonant conjuncts % and bottom symbol of vowel modifier for y.in em units. \newdimen\cpivot % This register contains dimen from \vmpivot initially % After vowel modifier is processed this register % contains dimen from \ccpivot. in em units % Used by \tlbms, \tlbmsl and \tlbmsr for allignment. \newdimen\leftovershoot % Amount by which a vowel modifier/accent goes % to the left of the consonant left boundary. % Used to increment ccpivot, xxxxOFFSETC's \newdimen\lshift % used in \tlbms. contains amount of left shift \newdimen\rl % contains amount by which symbols are raised/lowered \newdimen\scrdima % for scratch work \newdimen\bcwidth % base consonant width , used in \tlbms,\tlbmsl and \tlbmsr \newcount\vmcode % code for the vowel in the syllable \newcount\checkflag % some consonants(base) have a 'check' mark on the top % This register contains 0 if no 'check' is present % 1 if 'check' is present \newcount\consprime % contains prime number product for current consonant \newcount\vowprime % contains prime number code for the current vowel \newcount\scrprime % used as scratch for prime factoring \newbox\syl % box where syllable(akshara) is built \newbox\sym % used in \tlbms. contains a symbol from the font \newbox\testvoid % used for saving \lastbox at the time of hyphenation \def\tlbmspace{0.1em}% amount of space inserted after a syllable \def\tlbmshift#1#2{% \setbox\sym=\hbox{\char#1}% %we need to consider the situation where the \sym might overshoot %\syl on the left. If so we will attach an empty box of width(p2-p1) %on the left. p2 is #2 and p1 is in cpivot.First compute (p2-p1) \scrdima=#2em\advance\scrdima by-\cpivot %if (p2-p1)>0 then 1. add a hbox of width (p2-p1) on the left % 2. cpivot = cpivot + (p2-p1) % 3. vmpivot = vmpivot + (p2-p1) % 4. leftovershoot = leftovershoot + (p2-p1) % we do not increment ccpivot because just before cctok list % is executed ccpivot is incremented by leftovershoot(in \tlbmro) \ifdim\scrdima>0em \setbox\syl=\hbox{\hbox to \scrdima{}\box\syl}% \advance\cpivot by \scrdima % \advance\ccpivot by \scrdima \advance\vmpivot by \scrdima \advance\leftovershoot by\scrdima \fi \bcwidth=\wd\syl%width of the box \sty %compute (w-p1)+p2 \lshift=\wd\syl \advance\lshift by -\cpivot \advance\lshift by #2em} \def\tlbmadjustwidth{% %If the right edge of \sym is to the left of the right edge %of \syl then we want the width of the resultant box to be %original width of \syl (w1, saved in \bcwidth) %if (w2-p2)<(w1-p1)then width of \syl=w1 %or if 0