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.

PDFFontType0.java 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 Type0 font.
  22. * <p>
  23. * Type0 fonts are specified on page 208 and onwards of the PDF 1.3 spec.
  24. */
  25. public class PDFFontType0 extends PDFFont {
  26. /**
  27. * Create the /Font object
  28. *
  29. * @param fontname the internal name for the font
  30. * @param basefont the base font name
  31. * @param encoding the character encoding schema used by the font
  32. */
  33. public PDFFontType0(String fontname,
  34. String basefont,
  35. Object encoding) {
  36. super(fontname, FontType.TYPE0, basefont, encoding);
  37. }
  38. /**
  39. * Create the /Font object
  40. *
  41. * @param fontname the internal name for the font
  42. * @param basefont the base font name
  43. * @param encoding the character encoding schema used by the font
  44. * @param descendantFonts the CIDFont upon which this font is based
  45. */
  46. public PDFFontType0(String fontname,
  47. String basefont,
  48. Object encoding,
  49. PDFCIDFont descendantFonts) {
  50. super(fontname, FontType.TYPE0, basefont, encoding);
  51. setDescendantFonts(descendantFonts);
  52. }
  53. /**
  54. * Set the descendant font
  55. * @param descendantFonts the CIDFont upon which this font is based
  56. */
  57. public void setDescendantFonts(PDFCIDFont descendantFonts) {
  58. put("DescendantFonts", new PDFArray(this, new PDFObject[] {descendantFonts}));
  59. }
  60. /**
  61. * Sets the character map
  62. * @param cmap the character map
  63. */
  64. public void setCMAP(PDFCMap cmap) {
  65. put("ToUnicode", cmap);
  66. }
  67. }