libraries/mpdf/classes/indic.php
public static function decompose_indic($ab)
	{
		$sub = array();
		switch ($ab) {
			/*
			 * Decompose split matras.
			 */
			/* bengali */
			case 0x9cb : $sub[0] = 0x9c7;
				$sub[1] = 0x9be;
				return $sub;
			case 0x9cc : $sub[0] = 0x9c7;
				$sub[1] = 0x9d7;
				return $sub;
			/* oriya */
			case 0xb48 : $sub[0] = 0xb47;
				$sub[1] = 0xb56;
				return $sub;
			case 0xb4b : $sub[0] = 0xb47;
				$sub[1] = 0xb3e;
				return $sub;
			case 0xb4c : $sub[0] = 0xb47;
				$sub[1] = 0xb57;
				return $sub;
			/* tamil */
			case 0xbca : $sub[0] = 0xbc6;
				$sub[1] = 0xbbe;
				return $sub;
			case 0xbcb : $sub[0] = 0xbc7;
				$sub[1] = 0xbbe;
				return $sub;
			case 0xbcc : $sub[0] = 0xbc6;
				$sub[1] = 0xbd7;
				return $sub;
			/* telugu */
			case 0xc48 : $sub[0] = 0xc46;
				$sub[1] = 0xc56;
				return $sub;
			/* kannada */
			case 0xcc0 : $sub[0] = 0xcbf;
				$sub[1] = 0xcd5;
				return $sub;
			case 0xcc7 : $sub[0] = 0xcc6;
				$sub[1] = 0xcd5;
				return $sub;
			case 0xcc8 : $sub[0] = 0xcc6;
				$sub[1] = 0xcd6;
				return $sub;
			case 0xcca : $sub[0] = 0xcc6;
				$sub[1] = 0xcc2;
				return $sub;
			case 0xccb : $sub[0] = 0xcc6;
				$sub[1] = 0xcc2;
				$sub[2] = 0xcd5;
				return $sub;
			/* malayalam */
			case 0xd4a : $sub[0] = 0xd46;
				$sub[1] = 0xd3e;
				return $sub;
			case 0xd4b : $sub[0] = 0xd47;
				$sub[1] = 0xd3e;
				return $sub;
			case 0xd4c : $sub[0] = 0xd46;
				$sub[1] = 0xd57;
				return $sub;
			/* sinhala */
			// NB Some fonts break with these Sinhala decomps (although this is Uniscribe spec)
			// Can check if character would be substituted by pstf and only decompose if true
			// e.g. if (isset($GSUBdata['pstf'][$ab])) - would need to pass $GSUBdata as parameter to this function
			case 0xdda : $sub[0] = 0xdd9;
				$sub[1] = 0xdca;
				return $sub;
			case 0xddc : $sub[0] = 0xdd9;
				$sub[1] = 0xdcf;
				return $sub;
			case 0xddd : $sub[0] = 0xdd9;
				$sub[1] = 0xdcf;
				$sub[2] = 0xdca;
				return $sub;
			case 0xdde : $sub[0] = 0xdd9;
				$sub[1] = 0xddf;
				return $sub;
			/* khmer */
			case 0x17be : $sub[0] = 0x17c1;
				$sub[1] = 0x17be;
				return $sub;
			case 0x17bf : $sub[0] = 0x17c1;
				$sub[1] = 0x17bf;
				return $sub;
			case 0x17c0 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c0;
				return $sub;

			case 0x17c4 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c4;
				return $sub;
			case 0x17c5 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c5;
				return $sub;
			/* tibetan - included here although does not use Inidc shaper in other ways  */
			case 0xf73 : $sub[0] = 0xf71;
				$sub[1] = 0xf72;
				return $sub;
			case 0xf75 : $sub[0] = 0xf71;
				$sub[1] = 0xf74;
				return $sub;
			case 0xf76 : $sub[0] = 0xfb2;
				$sub[1] = 0xf80;
				return $sub;
			case 0xf77 : $sub[0] = 0xfb2;
				$sub[1] = 0xf81;
				return $sub;
			case 0xf78 : $sub[0] = 0xfb3;
				$sub[1] = 0xf80;
				return $sub;
			case 0xf79 : $sub[0] = 0xfb3;
				$sub[1] = 0xf71;
				$sub[2] = 0xf80;
				return $sub;
			case 0xf81 : $sub[0] = 0xf71;
				$sub[1] = 0xf80;
				return $sub;
		}
		return false;
	}
