pshalgo1.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /***************************************************************************/
  2. /* */
  3. /* pshalgo1.h */
  4. /* */
  5. /* PostScript hinting algorithm 1 (specification). */
  6. /* */
  7. /* Copyright 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. #ifndef __PSHALGO1_H__
  18. #define __PSHALGO1_H__
  19. #include "pshrec.h"
  20. FT_BEGIN_HEADER
  21. typedef struct PSH1_HintRec_* PSH1_Hint;
  22. typedef enum
  23. {
  24. PSH1_HINT_FLAG_GHOST = PS_HINT_FLAG_GHOST,
  25. PSH1_HINT_FLAG_BOTTOM = PS_HINT_FLAG_BOTTOM,
  26. PSH1_HINT_FLAG_ACTIVE = 4
  27. } PSH1_Hint_Flags;
  28. #define psh1_hint_is_active( x ) \
  29. ( ( (x)->flags & PSH1_HINT_FLAG_ACTIVE ) != 0 )
  30. #define psh1_hint_is_ghost( x ) \
  31. ( ( (x)->flags & PSH1_HINT_FLAG_GHOST ) != 0 )
  32. #define psh1_hint_activate( x ) (x)->flags |= PSH1_HINT_FLAG_ACTIVE
  33. #define psh1_hint_deactivate( x ) (x)->flags &= ~PSH1_HINT_FLAG_ACTIVE
  34. typedef struct PSH1_HintRec_
  35. {
  36. FT_Int org_pos;
  37. FT_Int org_len;
  38. FT_Pos cur_pos;
  39. FT_Pos cur_len;
  40. FT_UInt flags;
  41. PSH1_Hint parent;
  42. FT_Int order;
  43. } PSH1_HintRec;
  44. /* this is an interpolation zone used for strong points; */
  45. /* weak points are interpolated according to their strong */
  46. /* neighbours */
  47. typedef struct PSH1_ZoneRec_
  48. {
  49. FT_Fixed scale;
  50. FT_Fixed delta;
  51. FT_Pos min;
  52. FT_Pos max;
  53. } PSH1_ZoneRec, *PSH1_Zone;
  54. typedef struct PSH1_Hint_TableRec_
  55. {
  56. FT_UInt max_hints;
  57. FT_UInt num_hints;
  58. PSH1_Hint hints;
  59. PSH1_Hint* sort;
  60. PSH1_Hint* sort_global;
  61. FT_UInt num_zones;
  62. PSH1_Zone zones;
  63. PSH1_Zone zone;
  64. PS_Mask_Table hint_masks;
  65. PS_Mask_Table counter_masks;
  66. } PSH1_Hint_TableRec, *PSH1_Hint_Table;
  67. extern FT_Error
  68. ps1_hints_apply( PS_Hints ps_hints,
  69. FT_Outline* outline,
  70. PSH_Globals globals,
  71. FT_Render_Mode hint_mode );
  72. #ifdef DEBUG_HINTER
  73. extern PSH1_Hint_Table ps1_debug_hint_table;
  74. typedef void
  75. (*PSH1_HintFunc)( PSH1_Hint hint,
  76. FT_Bool vertical );
  77. extern PSH1_HintFunc ps1_debug_hint_func;
  78. #endif
  79. FT_END_HEADER
  80. #endif /* __PSHALGO1_H__ */
  81. /* END */