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.

FontMetrics.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.fonts;
  18. import java.util.Map;
  19. /**
  20. * Main interface for access to font metrics.
  21. */
  22. public interface FontMetrics {
  23. /**
  24. * Returns the font name.
  25. * @return the font name
  26. */
  27. String getFontName();
  28. /**
  29. * Returns the type of the font.
  30. * @return the font type
  31. */
  32. FontType getFontType();
  33. /**
  34. * Returns the ascent of the font described by this
  35. * FontMetrics object.
  36. * @param size font size
  37. * @return ascent in milliponts
  38. */
  39. int getAscender(int size);
  40. /**
  41. * Returns the size of a capital letter measured from the font's baseline.
  42. * @param size font size
  43. * @return height of capital characters
  44. */
  45. int getCapHeight(int size);
  46. /**
  47. * Returns the descent of the font described by this
  48. * FontMetrics object.
  49. * @param size font size
  50. * @return descent in milliponts
  51. */
  52. int getDescender(int size);
  53. /**
  54. * Determines the typical font height of this
  55. * FontMetrics object
  56. * @param size font size
  57. * @return font height in millipoints
  58. */
  59. int getXHeight(int size);
  60. /**
  61. * Return the width (in 1/1000ths of point size) of the character at
  62. * code point i.
  63. * @param i code point index
  64. * @param size font size
  65. * @return the width of the character
  66. */
  67. int getWidth(int i, int size);
  68. /**
  69. * Return the array of widths.
  70. * <p>
  71. * This is used to get an array for inserting in an output format.
  72. * It should not be used for lookup.
  73. * @return an array of widths
  74. */
  75. int[] getWidths();
  76. /**
  77. * Indicates if the font has kering information.
  78. * @return True, if kerning is available.
  79. */
  80. boolean hasKerningInfo();
  81. /**
  82. * Returns the kerning map for the font.
  83. * @return the kerning map
  84. */
  85. Map getKerningInfo();
  86. }