I have a List with all system font names. Here is a part of the List:
Arial
Calibri
Times New Roman
My problem is: I have 16 ASCII characters (2 bytes) of the fontname with the fontface (Bold, Italic, Regular)
Calibri Bold
Arial Bold Itali
Times New Roman
How can I get the fontname (ex. Arial) from the list if I have a string (ex. Arial Bold Itali)
Hope someone can help me or give me advice.
Answer:
I did it vice-versa. Bet this can me done more efficient but it works for now.
foreach (string fn in FontHelper.FontNames)
{
if (Font.FontName.Contains(fn))
{
fontname = fn;
break;
}
}
I think you can also use start with.