Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

FontEventProducer.java 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 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 source
  66. * @param dir the directory in the config file
  67. * @event.severity WARN
  68. */
  69. void fontDirectoryNotFound(Object source, String dir);
  70. /**
  71. * The SVG text will be stroked as shapes.
  72. * @param source the event source
  73. * @param fontFamily the family name of the font that is being stroked
  74. * @event.severity WARN
  75. */
  76. void svgTextStrokedAsShapes(Object source, String fontFamily);
  77. /**
  78. * A method to warn the user that the feature they are trying to use is not supported with either the renderer or
  79. * other setting.
  80. * @param source
  81. * @param feature The feature that has caused the not supported issue
  82. * @param onlySupportedIn The renderer / setting that this feature works with.
  83. * @event.severity ERROR
  84. */
  85. void fontFeatureNotSuppprted(Object source, String feature, String onlySupportedIn);
  86. }