getBearing.lua 703 B

123456789101112131415161718192021222324252627282930313233
  1. return {
  2. summary = 'Get the bearing of a glyph.',
  3. description = [[
  4. Returns the bearing metric for a glyph, in pixels. The bearing is the horizontal distance from
  5. the cursor to the edge of the glyph.
  6. ]],
  7. arguments = {
  8. character = {
  9. type = 'string',
  10. description = 'A character.'
  11. },
  12. codepoint = {
  13. type = 'number',
  14. description = 'A codepoint.'
  15. }
  16. },
  17. returns = {
  18. bearing = {
  19. type = 'number',
  20. description = 'The bearing of the glyph, in pixels.'
  21. }
  22. },
  23. variants = {
  24. {
  25. arguments = { 'character' },
  26. returns = { 'bearing' }
  27. },
  28. {
  29. arguments = { 'codepoint' },
  30. returns = { 'bearing' }
  31. }
  32. }
  33. }