ICharacterMatcher.cs 1.4 KB

1234567891011121314151617181920212223242526272829
  1. using SkiaSharp;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace Topten.RichTextKit
  6. {
  7. /// <summary>
  8. /// Provides a mechanism to override the default font fallback character matching
  9. /// </summary>
  10. /// <remarks>
  11. /// To override font fallback selection, assign an implementation of this interface
  12. /// to the <see cref="FontFallback.CharacterMatcher"/> property.
  13. /// </remarks>
  14. public interface ICharacterMatcher
  15. {
  16. /// <summary>
  17. /// Provide a fallback typeface for a specified code point index
  18. /// </summary>
  19. /// <param name="familyName">The family name to use when searching.</param>
  20. /// <param name="weight">The font weight to use when searching.</param>
  21. /// <param name="width">The font width to use when searching.</param>
  22. /// <param name="slant">The font slant to use when searching.</param>
  23. /// <param name="bcp47">The ISO 639, 15924, and 3166-1 code to use when searching, such as "ja" and "zh".</param>
  24. /// <param name="character">The character to find a typeface for.</param>
  25. /// <returns>Returns the SkiaSharp.SKTypeface that contains the given character, or null if none was found.</returns>
  26. SKTypeface MatchCharacter(string familyName, int weight, int width, SKFontStyleSlant slant, string[] bcp47, int character);
  27. }
  28. }