You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Substitutable.java 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.complexscripts.fonts;
  19. // CSOFF: LineLengthCheck
  20. /**
  21. * <p>Optional interface which indicates that glyph substitution is supported and, if supported,
  22. * can perform substitution.</p>
  23. *
  24. * <p>This work was originally authored by Glenn Adams (gadams@apache.org).</p>
  25. */
  26. public interface Substitutable {
  27. /**
  28. * Determines if font performs glyph substitution.
  29. * @return true if performs substitution.
  30. */
  31. boolean performsSubstitution();
  32. /**
  33. * Perform substitutions on characters to effect glyph substitution. If some substitution is performed, it
  34. * entails mapping from one or more input characters denoting textual character information to one or more
  35. * output character codes denoting glyphs in this font, where the output character codes may make use of
  36. * private character code values that have significance only for this font.
  37. * @param cs character sequence to map to output font encoding character sequence
  38. * @param script a script identifier
  39. * @param language a language identifier
  40. * @return output sequence (represented as a character sequence, where each character in the returned sequence
  41. * denotes "font characters", i.e., character codes that map directly (1-1) to their associated glyphs
  42. */
  43. CharSequence performSubstitution ( CharSequence cs, String script, String language );
  44. /**
  45. * Reorder combining marks in character sequence so that they precede (within the sequence) the base
  46. * character to which they are applied. N.B. In the case of LTR segments, marks are not reordered by this,
  47. * method since when the segment is reversed by BIDI processing, marks are automatically reordered to precede
  48. * their base character.
  49. * @param cs character sequence within which combining marks to be reordered
  50. * @param gpa associated glyph position adjustments (also reordered)
  51. * @param script a script identifier
  52. * @param language a language identifier
  53. * @return output sequence containing reordered "font characters"
  54. */
  55. CharSequence reorderCombiningMarks ( CharSequence cs, int[][] gpa, String script, String language );
  56. }