1. /*
  2. * @(#)Ligaturizer.java 1.3 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * @(#)Ligaturizer.java 1.2 98/07/31
  9. *
  10. * (C) Copyright IBM Corp. 1998 - All Rights Reserved
  11. */
  12. package javax.swing.text;
  13. /*
  14. * An object that ligaturizes a character array.
  15. */
  16. abstract class Ligaturizer {
  17. /**
  18. * Convert text between start and limit to incorporate ligatures.
  19. * Text is in visual order. Shaping, if required, has already been
  20. * performed on the text. The leftmost character of a matching
  21. * string is replaced by the ligature character, other characters
  22. * of the string are replaced by U+ffff. Transparent characters
  23. * not defined as part of the ligature remain unchanged, and are
  24. * ignored by the matching process.
  25. */
  26. abstract void ligaturize(char[] text, int start, int length);
  27. /*
  28. * Return a ligaturizer that only generates those ligatures from the
  29. * original ligaturizer that the filter accepts. Note that it is
  30. * not possible to 'unrestrict' a ligaturizer.
  31. */
  32. abstract Ligaturizer restrict(Ligaturizer.Filter f);
  33. /*
  34. * A functor used to restrict a Ligaturizer to only those ligatures
  35. * for which 'accepts' returns true.
  36. */
  37. static abstract class Filter {
  38. abstract boolean accepts(char c);
  39. }
  40. }