Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.pdf;
  19. import org.apache.fop.fonts.FontType;
  20. /**
  21. * Class representing a Type3 font.
  22. * <p>
  23. * <b>CAUTION: this is not yet fully implemented!!!!!!!</b>
  24. * the /CharProcs is still missing its <code>toPDF()</code> method.
  25. * <p>
  26. * Type3 fonts are specified on page 206 and onwards of the PDF 1.3 spec.
  27. */
  28. public class PDFFontType3 extends PDFFontNonBase14 {
  29. /**
  30. * Create the /Font object
  31. *
  32. * @param fontname the internal name for the font
  33. * @param basefont the base font name
  34. * @param encoding the character encoding schema used by the font
  35. */
  36. public PDFFontType3(String fontname,
  37. String basefont,
  38. Object encoding) {
  39. super(fontname, FontType.TYPE3, basefont, encoding);
  40. }
  41. /**
  42. * Create the /Font object
  43. *
  44. * @param fontname the internal name for the font
  45. * @param basefont the base font name
  46. * @param encoding the character encoding schema used by the font
  47. * @param fontBBox the font's bounding box
  48. * @param fontMatrix the font's transformation matrix
  49. * @param charProcs the glyphs' definitions
  50. */
  51. public PDFFontType3(String fontname,
  52. String basefont,
  53. Object encoding,
  54. PDFRectangle fontBBox, PDFArray fontMatrix,
  55. PDFCharProcs charProcs) {
  56. /* generic creation of PDF object */
  57. super(fontname, FontType.TYPE3, basefont, encoding /* , mapping */);
  58. setFontBBox(fontBBox);
  59. setFontMatrix(fontMatrix);
  60. setCharProcs(charProcs);
  61. }
  62. /**
  63. * Set the font's bounding box
  64. *
  65. * @param bbox bounding box for the font
  66. */
  67. public void setFontBBox(PDFRectangle bbox) {
  68. put("FontBBox", bbox);
  69. }
  70. /**
  71. * Set the font's transformation matrix
  72. *
  73. * @param matrix the transformation matrix for the font
  74. */
  75. public void setFontMatrix(PDFArray matrix) {
  76. put("FontMatrix", matrix);
  77. }
  78. /**
  79. * Set the glyphs' definitions.
  80. * <p>
  81. * The /CharProcs object needs to be registered in the document's resources.
  82. *
  83. * @param chars the glyphs' dictionary
  84. */
  85. public void setCharProcs(PDFCharProcs chars) {
  86. put("CharProcs", chars);
  87. }
  88. }