ftbdf.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /***************************************************************************/
  2. /* */
  3. /* ftbdf.c */
  4. /* */
  5. /* FreeType API for accessing BDF-specific strings (body). */
  6. /* */
  7. /* Copyright 2002 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_BDF_TYPES_H
  19. #include FT_INTERNAL_OBJECTS_H
  20. FT_EXPORT_DEF( FT_Error )
  21. FT_Get_BDF_Charset_ID( FT_Face face,
  22. const char* *acharset_encoding,
  23. const char* *acharset_registry )
  24. {
  25. FT_Error error;
  26. const char* encoding = NULL;
  27. const char* registry = NULL;
  28. error = FT_Err_Invalid_Argument;
  29. if ( face != NULL && face->driver != NULL )
  30. {
  31. FT_Module driver = (FT_Module) face->driver;
  32. if ( driver->clazz && driver->clazz->module_name &&
  33. ft_strcmp( driver->clazz->module_name, "bdf" ) == 0 )
  34. {
  35. BDF_Public_Face bdf_face = (BDF_Public_Face)face;
  36. encoding = (const char*) bdf_face->charset_encoding;
  37. registry = (const char*) bdf_face->charset_registry;
  38. error = 0;
  39. }
  40. }
  41. if ( acharset_encoding )
  42. *acharset_encoding = encoding;
  43. if ( acharset_registry )
  44. *acharset_registry = registry;
  45. return error;
  46. }
  47. /* END */