4 ms·
Processing.js: How to create links with Custom fonts
- Corrado 17y agoThese tricks don't work in all browsers. For example, I was completely unable to trigger it on iPhone. As 'alternate' browsers become more prevalant these tricks become more risky.
- f1lt3r 17y agoEasy enough to make it work for iPhone though, if that's what you are trying to do.
- uggedal 17y agoShould have used mouseClicked() instead of mousePressed() (latter takes you to the href location before the mouse is released). Should also have used the mouseButton variable to determine if it's a left mouse click. As it stands now a right click also takes you to the target page.
- twism 17y agoIs it just me or does the verbosity of the processingjs code for custom fonts bother anyone else?
- f1lt3r 17y agoWhat are you getting at exactly? The code in the demo script or the code in the library?
- twism 17y agoThe demo script. Any of the demos as a matter of fact.
- f1lt3r 17y agoWell it really is designed as a low-barrier language. It doesn't have all the shortcuts you'd see in a low-level language. Even though you can use JavaScript in Processing.js, I usually try to make sure my examples run in the Native Java application also, which requires greater verbosity of course.
- axod 17y agoYou can't select the text, it doesn't behave like text (Can't resize it in browser), so what's the advantage over just using images?
- f1lt3r 17y agoIt was not meant to behave like text as such. It was a quick before-breakfast response to someone's "how-to" request. Processing.js is a visualization language, not a replacement for browser technology, apologies to those who were expecting some kind of all-singing miracle-link.
- axod 17y agoIt's cool for what it is, I was just wondering if it had some advantage over images that I couldn't yet see.
- f1lt3r 17y agoWell someone requested it as a demo because they are creating an interactive canvas program in which the text being displayed will change every time the script is run. Obviously that makes using images impossible. With regards to using images for the glyphs, it's slower and requires more KBs across the board.
- GHFigs 17y agoGood for Processing.js, but those desiring a replacement for sIFR or @font-face will be disappointed. Every browser that supports the Canvas does or is expected to support @font-face as well, so there is no advantage there, and the required conversion to SVG only shifts the embedding rights problem one step away from the browser.
- iamcalledrob 17y agoWell, true, IE doesn't support <canvas> out of the box, but you can make it support it with something like excanvas. http://excanvas.sourceforge.net/ http://excanvas.sourceforge.net/
- f1lt3r 17y agoIt was not intended to be a solution to text on the canvas for anyone but people using the Processing.js language. There are already great tools for TTF rendering for websites like Cufon.
- f1lt3r 17y agoWhen you talk about shifting the rights problem one step further away, I wonder what exactly you mean? Surely the issue is the same regardless of the application layer in which the font's path data is being presented? The only issue being of course that the font's path data is publicly available. Am I missing something?
- TweedHeads 17y agoNever click on a link you don't see where it takes you. You can get goatseed. Is it possible to show the url in the browser's status bar?
- f1lt3r 17y agoIronically showing the url in the browsers status bar is automatically disabled in Firefox because for goatseed reasons.
- f1lt3r 17y agoUpdated this.