1 decade ago by quidmonkey
Hey All-
I created a new Canvas-Native Fonts Plugin along with a new FontManager plugin that replaces my popular NotificationManager plugin.
Enjoy, and I appreciate your feedback.
UPDATE
Updated plugin to v1.1. Changelog:
Most notable is the change to updating the context .font property only when necessary. Thanks to Graphikos, we did some initial testing comparing canvas-native fonts vs. ig.Font and found our results all over the place. After some research, I found that setting the context .font property to be a bottleneck. While I could find no explanation why this is, my guess is because each time it's set, it loads in the new font in preparation for drawing. If anyone else has done some benchmarking, I'm all ears.
I created a new Canvas-Native Fonts Plugin along with a new FontManager plugin that replaces my popular NotificationManager plugin.
Enjoy, and I appreciate your feedback.
UPDATE
Updated plugin to v1.1. Changelog:
- Added .alpha property
- Added logic to prevent the canvas context .font property from being set each .draw() for optimization
- Updated .getWidth() and Font.getWidth() to make the font parameter optional and added optimization test
- Removed text parameter from constructor
- Changed .baseline from 'middle' to 'top' to match ImpactJS's style of an object's origin being the top-left corner
Most notable is the change to updating the context .font property only when necessary. Thanks to Graphikos, we did some initial testing comparing canvas-native fonts vs. ig.Font and found our results all over the place. After some research, I found that setting the context .font property to be a bottleneck. While I could find no explanation why this is, my guess is because each time it's set, it loads in the new font in preparation for drawing. If anyone else has done some benchmarking, I'm all ears.