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.

PDFCIDFontDescriptor.java 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // based on work by Takayuki Takeuchi
  20. /**
  21. * Class representing a font descriptor for CID fonts.
  22. *
  23. * Font descriptors for CID fonts are specified on page 227 and onwards of the PDF 1.3 spec.
  24. */
  25. public class PDFCIDFontDescriptor extends PDFFontDescriptor {
  26. /**
  27. * Create a /FontDescriptor object.
  28. *
  29. * @param basefont the base font name
  30. * @param fontBBox the bounding box for the described font
  31. * @param flags various characteristics of the font
  32. * @param capHeight height of the capital letters
  33. * @param stemV the width of the dominant vertical stems of glyphs
  34. * @param italicAngle the angle of the vertical dominant strokes
  35. * @param lang the language
  36. */
  37. public PDFCIDFontDescriptor(String basefont, int[] fontBBox,
  38. int capHeight, int flags, int italicAngle,
  39. int stemV, String lang) {
  40. super(basefont, fontBBox[3], fontBBox[1], capHeight, flags,
  41. new PDFRectangle(fontBBox), italicAngle, stemV);
  42. put("MissingWidth", Integer.valueOf(500));
  43. if (lang != null) {
  44. put("Lang", lang);
  45. }
  46. }
  47. /**
  48. * Set the CID set stream.
  49. * @param cidSet the PDF stream containing the CID set
  50. */
  51. public void setCIDSet(PDFStream cidSet) {
  52. if (cidSet != null) {
  53. put("CIDSet", cidSet);
  54. }
  55. }
  56. }