getDimensions.lua 907 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. return {
  2. summary = 'Get the dimensions of a glyph, or the font.',
  3. description = 'Returns the dimensions of a glyph, or the dimensions 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. height = {
  20. type = 'number',
  21. description = 'The height, in pixels.'
  22. }
  23. },
  24. variants = {
  25. {
  26. arguments = { 'character' },
  27. returns = { 'width', 'height' }
  28. },
  29. {
  30. arguments = { 'codepoint' },
  31. returns = { 'width', 'height' }
  32. },
  33. {
  34. arguments = {},
  35. returns = { 'width', 'height' }
  36. }
  37. },
  38. related = {
  39. 'Rasterizer:getWidth',
  40. 'Rasterizer:getHeight',
  41. 'Rasterizer:getBoundingBox'
  42. }
  43. }