Canvas with text supporting native ctrl+f in browser -
is possible somehow make "find" (ctrl+f) work if writing text inside canvas?
i checked out basic examples @ https://developer.mozilla.org/en-us/docs/web/api/canvas_api/tutorial/drawing_text , when searching "hello world" in chrome canvas text not hilighted.
is there anyway of doing this?
if there isn't, has seen implementation of "box-and-lines" chart (like uml) using dom? (since native find text supported)
html5 canvas paints text on canvas -- text see inaccessible set of pixels arranged in shape of letters, ctrl-f not find text. if want searchable text can use css place html divs on canvas , set content desired text. ctrl-f find it. can set pointer-events: none
on div doesn't catch events intend canvas.
one wild (and not recommended) workaround put element off-screen containing text. when ctrl-f finds in element, can fetch selected text , calculate painted same selected text on canvas. can redraw selected text on canvas white-on-blue text indicate "found". wild workaround totally not recommended, work
Comments
Post a Comment