getKerning.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. return {
  2. summary = 'Get the kerning between 2 glyphs.',
  3. description = [[
  4. Returns the kerning between 2 glyphs. Kerning is a slight horizontal adjustment between 2
  5. glyphs to improve the visual appearance. It will often be negative. The units depend on the
  6. font's pixel density. With the default density, the units correspond to meters.
  7. ]],
  8. arguments = {
  9. first = {
  10. type = 'string',
  11. description = 'The first character.'
  12. },
  13. firstCodepoint = {
  14. type = 'number',
  15. description = 'The first codepoint.'
  16. },
  17. second = {
  18. type = 'string',
  19. description = 'The second character.'
  20. },
  21. secondCodepoint = {
  22. name = 'secondCodepoint',
  23. type = 'number',
  24. description = 'The second codepoint.'
  25. }
  26. },
  27. returns = {
  28. keming = {
  29. type = 'number',
  30. description = 'The kerning between the two glyphs.'
  31. }
  32. },
  33. variants = {
  34. {
  35. arguments = { 'first', 'second' },
  36. returns = { 'keming' }
  37. },
  38. {
  39. arguments = { 'firstCodepoint', 'second' },
  40. returns = { 'keming' }
  41. },
  42. {
  43. arguments = { 'first', 'secondCodepoint' },
  44. returns = { 'keming' }
  45. },
  46. {
  47. arguments = { 'firstCodepoint', 'secondCodepoint' },
  48. returns = { 'keming' }
  49. }
  50. },
  51. related = {
  52. 'Rasterizer:getKerning',
  53. 'Font:getAscent',
  54. 'Font:getDescent',
  55. 'Font:getHeight',
  56. 'Font:getWidth'
  57. }
  58. }