canvastext.js 524 B

1234567891011121314151617181920
  1. /*!
  2. {
  3. "name": "Canvas text",
  4. "property": "canvastext",
  5. "caniuse": "canvas-text",
  6. "tags": ["canvas", "graphics"],
  7. "polyfills": ["canvastext"]
  8. }
  9. !*/
  10. /* DOC
  11. Detects support for the text APIs for `<canvas>` elements.
  12. */
  13. define(['Modernizr', 'createElement', 'test/canvas'], function(Modernizr, createElement) {
  14. Modernizr.addTest('canvastext', function() {
  15. if (Modernizr.canvas === false) {
  16. return false;
  17. }
  18. return typeof createElement('canvas').getContext('2d').fillText === 'function';
  19. });
  20. });