/src/freetype/src/base/fttype1.c

https://bitbucket.org/cabalistic/ogredeps/ · C · 120 lines · 63 code · 36 blank · 21 comment · 12 complexity · 71ae31ed09536ded776a0c1622d1c72f MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* fttype1.c */
  4. /* */
  5. /* FreeType utility file for PS names support (body). */
  6. /* */
  7. /* Copyright 2002-2004, 2011 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. #include <ft2build.h>
  18. #include FT_INTERNAL_OBJECTS_H
  19. #include FT_INTERNAL_SERVICE_H
  20. #include FT_SERVICE_POSTSCRIPT_INFO_H
  21. /* documentation is in t1tables.h */
  22. FT_EXPORT_DEF( FT_Error )
  23. FT_Get_PS_Font_Info( FT_Face face,
  24. PS_FontInfoRec* afont_info )
  25. {
  26. FT_Error error = FT_Err_Invalid_Argument;
  27. if ( face )
  28. {
  29. FT_Service_PsInfo service = NULL;
  30. FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
  31. if ( service && service->ps_get_font_info )
  32. error = service->ps_get_font_info( face, afont_info );
  33. }
  34. return error;
  35. }
  36. /* documentation is in t1tables.h */
  37. FT_EXPORT_DEF( FT_Int )
  38. FT_Has_PS_Glyph_Names( FT_Face face )
  39. {
  40. FT_Int result = 0;
  41. FT_Service_PsInfo service = NULL;
  42. if ( face )
  43. {
  44. FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
  45. if ( service && service->ps_has_glyph_names )
  46. result = service->ps_has_glyph_names( face );
  47. }
  48. return result;
  49. }
  50. /* documentation is in t1tables.h */
  51. FT_EXPORT_DEF( FT_Error )
  52. FT_Get_PS_Font_Private( FT_Face face,
  53. PS_PrivateRec* afont_private )
  54. {
  55. FT_Error error = FT_Err_Invalid_Argument;
  56. if ( face )
  57. {
  58. FT_Service_PsInfo service = NULL;
  59. FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
  60. if ( service && service->ps_get_font_private )
  61. error = service->ps_get_font_private( face, afont_private );
  62. }
  63. return error;
  64. }
  65. /* documentation is in t1tables.h */
  66. FT_EXPORT_DEF( FT_Long )
  67. FT_Get_PS_Font_Value( FT_Face face,
  68. PS_Dict_Keys key,
  69. FT_UInt idx,
  70. void *value,
  71. FT_Long value_len )
  72. {
  73. FT_Int result = 0;
  74. FT_Service_PsInfo service = NULL;
  75. if ( face )
  76. {
  77. FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );
  78. if ( service && service->ps_get_font_value )
  79. result = service->ps_get_font_value( face, key, idx,
  80. value, value_len );
  81. }
  82. return result;
  83. }
  84. /* END */