12345678910111213141516171819202122232425262728293031 |
- // See https://aka.ms/new-console-template for more information
- Console.WriteLine("Subtitle Font Collection");
- Console.Write("Path:");
- var p = Console.ReadLine();
- var files = Directory.GetFiles(p);
- var fontSet = new HashSet<string>();
- foreach (var file in files)
- {
- Console.Write(file);
- switch (Path.GetExtension(file).ToLower())
- {
- default:
- Console.WriteLine(" NO SUPPORT");
- break;
- case ".ass":
- var fonts = File.ReadAllLines(file)
- .Where(p => p.StartsWith("Style: ")).Select(p => p.Split(',')[1]).Distinct().ToArray();
- Console.WriteLine($" -> {fonts.Length}");
- foreach (var font in fonts)
- {
- fontSet.Add(font);
- }
- break;
- }
- }
- Console.WriteLine("=========================");
- foreach (var f in fontSet) Console.WriteLine(f);
- Console.WriteLine("=========================");
|