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.

FontEventProducer.java 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.fonts;
  19. import org.apache.fop.events.EventBroadcaster;
  20. import org.apache.fop.events.EventProducer;
  21. /**
  22. * Event producer for fonts-related events.
  23. */
  24. public interface FontEventProducer extends EventProducer {
  25. /**
  26. * Provider class for the event producer.
  27. */
  28. final class Provider {
  29. private Provider() { }
  30. /**
  31. * Returns an event producer.
  32. * @param broadcaster the event broadcaster to use
  33. * @return the event producer
  34. */
  35. public static FontEventProducer get(EventBroadcaster broadcaster) {
  36. return (FontEventProducer) broadcaster.getEventProducerFor(FontEventProducer.class);
  37. }
  38. }
  39. /**
  40. * Notifies about a font being substituted as the requested one isn't available.
  41. * @param source the event source
  42. * @param requested the requested font triplet
  43. * @param effective the effective font triplet
  44. * @event.severity WARN
  45. */
  46. void fontSubstituted(Object source, FontTriplet requested, FontTriplet effective);
  47. /**
  48. * An error occurred while loading a font for auto-detection.
  49. * @param source the event source
  50. * @param fontURL the font URL
  51. * @param e the original exception
  52. * @event.severity WARN
  53. */
  54. void fontLoadingErrorAtAutoDetection(Object source, String fontURL, Exception e);
  55. /**
  56. * A glyph has been requested that is not available in the font.
  57. * @param source the event source
  58. * @param ch the character for which the glyph isn't available
  59. * @param fontName the name of the font
  60. * @event.severity WARN
  61. */
  62. void glyphNotAvailable(Object source, char ch, String fontName);
  63. /**
  64. * An error occurred trying to find the font directory specified in the config file.
  65. * @param source the event sourece
  66. * @param dir the directory in the config file
  67. * @event.severity WARN
  68. */
  69. void fontDirectoryNotFound(Object source, String dir);
  70. }