public static function decompose_indic($ab)
	{
		$sub = array();
		switch ($ab) {
			/*
			 * Decompose split matras.
			 */
			/* bengali */
			case 0x9cb : $sub[0] = 0x9c7;
				$sub[1] = 0x9be;
				return $sub;
			case 0x9cc : $sub[0] = 0x9c7;
				$sub[1] = 0x9d7;
				return $sub;
			/* oriya */
			case 0xb48 : $sub[0] = 0xb47;
				$sub[1] = 0xb56;
				return $sub;
			case 0xb4b : $sub[0] = 0xb47;
				$sub[1] = 0xb3e;
				return $sub;
			case 0xb4c : $sub[0] = 0xb47;
				$sub[1] = 0xb57;
				return $sub;
			/* tamil */
			case 0xbca : $sub[0] = 0xbc6;
				$sub[1] = 0xbbe;
				return $sub;
			case 0xbcb : $sub[0] = 0xbc7;
				$sub[1] = 0xbbe;
				return $sub;
			case 0xbcc : $sub[0] = 0xbc6;
				$sub[1] = 0xbd7;
				return $sub;
			/* telugu */
			case 0xc48 : $sub[0] = 0xc46;
				$sub[1] = 0xc56;
				return $sub;
			/* kannada */
			case 0xcc0 : $sub[0] = 0xcbf;
				$sub[1] = 0xcd5;
				return $sub;
			case 0xcc7 : $sub[0] = 0xcc6;
				$sub[1] = 0xcd5;
				return $sub;
			case 0xcc8 : $sub[0] = 0xcc6;
				$sub[1] = 0xcd6;
				return $sub;
			case 0xcca : $sub[0] = 0xcc6;
				$sub[1] = 0xcc2;
				return $sub;
			case 0xccb : $sub[0] = 0xcc6;
				$sub[1] = 0xcc2;
				$sub[2] = 0xcd5;
				return $sub;
			/* malayalam */
			case 0xd4a : $sub[0] = 0xd46;
				$sub[1] = 0xd3e;
				return $sub;
			case 0xd4b : $sub[0] = 0xd47;
				$sub[1] = 0xd3e;
				return $sub;
			case 0xd4c : $sub[0] = 0xd46;
				$sub[1] = 0xd57;
				return $sub;
			/* sinhala */
			// NB Some fonts break with these Sinhala decomps (although this is Uniscribe spec)
			// Can check if character would be substituted by pstf and only decompose if true
			// e.g. if (isset($GSUBdata['pstf'][$ab])) - would need to pass $GSUBdata as parameter to this function
			case 0xdda : $sub[0] = 0xdd9;
				$sub[1] = 0xdca;
				return $sub;
			case 0xddc : $sub[0] = 0xdd9;
				$sub[1] = 0xdcf;
				return $sub;
			case 0xddd : $sub[0] = 0xdd9;
				$sub[1] = 0xdcf;
				$sub[2] = 0xdca;
				return $sub;
			case 0xdde : $sub[0] = 0xdd9;
				$sub[1] = 0xddf;
				return $sub;
			/* khmer */
			case 0x17be : $sub[0] = 0x17c1;
				$sub[1] = 0x17be;
				return $sub;
			case 0x17bf : $sub[0] = 0x17c1;
				$sub[1] = 0x17bf;
				return $sub;
			case 0x17c0 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c0;
				return $sub;

			case 0x17c4 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c4;
				return $sub;
			case 0x17c5 : $sub[0] = 0x17c1;
				$sub[1] = 0x17c5;
				return $sub;
			/* tibetan - included here although does not use Inidc shaper in other ways  */
			case 0xf73 : $sub[0] = 0xf71;
				$sub[1] = 0xf72;
				return $sub;
			case 0xf75 : $sub[0] = 0xf71;
				$sub[1] = 0xf74;
				return $sub;
			case 0xf76 : $sub[0] = 0xfb2;
				$sub[1] = 0xf80;
				return $sub;
			case 0xf77 : $sub[0] = 0xfb2;
				$sub[1] = 0xf81;
				return $sub;
			case 0xf78 : $sub[0] = 0xfb3;
				$sub[1] = 0xf80;
				return $sub;
			case 0xf79 : $sub[0] = 0xfb3;
				$sub[1] = 0xf71;
				$sub[2] = 0xf80;
				return $sub;
			case 0xf81 : $sub[0] = 0xf71;
				$sub[1] = 0xf80;
				return $sub;
		}
		return false;
	}
