SDFSettings.js 651 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Settings for the generation of signed distance field glyphs
  3. *
  4. * @private
  5. */
  6. const SDFSettings = {
  7. /**
  8. * The font size in pixels
  9. *
  10. * @type {number}
  11. * @constant
  12. */
  13. FONT_SIZE: 48.0,
  14. /**
  15. * Whitespace padding around glyphs.
  16. *
  17. * @type {number}
  18. * @constant
  19. */
  20. PADDING: 10.0,
  21. /**
  22. * How many pixels around the glyph shape to use for encoding distance
  23. *
  24. * @type {number}
  25. * @constant
  26. */
  27. RADIUS: 8.0,
  28. /**
  29. * How much of the radius (relative) is used for the inside part the glyph.
  30. *
  31. * @type {number}
  32. * @constant
  33. */
  34. CUTOFF: 0.25,
  35. };
  36. export default Object.freeze(SDFSettings);