/// <summary> /// Restores removed tashkeel. /// </summary> public static void RestoreTashkeel(FastStringBuilder letters) { foreach (TashkeelLocation location in TashkeelLocations) { letters.Insert(location.Position, location.Tashkeel); } }
/// <summary> /// Restores removed tashkeel. /// </summary> public static void RestoreTashkeel(FastStringBuilder letters) { int letterWithTashkeelTracker = 0; foreach (TashkeelLocation location in TashkeelLocations) { letters.Insert(location.Position + letterWithTashkeelTracker, location.Tashkeel); //letterWithTashkeelTracker++; } /* * Fix of https://github.com/mnarimani/RTLTMPro/issues/13 * The workaround is to replace Shadda + Another Tashkeel with combined form */ letters.Replace(ShaddaFatha, ShaddaWithFathaIsolatedForm); letters.Replace(ShaddaDamma, ShaddaWithDammaIsolatedForm); letters.Replace(ShaddaKasra, ShaddaWithKasraIsolatedForm); letters.Replace(ShaddaDammatan, ShaddaWithDammatanIsolatedForm); letters.Replace(ShaddaKasratan, ShaddaWithKasratanIsolatedForm); letters.Replace(ShaddaSuperscriptAlef, ShaddaWithSuperscriptAlefIsolatedForm); TashkeelLocations.Clear(); }