ftsynth.h 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /****************************************************************************
  2. *
  3. * ftsynth.h
  4. *
  5. * FreeType synthesizing code for emboldening and slanting
  6. * (specification).
  7. *
  8. * Copyright (C) 2000-2023 by
  9. * David Turner, Robert Wilhelm, and Werner Lemberg.
  10. *
  11. * This file is part of the FreeType project, and may only be used,
  12. * modified, and distributed under the terms of the FreeType project
  13. * license, LICENSE.TXT. By continuing to use, modify, or distribute
  14. * this file you indicate that you have read the license and
  15. * understand and accept it fully.
  16. *
  17. */
  18. /*************************************************************************/
  19. /*************************************************************************/
  20. /*************************************************************************/
  21. /*************************************************************************/
  22. /*************************************************************************/
  23. /********* *********/
  24. /********* WARNING, THIS IS ALPHA CODE! THIS API *********/
  25. /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
  26. /********* FREETYPE DEVELOPMENT TEAM *********/
  27. /********* *********/
  28. /*************************************************************************/
  29. /*************************************************************************/
  30. /*************************************************************************/
  31. /*************************************************************************/
  32. /*************************************************************************/
  33. /* Main reason for not lifting the functions in this module to a */
  34. /* 'standard' API is that the used parameters for emboldening and */
  35. /* slanting are not configurable. Consider the functions as a */
  36. /* code resource that should be copied into the application and */
  37. /* adapted to the particular needs. */
  38. #ifndef FTSYNTH_H_
  39. #define FTSYNTH_H_
  40. #include <freetype/freetype.h>
  41. #ifdef FREETYPE_H
  42. #error "freetype.h of FreeType 1 has been loaded!"
  43. #error "Please fix the directory search order for header files"
  44. #error "so that freetype.h of FreeType 2 is found first."
  45. #endif
  46. FT_BEGIN_HEADER
  47. /* Embolden a glyph by a 'reasonable' value (which is highly a matter of */
  48. /* taste). This function is actually a convenience function, providing */
  49. /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
  50. /* */
  51. /* For emboldened outlines the height, width, and advance metrics are */
  52. /* increased by the strength of the emboldening -- this even affects */
  53. /* mono-width fonts! */
  54. /* */
  55. /* You can also call @FT_Outline_Get_CBox to get precise values. */
  56. FT_EXPORT( void )
  57. FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
  58. /* Slant an outline glyph to the right by about 12 degrees. */
  59. FT_EXPORT( void )
  60. FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
  61. /* Slant an outline glyph by a given sine of an angle. You can apply */
  62. /* slant along either x- or y-axis by choosing a corresponding non-zero */
  63. /* argument. If both slants are non-zero, some affine transformation */
  64. /* will result. */
  65. FT_EXPORT( void )
  66. FT_GlyphSlot_Slant( FT_GlyphSlot slot,
  67. FT_Fixed xslant,
  68. FT_Fixed yslant );
  69. /* */
  70. FT_END_HEADER
  71. #endif /* FTSYNTH_H_ */
  72. /* END */