{"_id":"textfit","_rev":"12-0063cf518da65e7e5304e55a71beaab7","name":"textfit","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","dist-tags":{"latest":"2.4.0"},"versions":{"2.1.1":{"name":"textfit","version":"2.1.1","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"gitHead":"b073dbe1a026ea2a449cb4bd46a275f15bf176c9","_id":"textfit@2.1.1","_shasum":"d5efaa584d2ce40e972a4aad5c833b7015233e8c","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.32","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"d5efaa584d2ce40e972a4aad5c833b7015233e8c","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.1.1.tgz","integrity":"sha512-PzBwksF6YD1AbSHnrszxMlBI/FqqgnfyVtWLZ78W9/7Ppw/6xJ83e3eV1knSXPnLIwdr2LAt4La2S2DTKkpgiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxz1ta6wLyy/VJCCuY67BbNd4hDuYoKsShLOkqLov2LAiEAvhCCX3BDvQp7oFxiiZ7SgGwLudUgJm3XsgBZ9E6NnrA="}]}},"2.2.0":{"name":"textfit","version":"2.2.0","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"20674686b28403cf9b086ed3badccd1478331a7f","_id":"textfit@2.2.0","_shasum":"bd76a293a57d4daa5aaa75ddce5a3b5ac7e4938a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"bd76a293a57d4daa5aaa75ddce5a3b5ac7e4938a","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.2.0.tgz","integrity":"sha512-4QD480YOmGNy3WA4BlexmdlqGKBG5SvXVGv4wOIlzLzOwTM22vnyEHi4yciFntQAGgc7ebdltrGdgPL6/nD5TA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiavU50U8IZYUFQQ66Uihmj8nm7JvPoIDGS4AnJ+sgJAiEAv+DTqawTUsuv5jdwZVJKIvr5riuWIzvJMpauRjxRBFc="}]}},"2.2.1":{"name":"textfit","version":"2.2.1","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"93ab2ab72db7cae8345d2c0c0b868dcb6af71dae","_id":"textfit@2.2.1","_shasum":"d74b351d3d08ec8672c29c9847d77f5679050a36","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"d74b351d3d08ec8672c29c9847d77f5679050a36","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.2.1.tgz","integrity":"sha512-twQAcJZ+ZTz7Rl3gjAO6fAFEoKp2ZEnyPHJSnYbMH8ccKyIBPpMSov8feNH2uBWdvQU6xzv8mWC3/CeakUFfSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTkqYWIZnDyqFJiXbsatGLGqTF2eKA6VbPGLRqTY7W2wIgV7n7ncb2zKGCGAkv8BDgkvK+NVQXwQa4EorXrHEEIBA="}]}},"2.2.2":{"name":"textfit","version":"2.2.2","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"9ba161e6290a98df4438cf34d0e73570c59919ed","_id":"textfit@2.2.2","_shasum":"1366fb834080b4a9de6123a5d700bc2a003d9f3e","_from":".","_npmVersion":"2.8.4","_nodeVersion":"0.12.2","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"1366fb834080b4a9de6123a5d700bc2a003d9f3e","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.2.2.tgz","integrity":"sha512-UxX6axYjQirbSfJq6lODN98dG1WfiA1PyW94k17OXyQMKxQYVll27F2E5c5O+Iac70sCiiEj1sWrxB8PBx5ecg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYB0BzFGqQowMzNtexTkeialtqPo5EG1CDDz9IlM8efAiAP6KWyXTLFkG/tXBr9e4CWBoQAfJ0T5iGvy7JVQ9eEtg=="}]}},"2.3.0":{"name":"textfit","version":"2.3.0","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"c9e310246594574630ec3d433b9a5c977837eb25","_id":"textfit@2.3.0","_shasum":"08c7c47a61a83fc28373bd79d233a4a152c49fce","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"08c7c47a61a83fc28373bd79d233a4a152c49fce","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.3.0.tgz","integrity":"sha512-tDNvHWE5oD3juN9zBnHoEqIJoG6fVdaKhEcuO0l6jXEIQVRR2Uid0I2KPQM0T4KH4K7a6Efoq/uMbb6sABfEKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGVmHr4gnFkNZwKXUGpzrws++o2OcTYTY3RHVxBsosVRAiEA90XC3Ia7LYbxeFcJbivyHnBgzYLkbd7h6NWv5iIhQkc="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/textfit-2.3.0.tgz_1461603287030_0.42492243670858443"}},"2.3.1":{"name":"textfit","version":"2.3.1","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"dfb36f5497b9f664184cffd064fda060fa77e171","_id":"textfit@2.3.1","_shasum":"5896db48ea70a767b97a73f28556406875ca208f","_from":".","_npmVersion":"3.8.8","_nodeVersion":"5.11.0","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"5896db48ea70a767b97a73f28556406875ca208f","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.3.1.tgz","integrity":"sha512-xHktlAJ+1KPAIPwt46mjNKV4ZD67sjnMzFK4krJXsh1DYN1AJs6uBrm2Ub3R5RoyazRxSaLj6QDusTpbOOg1Cw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgqgV2F7netYrb7NYDmvWMe1UccaFVpbSHoCiP+NncTAiAbc7tZOgP58rZi3p4lFRbojD38w7lVZ1PLUnJF3zGa3A=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/textfit-2.3.1.tgz_1462380617933_0.7010462987236679"}},"2.4.0":{"name":"textfit","version":"2.4.0","description":"A fast, jQuery-free text sizing component that quickly fits single and multi-line text to the width (and optionally height) of its container.","main":"textFit.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"uglifyjs textFit.js > textFit.min.js","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/STRML/textFit.git"},"keywords":["textfit","fit","text"],"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"license":"MIT","bugs":{"url":"https://github.com/STRML/textFit/issues"},"homepage":"https://github.com/STRML/textFit","publishConfig":{"registry":"https://registry.npmjs.org"},"devDependencies":{"uglify-js":"^2.4.17"},"gitHead":"28329bd59ec3c143527ca74622180a121fc4a3ce","_id":"textfit@2.4.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/x4aoY5+/tJmu+iwpBH1yw75TFp86M6X15SvaaY/Eep7YySQYtqdOifEtfvVyMwzl7SZ+G4RQw00FD9g5R6i1Q==","shasum":"80cba8006bfb9c3d9d552739257957bdda95c79c","tarball":"https://registry.npmjs.org/textfit/-/textfit-2.4.0.tgz","fileCount":6,"unpackedSize":24128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCHHvCRA9TVsSAnZWagAA/YEP/298eF8asH/ks6D/cIRc\nNkyiEv+M4bN5lIgA/lykc1/zklP2WHu3lXqAQDRZlxq50wcrMsdUWw39fePE\n7oTKCRsImVkiUbrc9rffJ5Y9FS+uvxZPnBoL8PooY6ok7YCfNMvp8V/NpyIh\n0iJ2wR3UIsbCJ+/9irvw73ntb4YTESjsEzQ1LDOznKyK7HWHCWWO4SDAXZbg\naizZgP4lRxrHJg1MDJ0na+9n1kD7i6jv6S9GlC55/Z074HqSiO8wAFZ3NqEe\nUrY5d6l3a4gsmO7xpJ35+NE+ARUjzPlg5G+Rh5FCI+iffYYok4EnmNYkQW7S\nlqJ9D6BpDlmth8dkxGV3cb/DHIWNakObWa00jLbkAytijrii7KUH2vOW0zWt\nWSdCa6LADKgEuZ6N/C+bYiMZHHDn9Sz0d6EdQqqHBP2VSpv3+XHOc+nFgm0h\nK9gQeFFri6baDHZ/yZTVRIPa1/WsoXaYUXbgTOR0eog0YjrDOLkNzsBkXCaP\nTIGimg7TWGB17KrNGLdvsHT3iJLAc66pH4vXBEPQ+Voe9ad1kLCDrBjU3cE5\noeSTj1ETB3VDPXEI1B9MLp+NxprK9B4lTbl8st5mphoopYBykqeN3Sw48CYV\n6A2+zAwQtsScR7uWwyiZCvFW3LF4nuIz0B4wI7SRTDPwbPszfE3b53INJRK+\naaW6\r\n=pYOK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBcdYUsVu5FfWA9Zr8/Y7V1LuxzAddn3adfMe21Tb5lCAiA4S1yapL4ZDEdmNmGfrvV9JswdFXKhkCd1CAnc4PG+wA=="}]},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/textfit_2.4.0_1560834543286_0.6323353338132696"},"_hasShrinkwrap":false}},"readme":"`textFit` - Hassle-Free Text Fitting\n==================================\n\nA **fast**, dependency-free text sizing component that quickly fits single and multi-line text to the width and/or height of its container.\n\n[Example](http://strml.github.com/examples/textFit.html)\n\nCapabilities\n============\n\n`textFit` is:\n\n* Fast, using binary search to quickly fit text to its container in `log n` time, making it far faster than most solutions.\n  * Most fits are `<1ms`. See the [implementation details](#implementation-details).\n* Dependency-free.\n* Small. `4.1KB` minified and `1.5KB` gzipped.\n* Supports both horizontal and vertical centering, including vertical centering with Flexbox for maximum accuracy.\n* Supports any font face, padding, and multiline text.\n\nBrowser Support\n===============\n\n`textFit` supports IE9+, Firefox, Chrome, Opera, and most mobile browsers. If you find an incompatibility,\nplease file an issue.\n\nIf you require IE <= 8 support, please use the [jQuery version](https://github.com/STRML/textFit/tree/1.0-jQuery).\nFunctionality is identical between v1.0 and v2.0, the only change was the removal of the jQuery dependency.\n\nChangelog\n=========\n\nv2.3.1\n------\n\n* Fix [#20](https://github.com/STRML/textFit/issues/20) - properly iterate over `HTMLCollection` objects.\n\nv2.3.0\n------\n\n* Added `alignVertWithFlexbox`. This does better vertical alignment and fixes #14.\n\nv2.2.0\n------\n\n* Throw errors instead of just printing to console when missing height/width.\n  - Removed `options.suppressErrors`. Wrap in `try/catch` instead if you really need this.\n* Slight refactor.\n* Added automatic build on prepublish.\n\nv2.1.1\n------\n\n* Fixed a bug with `alignVert` when reprocessing.\n* Added full UMD shim and published to npm.\n\nv2.1\n----\n\n* Reworked alignVert.\n* `reProcess` is now `true` by default. Set to `false` if you want to fire-and-forget on potentially\n   processed nodes. This was originally false by default because it was being used in an infinite scrolling list.\n\nv2.0\n----\n\n* Removed jQuery dependency.\n\nUsage\n=====\n\n```html\n<div class=\"box\" style=\"width:300px;height:300px\">\n  Fit me, I am some text\n</div>\n```\n\n```javascript\n// textFit accepts arrays\ntextFit(document.getElementsByClassName('box'));\n// or single DOM elements\ntextFit(document.getElementsByClassName('box')[0]);\n// Use jQuery selectors if you like.\ntextFit($('#box')[0])\n```\n\nThe text will scale until it reaches the horizontal or vertical bounds of the box.\nExplicit width and height styles are required in order to fit the text.\n\nAdvanced Usage\n==============\n\nMultiline Strings\n-----------------\n\nIf your text has multiple lines, textFit() will automatically detect that and disable white-space: no-wrap!\nNo changes are necessary.\n\n```html\n<div class=\"box\" style=\"width:300px;height:300px\">\n  This text <br>\n  Has multiple lines <br>\n  Fit me!\n</div>\n```\n\n```javascript\ntextFit(document.getElementsByClassName('box'))\n```\n\nIf, for some reason, the automatic detection is not working out for you, use the following to explicitly turn on\nmultiLine fitting:\n\n```javascript\ntextFit(document.getElementsByClassName('box'), {multiLine: true})\n```\n\nHorizontal/Vertical Centering\n-----------------------------\n\n```html\n<div class=\"box\" style=\"width:300px;height:300px\">\n  This text <br>\n  Has multiple lines <br>\n  And wants to be centered horizontally and vertically<br>\n  Fit me!\n</div>\n```\n\n```javascript\ntextFit(document.getElementsByClassName('box'), {alignHoriz: true, alignVert: true})\n```\n\nMinimum and Maximum Sizes\n-------------------------\n\nSometimes you want to make sure that your text remains sanely sizes if it is very short or very long. textFit\nhas you covered:\n\n```html\n<div class=\"box\" style=\"width:300px;height:300px\">\n  Short Text\n</div>\n```\n\n```javascript\ntextFit(document.getElementsByClassName('box'), {minFontSize:10, maxFontSize: 50})\n```\n\nImplementation Details\n----------------------\ntextFit determines reasonable minimum and maximum bounds for your text. The defaults are listed below.\n\nTo ensure accurate results with various font-faces, line-heights, and letter-spacings, textFit resizes the text\nuntil it fits the box as accurately as possible. Unlike many similar plugins, textFit uses **binary search** to\nfind the correct fit, which speeds the process significantly. textFit is fast enough to use in production\nwebsites.\n\n`textFit()` is a synchronous function. Because of this, resizes should be invisible as the render thread does not\nhave a chance to do a layout until completion. Normal processing times should be < 1ms and should not significantly\nblock renders.\n\nDefault Settings\n----------------\n\nFrom the source, for reference:\n\n```javascript\nsettings = {\n    alignVert: false, // if true, textFit will align vertically using css tables\n    alignHoriz: false, // if true, textFit will set text-align: center\n    multiLine: false, // if true, textFit will not set white-space: no-wrap\n    detectMultiLine: true, // disable to turn off automatic multi-line sensing\n    minFontSize: 6,\n    maxFontSize: 80,\n    reProcess: true, // if true, textFit will re-process already-fit nodes. Set to 'false' for better performance\n    widthOnly: false, // if true, textFit will fit text to element width, regardless of text height\n    alignVertWithFlexbox: false, // if true, textFit will use flexbox for vertical alignment\n};\n```\n\nLicense\n=======\nMIT\n","maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"time":{"modified":"2022-06-27T05:45:14.093Z","created":"2014-11-15T21:21:59.637Z","2.1.1":"2014-11-15T21:21:59.637Z","2.2.0":"2015-03-19T13:39:18.116Z","2.2.1":"2015-03-24T20:11:28.838Z","2.2.2":"2015-05-15T23:11:31.762Z","2.3.0":"2016-04-25T16:54:49.243Z","2.3.1":"2016-05-04T16:50:20.346Z","2.4.0":"2019-06-18T05:09:03.392Z"},"homepage":"https://github.com/STRML/textFit","keywords":["textfit","fit","text"],"repository":{"type":"git","url":"git+https://github.com/STRML/textFit.git"},"author":{"name":"Samuel Reed","email":"samuel.trace.reed@gmail.com","url":"http://strml.net/"},"bugs":{"url":"https://github.com/STRML/textFit/issues"},"license":"MIT","readmeFilename":"README.md"}