fontname.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. # $XConsortium: fontname.sh /main/2 1995/07/19 18:05:36 drk $
  3. #
  4. # This script is used to generate the FONT property given correct information
  5. # in the various other fields.
  6. #
  7. awk 'BEGIN {
  8. fontname_registry = "";
  9. foundry = "";
  10. family_name = "";
  11. weight_name = "";
  12. slant = "";
  13. setwidth_name = "";
  14. add_style_name = "";
  15. pixel_size = "";
  16. point_size = "";
  17. resolution_x = "";
  18. resolution_y = "";
  19. spacing = "";
  20. average_width = "";
  21. charset_registry = "";
  22. charset_encoding = "";
  23. }
  24. /^FONTNAME_REGISTRY/ { fontname_registry = $2; }
  25. /^FOUNDRY/ { foundry = $2; }
  26. /^FAMILY_NAME/ { family_name = $2; }
  27. /^WEIGHT_NAME/ { weight_name = $2; }
  28. /^SLANT/ { slant = $2; }
  29. /^SETWIDTH_NAME/ { setwidth_name = $2; }
  30. /^ADD_STYLE_NAME/ { add_style_name = $2; }
  31. /^PIXEL_SIZE/ { pixel_size = $2; }
  32. /^POINT_SIZE/ { point_size = $2; }
  33. /^RESOLUTION_X/ { resolution_x = $2; }
  34. /^RESOLUTION_Y/ { resolution_y = $2; }
  35. /^SPACING/ { spacing = $2; }
  36. /^AVERAGE_WIDTH/ { average_width = $2; }
  37. /^CHARSET_REGISTRY/ { charset_registry = $2; }
  38. /^CHARSET_ENCODING/ { charset_encoding = $2; }
  39. /^ENDPROPERTIES/ { exit; }
  40. END {
  41. printf "%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\n", \
  42. fontname_registry, foundry, family_name, weight_name, \
  43. slant, setwidth_name, add_style_name, \
  44. pixel_size, point_size, resolution_x, resolution_y, \
  45. spacing, average_width, charset_registry, charset_encoding;
  46. }' $* | sed 's/"//g'