/src/compiler/android-ndk/jni/freetype/src/pshinter/pshglob.h

http://ftk.googlecode.com/ · C++ Header · 196 lines · 90 code · 53 blank · 53 comment · 0 complexity · 9e7e2833ed2afa8f7f236404a53d9d36 MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* pshglob.h */
  4. /* */
  5. /* PostScript hinter global hinting management. */
  6. /* */
  7. /* Copyright 2001, 2002, 2003 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 __PSHGLOB_H__
  18. #define __PSHGLOB_H__
  19. #include FT_FREETYPE_H
  20. #include FT_INTERNAL_POSTSCRIPT_HINTS_H
  21. FT_BEGIN_HEADER
  22. /*************************************************************************/
  23. /*************************************************************************/
  24. /***** *****/
  25. /***** GLOBAL HINTS INTERNALS *****/
  26. /***** *****/
  27. /*************************************************************************/
  28. /*************************************************************************/
  29. /*************************************************************************/
  30. /* */
  31. /* @constant: */
  32. /* PS_GLOBALS_MAX_BLUE_ZONES */
  33. /* */
  34. /* @description: */
  35. /* The maximum number of blue zones in a font global hints structure. */
  36. /* See @PS_Globals_BluesRec. */
  37. /* */
  38. #define PS_GLOBALS_MAX_BLUE_ZONES 16
  39. /*************************************************************************/
  40. /* */
  41. /* @constant: */
  42. /* PS_GLOBALS_MAX_STD_WIDTHS */
  43. /* */
  44. /* @description: */
  45. /* The maximum number of standard and snap widths in either the */
  46. /* horizontal or vertical direction. See @PS_Globals_WidthsRec. */
  47. /* */
  48. #define PS_GLOBALS_MAX_STD_WIDTHS 16
  49. /* standard and snap width */
  50. typedef struct PSH_WidthRec_
  51. {
  52. FT_Int org;
  53. FT_Pos cur;
  54. FT_Pos fit;
  55. } PSH_WidthRec, *PSH_Width;
  56. /* standard and snap widths table */
  57. typedef struct PSH_WidthsRec_
  58. {
  59. FT_UInt count;
  60. PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS];
  61. } PSH_WidthsRec, *PSH_Widths;
  62. typedef struct PSH_DimensionRec_
  63. {
  64. PSH_WidthsRec stdw;
  65. FT_Fixed scale_mult;
  66. FT_Fixed scale_delta;
  67. } PSH_DimensionRec, *PSH_Dimension;
  68. /* blue zone descriptor */
  69. typedef struct PSH_Blue_ZoneRec_
  70. {
  71. FT_Int org_ref;
  72. FT_Int org_delta;
  73. FT_Int org_top;
  74. FT_Int org_bottom;
  75. FT_Pos cur_ref;
  76. FT_Pos cur_delta;
  77. FT_Pos cur_bottom;
  78. FT_Pos cur_top;
  79. } PSH_Blue_ZoneRec, *PSH_Blue_Zone;
  80. typedef struct PSH_Blue_TableRec_
  81. {
  82. FT_UInt count;
  83. PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES];
  84. } PSH_Blue_TableRec, *PSH_Blue_Table;
  85. /* blue zones table */
  86. typedef struct PSH_BluesRec_
  87. {
  88. PSH_Blue_TableRec normal_top;
  89. PSH_Blue_TableRec normal_bottom;
  90. PSH_Blue_TableRec family_top;
  91. PSH_Blue_TableRec family_bottom;
  92. FT_Fixed blue_scale;
  93. FT_Int blue_shift;
  94. FT_Int blue_threshold;
  95. FT_Int blue_fuzz;
  96. FT_Bool no_overshoots;
  97. } PSH_BluesRec, *PSH_Blues;
  98. /* font globals. */
  99. /* dimension 0 => X coordinates + vertical hints/stems */
  100. /* dimension 1 => Y coordinates + horizontal hints/stems */
  101. typedef struct PSH_GlobalsRec_
  102. {
  103. FT_Memory memory;
  104. PSH_DimensionRec dimension[2];
  105. PSH_BluesRec blues;
  106. } PSH_GlobalsRec;
  107. #define PSH_BLUE_ALIGN_NONE 0
  108. #define PSH_BLUE_ALIGN_TOP 1
  109. #define PSH_BLUE_ALIGN_BOT 2
  110. typedef struct PSH_AlignmentRec_
  111. {
  112. int align;
  113. FT_Pos align_top;
  114. FT_Pos align_bot;
  115. } PSH_AlignmentRec, *PSH_Alignment;
  116. FT_LOCAL( void )
  117. psh_globals_funcs_init( PSH_Globals_FuncsRec* funcs );
  118. #if 0
  119. /* snap a stem width to fitter coordinates. `org_width' is in font */
  120. /* units. The result is in device pixels (26.6 format). */
  121. FT_LOCAL( FT_Pos )
  122. psh_dimension_snap_width( PSH_Dimension dimension,
  123. FT_Int org_width );
  124. #endif
  125. FT_LOCAL( FT_Error )
  126. psh_globals_set_scale( PSH_Globals globals,
  127. FT_Fixed x_scale,
  128. FT_Fixed y_scale,
  129. FT_Fixed x_delta,
  130. FT_Fixed y_delta );
  131. /* snap a stem to one or two blue zones */
  132. FT_LOCAL( void )
  133. psh_blues_snap_stem( PSH_Blues blues,
  134. FT_Int stem_top,
  135. FT_Int stem_bot,
  136. PSH_Alignment alignment );
  137. /* */
  138. #ifdef DEBUG_HINTER
  139. extern PSH_Globals ps_debug_globals;
  140. #endif
  141. FT_END_HEADER
  142. #endif /* __PSHGLOB_H__ */
  143. /* END */