getWidth.lua 785 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. return {
  2. summary = 'Get the width of a glyph, or the font.',
  3. description = 'Returns the width of a glyph, or the maximum width of any glyph.',
  4. arguments = {
  5. character = {
  6. type = 'string',
  7. description = 'A character.'
  8. },
  9. codepoint = {
  10. type = 'number',
  11. description = 'A codepoint.'
  12. }
  13. },
  14. returns = {
  15. width = {
  16. type = 'number',
  17. description = 'The width, in pixels.'
  18. }
  19. },
  20. variants = {
  21. {
  22. arguments = { 'character' },
  23. returns = { 'width' }
  24. },
  25. {
  26. arguments = { 'codepoint' },
  27. returns = { 'width' }
  28. },
  29. {
  30. arguments = {},
  31. returns = { 'width' }
  32. }
  33. },
  34. related = {
  35. 'Rasterizer:getHeight',
  36. 'Rasterizer:getDimensions',
  37. 'Rasterizer:getBoundingBox'
  38. }
  39. }