

Processing.js: How to create  links with Custom fonts - f1lt3r
http://processingjs.org/source/canvas-text-links/canvas-text-link.html

======
axod
You 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
It 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
It's cool for what it is, I was just wondering if it had some advantage over
images that I couldn't yet see.

~~~
f1lt3r
Well 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
Good 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
Well, 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/>

------
Corrado
These 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
Easy enough to make it work for iPhone though, if that's what you are trying
to do.

------
uggedal
Should 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.

~~~
f1lt3r
Changed the example (and updated processing.js) to include mouseClicked().

------
twism
Is it just me or does the verbosity of the processingjs code for custom fonts
bother anyone else?

~~~
f1lt3r
What are you getting at exactly? The code in the demo script or the code in
the library?

~~~
twism
The demo script. Any of the demos as a matter of fact.

~~~
f1lt3r
Well 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.

------
f1lt3r
Updated this.

------
TweedHeads
Never 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
Ironically showing the url in the browsers status bar is automatically
disabled in Firefox because for goatseed reasons.

