سلام، من هرچی ور رفتم و سرچ کردم چیز درست و در مونی پیدا نکردم، من تو RichTextBox متنو انتخاب میکنم و حرف حرف میخونمش ولی هیچ اعرابی پیدا نمیکنم، کسی کدی چیزی، یا روشی پیشنهادی هرچیزی که کمک کنه ارائه بده ممنون میشم.
unnamed.png
for (int i = 0; i < textLength; i++){
var textRange = rtbQuranTranslate.Selection;
TextPointer start = quranRuns[0].ContentStart.GetPositionAtOffset(i);
TextPointer end = quranRuns[0].ContentStart.GetPositionAtOffset(i+1);
rtbQuranTranslate.Selection.Select(start, end);
if (rtbQuranTranslate.Selection.Text.Length == 0) continue;
if (rtbQuranTranslate.Selection.Text.Contains('ُ'))
{
textRange.ApplyPropertyValue(TextElement.Foregroun dProperty, new SolidColorBrush(Colors.Blue));
}
}
---------
فک کنم فهمیدم، من کاراکترها رو به صورت utf8 میخونم که هر کاراکتر 8 بیت هستش در حالی که کدهای فتحه و کسره و .... که مثلا مقدارشون 1500-1600 هستش یه عدد 2 بایتی هستش و باید از unicode استفاده کنم.؛ به نتیجه رسیدم اینجا پیوست میکنم 
---------
مشکلی که الان دارم اینه که کاراکترها رو میخونم، درست هم میخونم، الف ب پ و... فتحه کسره تشدید و... ولی نمیتونم رنگشون رو تغییر بدم، کدم درست کار نمیکنه
private void ColorRtbText(){
string text = quranRuns[0].ContentStart.GetTextInRun(LogicalDirection.Forwar d);
int textLength = text.Length;
byte[] bytes = Encoding.Unicode.GetBytes(text);
for (int i = 0; i < textLength; i++)
{
TextPointer start = quranRuns[0].ContentStart.GetPositionAtOffset(i + 0, LogicalDirection.Forward);
TextPointer end = quranRuns[0].ContentStart.GetPositionAtOffset(i + 1, LogicalDirection.Backward);
var textRange = new TextRange(start, end);
byte[] characterByte = new byte[] { bytes[2 * i], bytes[2 * i + 1] };
int I = BitConverter.ToInt16(characterByte, 0); // int I = (bytes[2 * i + 1] << 8 | bytes[2 * i + 0]);
string S = Encoding.Unicode.GetString(characterByte);
//---
MessageBox.Show(">" + S + ">" + ">" + I + ">");
textRange.ApplyPropertyValue(TextElement.Foregroun dProperty, Brushes.Red);
}
}