/src/freetype/src/psaux/afmparse.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 88 lines · 45 code · 25 blank · 18 comment · 0 complexity · 0166e858c7396b1f567db14eb72124ce MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* afmparse.h */
  4. /* */
  5. /* AFM parser (specification). */
  6. /* */
  7. /* Copyright 2006 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 __AFMPARSE_H__
  18. #define __AFMPARSE_H__
  19. #include <ft2build.h>
  20. #include FT_INTERNAL_POSTSCRIPT_AUX_H
  21. FT_BEGIN_HEADER
  22. FT_LOCAL( FT_Error )
  23. afm_parser_init( AFM_Parser parser,
  24. FT_Memory memory,
  25. FT_Byte* base,
  26. FT_Byte* limit );
  27. FT_LOCAL( void )
  28. afm_parser_done( AFM_Parser parser );
  29. FT_LOCAL( FT_Error )
  30. afm_parser_parse( AFM_Parser parser );
  31. enum AFM_ValueType_
  32. {
  33. AFM_VALUE_TYPE_STRING,
  34. AFM_VALUE_TYPE_NAME,
  35. AFM_VALUE_TYPE_FIXED, /* real number */
  36. AFM_VALUE_TYPE_INTEGER,
  37. AFM_VALUE_TYPE_BOOL,
  38. AFM_VALUE_TYPE_INDEX /* glyph index */
  39. };
  40. typedef struct AFM_ValueRec_
  41. {
  42. enum AFM_ValueType_ type;
  43. union
  44. {
  45. char* s;
  46. FT_Fixed f;
  47. FT_Int i;
  48. FT_Bool b;
  49. } u;
  50. } AFM_ValueRec, *AFM_Value;
  51. #define AFM_MAX_ARGUMENTS 5
  52. FT_LOCAL( FT_Int )
  53. afm_parser_read_vals( AFM_Parser parser,
  54. AFM_Value vals,
  55. FT_UInt n );
  56. /* read the next key from the next line or column */
  57. FT_LOCAL( char* )
  58. afm_parser_next_key( AFM_Parser parser,
  59. FT_Bool line,
  60. FT_Offset* len );
  61. FT_END_HEADER
  62. #endif /* __AFMPARSE_H__ */
  63. /* END */