public static function decompose_indic ( $ ab ) { $ sub = array ( ) ; switch ( $ ab ) { /*
			 * Decompose split matras.
			 */ /* bengali */ case 0x9cb : $ sub [ 0 ] = 0x9c7 ; $ sub [ 1 ] = 0x9be ; return $ sub ; case 0x9cc : $ sub [ 0 ] = 0x9c7 ; $ sub [ 1 ] = 0x9d7 ; return $ sub ; /* oriya */ case 0xb48 : $ sub [ 0 ] = 0xb47 ; $ sub [ 1 ] = 0xb56 ; return $ sub ; case 0xb4b : $ sub [ 0 ] = 0xb47 ; $ sub [ 1 ] = 0xb3e ; return $ sub ; case 0xb4c : $ sub [ 0 ] = 0xb47 ; $ sub [ 1 ] = 0xb57 ; return $ sub ; /* tamil */ case 0xbca : $ sub [ 0 ] = 0xbc6 ; $ sub [ 1 ] = 0xbbe ; return $ sub ; case 0xbcb : $ sub [ 0 ] = 0xbc7 ; $ sub [ 1 ] = 0xbbe ; return $ sub ; case 0xbcc : $ sub [ 0 ] = 0xbc6 ; $ sub [ 1 ] = 0xbd7 ; return $ sub ; /* telugu */ case 0xc48 : $ sub [ 0 ] = 0xc46 ; $ sub [ 1 ] = 0xc56 ; return $ sub ; /* kannada */ case 0xcc0 : $ sub [ 0 ] = 0xcbf ; $ sub [ 1 ] = 0xcd5 ; return $ sub ; case 0xcc7 : $ sub [ 0 ] = 0xcc6 ; $ sub [ 1 ] = 0xcd5 ; return $ sub ; case 0xcc8 : $ sub [ 0 ] = 0xcc6 ; $ sub [ 1 ] = 0xcd6 ; return $ sub ; case 0xcca : $ sub [ 0 ] = 0xcc6 ; $ sub [ 1 ] = 0xcc2 ; return $ sub ; case 0xccb : $ sub [ 0 ] = 0xcc6 ; $ sub [ 1 ] = 0xcc2 ; $ sub [ 2 ] = 0xcd5 ; return $ sub ; /* malayalam */ case 0xd4a : $ sub [ 0 ] = 0xd46 ; $ sub [ 1 ] = 0xd3e ; return $ sub ; case 0xd4b : $ sub [ 0 ] = 0xd47 ; $ sub [ 1 ] = 0xd3e ; return $ sub ; case 0xd4c : $ sub [ 0 ] = 0xd46 ; $ sub [ 1 ] = 0xd57 ; return $ sub ; /* sinhala */ // NB Some fonts break with these Sinhala decomps (although this is Uniscribe spec) // Can check if character would be substituted by pstf and only decompose if true // e.g. if (isset($GSUBdata['pstf'][$ab])) - would need to pass $GSUBdata as parameter to this function case 0xdda : $ sub [ 0 ] = 0xdd9 ; $ sub [ 1 ] = 0xdca ; return $ sub ; case 0xddc : $ sub [ 0 ] = 0xdd9 ; $ sub [ 1 ] = 0xdcf ; return $ sub ; case 0xddd : $ sub [ 0 ] = 0xdd9 ; $ sub [ 1 ] = 0xdcf ; $ sub [ 2 ] = 0xdca ; return $ sub ; case 0xdde : $ sub [ 0 ] = 0xdd9 ; $ sub [ 1 ] = 0xddf ; return $ sub ; /* khmer */ case 0x17be : $ sub [ 0 ] = 0x17c1 ; $ sub [ 1 ] = 0x17be ; return $ sub ; case 0x17bf : $ sub [ 0 ] = 0x17c1 ; $ sub [ 1 ] = 0x17bf ; return $ sub ; case 0x17c0 : $ sub [ 0 ] = 0x17c1 ; $ sub [ 1 ] = 0x17c0 ; return $ sub ; case 0x17c4 : $ sub [ 0 ] = 0x17c1 ; $ sub [ 1 ] = 0x17c4 ; return $ sub ; case 0x17c5 : $ sub [ 0 ] = 0x17c1 ; $ sub [ 1 ] = 0x17c5 ; return $ sub ; /* tibetan - included here although does not use Inidc shaper in other ways  */ case 0xf73 : $ sub [ 0 ] = 0xf71 ; $ sub [ 1 ] = 0xf72 ; return $ sub ; case 0xf75 : $ sub [ 0 ] = 0xf71 ; $ sub [ 1 ] = 0xf74 ; return $ sub ; case 0xf76 : $ sub [ 0 ] = 0xfb2 ; $ sub [ 1 ] = 0xf80 ; return $ sub ; case 0xf77 : $ sub [ 0 ] = 0xfb2 ; $ sub [ 1 ] = 0xf81 ; return $ sub ; case 0xf78 : $ sub [ 0 ] = 0xfb3 ; $ sub [ 1 ] = 0xf80 ; return $ sub ; case 0xf79 : $ sub [ 0 ] = 0xfb3 ; $ sub [ 1 ] = 0xf71 ; $ sub [ 2 ] = 0xf80 ; return $ sub ; case 0xf81 : $ sub [ 0 ] = 0xf71 ; $ sub [ 1 ] = 0xf80 ; return $ sub ; } return false ; }
Should always fully decompose and then recompose back, but we will just do the split matras
Should always fully decompose and then recompose back but we will just do the split matras