get_font.c 495 B

1234567891011121314151617181920212223242526272829303132
  1. /* Function: get_font
  2. **
  3. ** Author: Paul W. Carlson April 1992
  4. */
  5. #include <grass/gis.h>
  6. int get_font(char *data)
  7. {
  8. char *dp;
  9. G_strip(data);
  10. /* replace spaces with dashes and make sure each
  11. ** word begins with a capital letter.
  12. */
  13. dp = data;
  14. if (*dp >= 'a' && *dp <= 'z')
  15. *dp = *dp - 'a' + 'A';
  16. while (*dp) {
  17. if (*dp == ' ') {
  18. *dp++ = '-';
  19. if (*dp >= 'a' && *dp <= 'z')
  20. *dp = *dp - 'a' + 'A';
  21. }
  22. else
  23. dp++;
  24. }
  25. return 0;
  26. }