The syntax for the Indices property is explained in the Remarks section of the Glyphs.Indices documentation on MSDN.
Each glyph specification has the following form.
[GlyphIndex][,[Advance][,[uOffset][,[vOffset][,[Flags]]]]]
[] around each field means this is optional. Therefore, all fields are optional, which means that the glyph index specification may be completely empty.
The value ";;;;;(2:1)191" in the example consists of six such specifications, separated by semicolons, where the first five of them are empty. If the glyph index specification is empty, WPF retrieves the actual glyph index from the GlyphTypeface.CharacterToGlyphMap property.
The documentation also says
The specification of the first glyph in the cluster is preceded by the specification of the number of glyphs and the number of code points combined with form a cluster.
This is what the prefix (2:1) means. It indicates that two characters from the source string are replaced with one character. And, of course, this glyph has an index of 191 .
The glyph index itself is only the index of this particular glyph in the selected font. In the example, this is the fi ligature character (one character) at index position 191 in the font Times.ttf .
In your Persian character example, it all depends on the font you are using. You must examine it to find a suitable glyph for these two characters. It may also be sufficient to simply replace the second character with another, in which case you can omit the specification (2:1) and simply write the corresponding glyph index.
UPDATE: a very simple tool for checking all the glyphs in a font file can be written as follows:
<ListBox ItemsSource="{Binding GlyphItems}"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="50"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Glyphs FontUri="{Binding FontUri}" Indices="{Binding Indices}" FontRenderingEmSize="36" OriginX="10" OriginY="36" Fill="Black"/> <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding Indices, StringFormat=Index {0}}"/> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
the code:
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); GlyphItems = new List<object>(); var font = @"C:\WINDOWS\Fonts\TIMES.TTF"; for (int i = 0; i < new GlyphTypeface(new Uri(font)).GlyphCount; i++) { GlyphItems.Add(new { FontUri = font, Indices = i.ToString() }); } DataContext = this; } public List<object> GlyphItems { get; set; } }