Wait for fonts to load and re-size. Only available on some browsers. https://stackoverflow.com/questions/5680013/how-to-be-notified-once-a-web-font-has-loaded document.fonts.ready.then(function () { alert('All fonts in use by visible text have loaded.'); alert('Roboto loaded? ' + document.fonts.check('1em Roboto')); // true });
Update size when page resizes for responsiveness.
- Fixed block element
innerTag
s from overflowing in strange ways. - Added option to automatically resize the element when the page resizes
- Added option to automatically correct (remove) an offset that appears when using large line-height that causes the inner tag to offset outside the div. (corrected by inserting a new div between parent and child with a calculated de-offset)
- Text resizing now respects line-height and letter-spacing settings. (by zhengs)
- Change maxFontPixels default to 0; unless otherwise specified, the font-size will fill the container.
- Remove JQuery Dependency
- Performance improvement
- Added option to truncate without failing
- Using the widthOnly option will apply a white-space:nowrap style so that the measured text won't wrap and therefore not have a proper width calculation. (by Klemens Ullman-Marx)
- Potential infinite loop prevented (by joel Anna)
- Code cleanups (by Klemens Ulman-Marx and GeekyMonkey)
- Distributable files are now in the /dist/ folder. Makefile updated.
- Remove deprecated "callback" callback
- Compatable with webpack module jquery reference
- add
allowOverflow
option (by lepolt)
- add
changeLineHeight
(functionality to resize line-height of parent) - greatly improved code readability and comments
- made option
widthOnly
imply 'whitespace:nowrap'
- add tests for callbacks
- add
fail
callback (#15) - deprecate
callback
callback withsuccess
callback - fix
widthOnly
option (#11, #4)
Height will not cause failure when widthOnly
is set as long as width can fit into the container.
- merge patch for compatibility to ZeptoJS (by sagens42 #13)
- fix error when no console.debug.
- add test for debug flag.
- retag for including the manefest in the tag.
- fix introduced global variable fontSize by
_sizing()
- fix container too small for bigger font size setting (#11)
- Add
debug
option. - Fix a couple of bugs, they didn't size up as big as possible
- Allow to use MaxFontPixels <= 0 to make sizing as big as possible.
- Add explicitWidth and explicitHeight options (#6)
- Fix resizing algorithm (#3)
- Add option widthOnly for header tags (#4)
- Add callbacks for each filled and all filled. (by alex-pex #2)
- Use binary search instead of plain do-while to accelerate the function. (by acsaga #1)
- Add minFontPixels parameter
- This project was moved to GitHub and licensed under the MIT License.
- Released in May 2009.