Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "t1instal.h"
  4. #define DEFAULT_STR (void*)"Converting with pfb: "
  5. #define PFM_STR (void*)"Converting with pfb+pfm: "
  6. #define FULL_STR (void*)"Converting with pfb+pfm+ttf: "
  7. #ifdef _MSC_VER
  8. # define CDECL __cdecl
  9. #else
  10. # define CDECL
  11. #endif
  12. #ifdef PROGRESS
  13. const void STDCALL PrintProgress(short percent, void *arg)
  14. {
  15. char *str = arg;
  16. printf("\r%s%d%% ", str, percent);
  17. }
  18. #else
  19. #define PrintProgress 0L
  20. #endif
  21. void CDECL main(int argc, char **argv)
  22. {
  23. short res;
  24. char buf[128];
  25. if (argc==2)
  26. res = ConvertTypeface(argv[1], 0L, 0L,
  27. PrintProgress, DEFAULT_STR);
  28. else if (argc==3) {
  29. if (IsType1(argv[2], sizeof(buf), buf)) {
  30. printf("Converting typeface: %s\n", buf);
  31. res = ConvertTypeface(argv[1], argv[2], 0L,
  32. PrintProgress, PFM_STR);
  33. } else {
  34. printf("Not a valid Adobe Type 1 typeface.\n");
  35. }
  36. } else if (argc==4) {
  37. if (IsType1(argv[2], sizeof(buf), buf)) {
  38. printf("Converting typeface: %s\n", buf);
  39. res = ConvertTypeface(argv[1], argv[2], argv[3],
  40. PrintProgress, PFM_STR);
  41. } else {
  42. printf("Not a valid Adobe Type 1 typeface.\n");
  43. }
  44. }
  45. if (res!=SUCCESS)
  46. puts("\nConversion failed!");
  47. exit((int)res);
  48. }