ftsizes.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /***************************************************************************/
  2. /* */
  3. /* ftsizes.h */
  4. /* */
  5. /* FreeType size objects management (specification). */
  6. /* */
  7. /* Copyright 1996-2001 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. /*************************************************************************/
  18. /* */
  19. /* Typical application would normally not need to use these functions. */
  20. /* However, they have been placed in a public API for the rare cases */
  21. /* where they are needed. */
  22. /* */
  23. /*************************************************************************/
  24. #ifndef __FTSIZES_H__
  25. #define __FTSIZES_H__
  26. #include <ft2build.h>
  27. #include FT_FREETYPE_H
  28. FT_BEGIN_HEADER
  29. /*************************************************************************/
  30. /* */
  31. /* <Section> */
  32. /* sizes_management */
  33. /* */
  34. /* <Title> */
  35. /* Size management */
  36. /* */
  37. /* <Abstract> */
  38. /* Managing multiple sizes per face */
  39. /* */
  40. /* <Description> */
  41. /* When creating a new face object (e.g. with @FT_New_Face), an */
  42. /* @FT_Size object is automatically created and used to store all */
  43. /* pixel-size dependent information, available in the "face->size" */
  44. /* field. */
  45. /* */
  46. /* It is however possible to create more sizes for a given face, */
  47. /* mostly in order to manage several character pixel sizes of the */
  48. /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
  49. /* */
  50. /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
  51. /* modify the contents of the current "active" size; you thus need */
  52. /* to use @FT_Activate_Size to change it. */
  53. /* */
  54. /* 99% of applications won't need the functions provided here, */
  55. /* especially if they use the caching sub-system, so be cautious */
  56. /* when using these. */
  57. /* */
  58. /*************************************************************************/
  59. /*************************************************************************/
  60. /* */
  61. /* <Function> */
  62. /* FT_New_Size */
  63. /* */
  64. /* <Description> */
  65. /* Creates a new size object from a given face object. */
  66. /* */
  67. /* <Input> */
  68. /* face :: A handle to a parent face object. */
  69. /* */
  70. /* <Output> */
  71. /* asize :: A handle to a new size object. */
  72. /* */
  73. /* <Return> */
  74. /* FreeType error code. 0 means success. */
  75. /* */
  76. /* <Note> */
  77. /* You need to call @FT_Activate_Size in order to select the new size */
  78. /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
  79. /* @FT_Load_Glyph, @FT_Load_Char, etc. */
  80. /* */
  81. FT_EXPORT( FT_Error )
  82. FT_New_Size( FT_Face face,
  83. FT_Size* size );
  84. /*************************************************************************/
  85. /* */
  86. /* <Function> */
  87. /* FT_Done_Size */
  88. /* */
  89. /* <Description> */
  90. /* Discards a given size object. */
  91. /* */
  92. /* <Input> */
  93. /* size :: A handle to a target size object. */
  94. /* */
  95. /* <Return> */
  96. /* FreeType error code. 0 means success. */
  97. /* */
  98. FT_EXPORT( FT_Error )
  99. FT_Done_Size( FT_Size size );
  100. /*************************************************************************/
  101. /* */
  102. /* <Function> */
  103. /* FT_Activate_Size */
  104. /* */
  105. /* <Description> */
  106. /* Even though it is possible to create several size objects for a */
  107. /* given face (see @FT_New_Size for details), functions like */
  108. /* @FT_Load_Glyph or @FT_Load_Char only use the last-created one to */
  109. /* determine the "current character pixel size". */
  110. /* */
  111. /* This function can be used to "activate" a previously created size */
  112. /* object. */
  113. /* */
  114. /* <Input> */
  115. /* size :: A handle to a target size object. */
  116. /* */
  117. /* <Return> */
  118. /* FreeType error code. 0 means success. */
  119. /* */
  120. /* <Note> */
  121. /* If "face" is the size's parent face object, this function changes */
  122. /* the value of "face->size" to the input size handle. */
  123. /* */
  124. FT_EXPORT( FT_Error )
  125. FT_Activate_Size( FT_Size size );
  126. /* */
  127. FT_END_HEADER
  128. #endif /* __FTSIZES_H__ */
  129. /* END */