{"id":65560,"date":"2024-11-13T03:01:00","date_gmt":"2024-11-12T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=65560"},"modified":"2024-11-13T05:38:46","modified_gmt":"2024-11-12T19:38:46","slug":"textarea-content-masking-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-content-masking-tutorial\/","title":{"rendered":"Textarea Content Masking Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_onkeyup.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Content Masking Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_onkeyup.jpg\" title=\"Textarea Content Masking Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Content Masking Tutorial<\/p><\/div>\n<p>Our fascination with the HTML textarea element <font size=1>(well, you had to be there)<\/font> continues further to some ideas at <a title='Textarea and Div Box Shadow Primer Tutorial' href='#tdbspt'>Textarea and Div Box Shadow Primer Tutorial<\/a> recently.  Today&#8217;s interest is to do with a piece of functionality, that as a default, is missing.  The thing is, the &#8230;<\/p>\n<p><code><br \/>\n<a target=\"_blank\" title='HTML pattern attribute information' href='https:\/\/www.w3schools.com\/tags\/att_input_pattern.asp' rel=\"noopener\">pattern<\/a> attribute is only available for input element (types text, date, search, url, tel, email and password)<br \/>\n<\/code><\/p>\n<p> &#8230; and we&#8217;re thinking the reason, here, is to do with the line feed and carriage return additional talents the textarea element enjoys?  <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=WZFC66rPe4A' rel=\"noopener\">Caviar, anyone?<\/a><\/p>\n<p>Think of this pattern attribute idea, as like &#8230; like &#8230; you like<sup>?<\/sup> &#8230; a <i>content mask<\/i> over textual (keyboard generated) content.  You&#8217;ve probably seen it in action filling out your telephone number on some online form, and certain characters will not be allowed &#8230; like &#8230; type of thing.<\/p>\n<p>Well, today, with an inhouse project, we&#8217;re going to tip our toes into pursuing some inhouse ideas here, and see how far we go &#8230; maybe, eventually, via the use of an external Javascript call &#8230; we&#8217;ll see.  Today&#8217;s start, though, offers the user a chance to enter into some textboxes, optionally containing, either &#8230;<\/p>\n<ol>\n<li>character set disallowed<\/li>\n<li>character set allowed<\/li>\n<\/ol>\n<p> &#8230; regarding keyboard entries made into an accompanying textarea element also presented in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_onkeyup.html_GETME\" rel=\"noopener\">a first draft textarea_onkeyup.html<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_onkeyup.html\" rel=\"noopener\">Textarea Content Masking<\/a> web application &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_onkeyup.html\" style=\"width:95%;height:350px;\"><\/iframe><\/p>\n<p> &#8230; the masking functionality of which is facilitated via an <a target=\"_blank\" title='Javascript onkeyup keyboard event information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/event_onkeyup.asp' rel=\"noopener\"><i>onkeyup<\/i><\/a> keyboard event function &#8230;<\/p>\n<p><code><br \/>\n  var disallowed=[], onlyallowed=[];<br \/>\n<br \/>\n  function patternfix(othis) {<br \/>\n     var itv=0, jtv=0, kok=false;<br \/>\n     if (othis.value == '' || eval('' + disallowed.length) == 0 && eval('' + onlyallowed.length) == 0) { return othis.value; }<br \/>\n     var thisval=othis.value;<br \/>\n     tvs=thisval.split('');<br \/>\n     var tval=thisval;<br \/>\n     if (eval('' + disallowed.length) > 0) {<br \/>\n       tval='';<br \/>\n       for (itv=0; itv&lt;tvs.length; itv++) {<br \/>\n         \/\/alert(tvs[itv]);<br \/>\n         kok=true;<br \/>\n         for (jtv=0; jtv&lt;disallowed.length; jtv++) {<br \/>\n           if (disallowed[jtv] == tvs[itv]) { kok=false; }<br \/>\n         }<br \/>\n         if (kok || tvs[itv] == String.fromCharCode(10)) { tval+=tvs[itv];  }<br \/>\n       }<br \/>\n     }<br \/>\n     tvs=tval.split('');<br \/>\n     if (eval('' + onlyallowed.length) > 0) {<br \/>\n       tval='';<br \/>\n       for (itv=0; itv&lt;tvs.length; itv++) {<br \/>\n         kok=false;<br \/>\n         for (jtv=0; jtv&lt;onlyallowed.length; jtv++) {<br \/>\n           if (onlyallowed[jtv] == tvs[itv]) { kok=true; }<br \/>\n         }<br \/>\n         if (kok || tvs[itv] == String.fromCharCode(10)) { tval+=tvs[itv];  }<br \/>\n       }<br \/>\n     }<br \/>\n     return tval;<br \/>\n  }<br \/>\n<\/code><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/textarea-content-masking-tutorial\/' rel=\"noopener\">Textarea Content Masking Tutorial<\/a>.<\/p-->\n<hr>\n<p id='tdbspt'>Previous relevant <a target=\"_blank\" title='Textarea and Div Box Shadow Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/textarea-and-div-box-shadow-primer-tutorial\/' rel=\"noopener\">Textarea and Div Box Shadow Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea and Div Box Shadow Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.jpg\" title=\"Textarea and Div Box Shadow Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea and Div Box Shadow Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve long been interested in the similarities and contrasts between the use of HTML &#8230;<\/p>\n<ul>\n<li>textarea &#8230; and\/or &#8230;<\/li>\n<li>div<\/li>\n<\/ul>\n<p> &#8230; elements regarding content and aesthetics and uses (within a webpage).  Perhaps you were here when we presented the <a title='Textarea Pointing Local Font Canvas Overlay Deletes Tutorial' href='#tplfcodt'>Textarea Pointing Local Font Canvas Overlay Deletes Tutorial<\/a> thread of blog postings touching on some of this.<\/p>\n<p>A topic we hadn&#8217;t thought about then was the CSS <i>box-shadow<\/i> property we got encouraged to &#8220;take on&#8221; by <a target=\"_blank\" href='https:\/\/www.w3schools.com\/css\/css3_shadows_box.asp' title=\"W3school's CSS Box Shadow information, thanks\" rel=\"noopener\">CSS Box Shadow<\/a>, thanks.<\/p>\n<p>So we decided to pit these two element types up against each other, <a target=\"_blank\" title=\"?\" href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s' rel=\"noopener\">again<\/a>, in an &#8230;<\/p>\n<blockquote style=\"cursor:pointer;\" onclick=\"window.open('\/\/www.youtube.com\/watch?v=WO23WBji_Z0','_blank','top=100,left=100,width=600,height=600');\"><p>\nEverything you can do,<br \/>\nI can do better\n<\/p><\/blockquote>\n<p> &#8230; feeling scenario, where <font size=1>(don&#8217;t tell these two, but)<\/font> really, there is this, as well as a &#8220;complementary&#8221; feeling about the interactions, especially regarding the HTML textarea <i>faux<\/i> &#8220;resizing talents&#8221; <font size=1>(we were gobsmacked to learn from <a target=\"_blank\" href='https:\/\/stackoverflow.com\/questions\/15495936\/textarea-onresize-not-working' title='Excellent advice, thanks' rel=\"noopener\">this excellent &#8220;Textarea onresize Not Working&#8221; link<\/a> could not be harnessed via an <i>onresize<\/i> event, but rather use <i>onmouseup<\/i> and <i>onmousemove<\/i>)<\/font>, the intelligence of which can pass onto resizing the HTML div element in a similar way.<\/p>\n<p>As far as a document.body onload event Javascript function &#8220;amalgamating&#8221; approach to assimilate the two &#8230;<\/p>\n<p><code><br \/>\n   function onl() {<br \/>\n      document.getElementById('mydiv').innerHTML=contis;<br \/>\n      rectis=document.getElementById('mydiv').getBoundingClientRect();<br \/>\n      document.getElementById('myta').style.width='' + rectis.width + 'px';<br \/>\n      document.getElementById('myta').style.height='' + eval(80 + rectis.height) + 'px';<br \/>\n      document.getElementById('mydiv').style.height='' + eval(80 + rectis.height) + 'px';<br \/>\n      rectis=document.getElementById('mydiv').getBoundingClientRect();<br \/>\n      origrectis=rectis;<br \/>\n      document.getElementById('myta').innerHTML=contis;<br \/>\n      document.getElementById('mydiv').style.fontFamily = window.getComputedStyle(document.getElementById('myta'),null).fontFamily || document.getElementById('myta').style.fontFamily || document.getElementById('myta').currentStyle.getCurrentProperty('font-family');<br \/>\n      document.getElementById('mydiv').setAttribute('data-ff', '' + document.getElementById('mydiv').style.fontFamily);<br \/>\n      document.getElementById('myta').setAttribute('data-ff', '' + document.getElementById('mydiv').style.fontFamily);<br \/>\n      \/\/document.getElementById('optffta').innerText+='' + document.getElementById('mydiv').style.fontFamily;<br \/>\n      \/\/document.getElementById('optffdiv').innerText+='' + document.getElementById('mydiv').style.fontFamily;<br \/>\n      document.getElementById('mydiv').style.fontSize = window.<font color=blue>getComputedStyle<\/font>(document.getElementById('myta'),null).fontSize || document.getElementById('myta').style.fontSize || document.getElementById('myta').currentStyle.getCurrentProperty('font-size');<br \/>\n      document.getElementById('mydiv').setAttribute('data-fs', '' + document.getElementById('mydiv').style.fontSize);<br \/>\n      document.getElementById('myta').setAttribute('data-fs', '' + document.getElementById('mydiv').style.fontSize);<br \/>\n      document.getElementById('mydiv').style.padding = window.<font color=blue>getComputedStyle<\/font>(document.getElementById('myta'),null).padding || document.getElementById('myta').style.padding || document.getElementById('myta').currentStyle.getCurrentProperty('padding');<br \/>\n      document.getElementById('mydiv').style.margin = window.<font color=blue>getComputedStyle<\/font>(document.getElementById('myta'),null).margin || document.getElementById('myta').style.margin || document.getElementById('myta').currentStyle.getCurrentProperty('margin');<br \/>\n      document.getElementById('fsta').placeholder='' + document.getElementById('mydiv').style.fontSize;<br \/>\n      document.getElementById('fsdiv').placeholder='' + document.getElementById('mydiv').style.fontSize;<br \/>\n   }<br \/>\n<\/code><\/p>\n<p> &#8230; the wonderful Javascript <a target=\"_blank\" href='https:\/\/www.w3schools.com\/jsref\/jsref_getcomputedstyle.asp' title='getComputedStyle information from W3schools' rel=\"noopener\">getComputedStyle<\/a> window object method comes in very handy.<\/p>\n<p>This <a style=\"display:none;\" target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?zero=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.html_GETME\" rel=\"noopener\">first draft<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.html_GETME\" rel=\"noopener\">first draft<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.html\" rel=\"noopener\">Textarea and Div Box Shadow Interactions<\/a> web application can be tried below &#8230;<\/p>\n<p><iframe style=\"width:98%;height:2400px;\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_and_div_box_shadow_interactions.html\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/textarea-and-div-box-shadow-primer-tutorial\/' rel=\"noopener\">Textarea and Div Box Shadow Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='tplfcodt'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Canvas Overlay Deletes Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-canvas-overlay-deletes-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Canvas Overlay Deletes Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Canvas Overlay Deletes Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using_canvas_overlay_deletes.jpg\" title=\"New Textarea Pointing Local Font Canvas Overlay Deletes Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Canvas Overlay Deletes Tutorial<\/p><\/div>\n<p>In life, as in programming, it&#8217;s the &#8220;what ifs<font size=1>?<\/font>&#8221; about a job that can take a whole lot longer than you think, I suppose, as much as anything, if you&#8217;re an optimist like me, and want to get into projects at the start to see progress early (as to not assign a project to the &#8220;do later&#8221; basket), and so have left those &#8220;what ifs<font size=1>?<\/font>&#8221; to tackle later.  Or maybe, really, it&#8217;s just your simpler thinking types, like me, that work it this way.   Anyway, whatevvvvveerrr, they often take more time, and in today&#8217;s case, we find it hard to envisage we should have made its functionality a &#8220;central tenet&#8221; to doing the project.<\/p>\n<p>So what is this newly introduced functionality to our &#8220;Textarea Pointing&#8221; and &#8220;Local Fonts&#8221; projects?  It&#8217;s the &#8220;textarea&#8221; keyboard functionality requirements in relation to &#8220;what if the user hits the &#8230;<\/p>\n<p><code><br \/>\nBackspace or Delete<br \/>\n<\/code><\/p>\n<p> &#8230; keys<font size=1>?<\/font>&#8220;.  Our non central view of this issue panned out as an okay strategy, and maybe a few days back with the <a title='Textarea Pointing Local Font Event Usage Tutorial' href='#tplfeut'>Textarea Pointing Local Font Event Usage Tutorial<\/a> (shenanigans, that required a Stop Press) you were nodding your head (very sagely, no doubt?!) when we said &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-event-usage-tutorial\/'><p>\n<b><i><\/p>\n<p>Stop Press<\/p>\n<p><\/i><\/b><br \/>\n<\/p>\n<p>New preference to use <i>onkeypress<\/i> is to do with its better interpretation (with respect to <i>onkeyup<\/i>) of those characters that share a keyboard button and are not letters nor numbers (eg. the comma).  Thanks to this <a target=\"_blank\" title='Useful information' href='https:\/\/stackoverflow.com\/questions\/3977642\/how-to-know-if-keyup-is-a-character-key-jquery' rel=\"noopener\">useful link<\/a> and <a target=\"_blank\" title='Set me right about Firefox, thanks' href='https:\/\/stackoverflow.com\/questions\/25556097\/keypress-working-in-chrome-but-not-firefox' rel=\"noopener\">this Firefox good advice<\/a>, thanks, for excellent information here.<\/p>\n<\/blockquote>\n<p> &#8230; predicting we&#8217;d come to a <a target=\"_blank\" title='Pretty pass' href='https:\/\/www.google.com.au\/search?q=charlotte+pass&#038;biw=1067&#038;bih=554&#038;source=lnms&#038;tbm=isch&#038;sa=X&#038;ved=0ahUKEwjamLWJo7_MAhUFoJQKHVzBAe0Q_AUIBygC' rel=\"noopener\">pretty pass<\/a> when we lifted our gaze to the <i>&#8220;Backspace Delete dilemma&#8221;<\/i> <font size=1>&#8230; da da da da<\/font>.  On that day we got confused by Firefox behaviour with characters like comma (&#8220;,&#8221;) and, we think now, co-ordinates that are real rather than integers, and we gave the <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeydown<\/i><\/a> event a try for a few minutes (maybe you saw with an earlier version of the Stop Press).  Well, now, we realize in hindsight, that the <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeypress<\/i><\/a> event is not the place to trap Backspace, nor Delete keys, and in the &#8230;<\/p>\n<p><code><br \/>\nonkeydown\/onkeypress\/onkeyup<br \/>\n<\/code><\/p>\n<p> &#8230; common ordering of web browser keyboard events it is actually good to compartmentalize the <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeypress<\/i><\/a> event logic to handle the &#8220;non what if<font size=1>?<\/font>&#8221; work and <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeydown<\/i><\/a> event logic (new to our code today) to handle the <i>&#8220;Backspace Delete <font size=1>&#8230; da da da da<\/font> dilemma&#8221;<\/i> &#8230; fortuitous, huh?!<\/p>\n<p>What&#8217;s our approach?  We store in a global Javascript &#8230;<\/p>\n<p><code><br \/>\nvar verboselastcharsare='';<br \/>\n<\/code><\/p>\n<p> &#8230; at &#8220;textarea&#8221; <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onclick<\/i><\/a> events an initialized value of &#8230;<\/p>\n<p><code><br \/>\nmousePositionX,mousePositionY,0<br \/>\n<\/code> <\/p>\n<p> &#8230; and henceforward an updated semicolon delimited set of &#8230;<\/p>\n<p><code><br \/>\nmousePositionX.startOfCanvasCommandArrayRangeIndex,mousePositionY.endOfCanvasCommandArrayRangeIndex,asciiCodeOfCharacter.canvasIdPartToSetVisibilityHiddenRePhalanxOfCanvasesOverPosseOfTextareas<br \/>\n<\/code><\/p>\n<p> &#8230; when characters are detected by <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeypress<\/i><\/a>.<\/p>\n<p>That sets us up to backtrack should the <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeydown<\/i><\/a> event detect a &#8220;textarea&#8221; keyboard &#8230;<\/p>\n<p><code><br \/>\nBackspace or Delete<br \/>\n<\/code><\/p>\n<p> &#8230; key as per (where <i>ota<\/i> represents a &#8220;textarea&#8221; object (just created)) &#8230;<\/p>\n<p><code><br \/>\n<i>ota<\/i>.addEventListener('keydown', function(event) {  \/\/ thanks to <a target=\"_blank\" title='Useful link' href='https:\/\/stackoverflow.com\/questions\/9906885\/detect-backspace-and-del-on-input-event\/9906991' rel=\"noopener\">https:\/\/stackoverflow.com\/questions\/9906885\/detect-backspace-and-del-on-input-event\/9906991<\/a><br \/>\n    const key = event.key; \/\/ const {key} = event; ES6+<br \/>\n    if (key === \"Backspace\" || key === \"Delete\") {<br \/>\n        \/\/alert('bs or del pressed ' + lastcharsare + ' ' + verboselastcharsare);<br \/>\n        if (verboselastcharsare != \"\") {<br \/>\n         if (verboselastcharsare.indexOf(\";\") != -1) {<br \/>\n          var vsare=verboselastcharsare.split(\";\");<br \/>\n          var preloi=vsare[eval(-2 + vsare.length)];<br \/>\n          var loi=vsare[eval(-1 + vsare.length)];<br \/>\n          mousePosition.x=eval(preloi.split(',')[0].split('.')[0]);<br \/>\n          mousePosition.y=eval(preloi.split(',')[1].split('.')[0]);<br \/>\n          if (loi.split(',')[2].indexOf('.') != -1) {  \/\/ need to not display this canvas overlay<br \/>\n        \/\/alert('making lfnow' + eval(1 + eval(loi.split(',')[2].split('.')[1])) + ' invisible');<br \/>\n            xccmds.push(\"document.getElementById('lfnow\" + eval(1 + eval(loi.split(',')[2].split('.')[1])) + \"').style.visibility='hidden';\");<br \/>\n            document.getElementById('lfnow' + eval(1 + eval(loi.split(',')[2].split('.')[1]))).style.visibility='hidden';<br \/>\n            \/\/xccmds.push(\"document.getElementById('dlfnow\" + eval(0 + eval(loi.split(',')[2].split('.')[1])) + \"').style.visibility='hidden';\");<br \/>\n            if (loi.split(',')[0].indexOf('.') != -1 && loi.split(',')[1].indexOf('.') != -1) {<br \/>\n               \/\/alert(loi + ' ... ' + loi.split(',')[0].split('.')[1]);<br \/>\n               for (var iii=eval(loi.split(',')[0].split('.')[1]); iii&lt;eval(loi.split(',')[1].split('.')[1]); iii++) {<br \/>\n                 if (ccmds.length &gt; iii) {<br \/>\n                   if (ccmds[iii].indexOf(\"if (1 == 78) \") == -1) {<br \/>\n                     ccmds[iii]=\"if (1 == 78) \" + ccmds[iii];<br \/>\n                     \/\/alert(ccmds[iii]);<br \/>\n                   }<br \/>\n                 }<br \/>\n               }<br \/>\n            }<br \/>\n          } else if (loi.split(',')[0].indexOf('.') != -1 && loi.split(',')[1].indexOf('.') != -1) {<br \/>\n               \/\/alert(loi + ' ... ' + loi.split(',')[0].split('.')[1]);<br \/>\n               for (var iii=eval(loi.split(',')[0].split('.')[1]); iii&lt;eval(loi.split(',')[1].split('.')[1]); iii++) {<br \/>\n                 if (ccmds.length &gt; iii) {<br \/>\n                   if (ccmds[iii].indexOf(\"if (1 == 78) \") == -1) {<br \/>\n                     ccmds[iii]=\"if (1 == 78) \" + ccmds[iii];<br \/>\n                     \/\/alert(ccmds[iii]);<br \/>\n                   }<br \/>\n                 }<br \/>\n               }<br \/>\n          }<br \/>\n          verboselastcharsare=verboselastcharsare.replace(\";\" + loi,\"\").replace(\"\" + loi,\"\");<br \/>\n          if (verboselastcharsare.indexOf(\";\") != -1) {<br \/>\n          loi=vsare[eval(-1 + vsare.length)];<br \/>\n          lastcharsare=String.fromCharCode(eval('' + loi.split(',')[2].split('.')[0]));<br \/>\n          }<br \/>\n         } else {<br \/>\n          mousePosition.x=eval('' + mousePositionx);<br \/>\n          mousePosition.y=eval('' + mousePositiony);<br \/>\n         }<br \/>\n        }<br \/>\n        return false;<br \/>\n    }<br \/>\n});<br \/>\n<\/code><\/p>\n<p>Today we also do a bit of pixel level tweaking of &#8220;phalanx of canvases on top of posse of textareas&#8221; positioning and sizing, to try to improve its look slightly, as well as turn off web browser &#8220;textarea&#8221; spell checking via the newly used attribute &#8230;<\/p>\n<p><code><br \/>\n  spellcheck=\"false\"<br \/>\n<\/code><\/p>\n<p>Also, today, adding to the progress of the recent <a title='Textarea Pointing Local Font Canvas Overlays Tutorial' href='#tplfcot'>Textarea Pointing Local Font Canvas Overlays Tutorial<\/a>, we allow users to override &#8220;local font&#8221; <i>tutti frutti<\/i>&#8216;ness (how could you?) by, when asking the Javascript prompt window asking for a &#8220;local font&#8221; name you suffix your answer (not used) with &#8230;<\/p>\n<p><code><br \/>\n:[colour]<br \/>\n<\/code><\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-------------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-------------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to continue for this progress, crablike as it may appear, down the &#8220;use of local fonts&#8221; (and &#8220;textarea pointing&#8221;) super<font size=1>ish<\/font>highway.<\/p>\n<hr>\n<p id='tplfcot'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Canvas Overlays Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-canvas-overlays-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Canvas Overlays Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Canvas Overlays Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using_canvas_overlays.jpg\" title=\"Textarea Pointing Local Font Canvas Overlays Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Canvas Overlays Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Textarea Pointing Local Font Event Paste Tutorial' href='#tplfept'>Textarea Pointing Local Font Event Paste Tutorial<\/a> had us (additionally to the &#8220;Pointing&#8221; functionality mode of use) integrating &#8220;local font&#8221; display with the &#8230;<\/p>\n<ul>\n<li>&#8220;Font Learning via <b>Canvas<\/b>&#8221; &#8230; but then you&#8217;ll remember with <a target=\"_blank\" title='Textarea Pointing Local Font Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Tutorial<\/a>&#8216;s &#8230;<br \/>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-tutorial\/'>\n<p>It&#8217;s in our thinking to capture these co-ordinates via any\/both of &#8230;<\/p>\n<p><\/p>\n<ol>\n<li><a target=\"_blank\" title='HTML textarea tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_textarea.asp' rel=\"noopener\">textarea<\/a><\/li>\n<li><b><a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">canvas<\/a><\/b><\/li>\n<\/ol>\n<p><\/p>\n<p> &#8230; but for today&#8217;s progress, <b>just canvas<\/b> work in an HTML iframe channeling our <a target=\"_blank\" title='Signature Signature Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/signature-signature-primer-tutorial\/' rel=\"noopener\">Signature Signature Primer Tutorial<\/a>&#8216;s &#8220;Signature of Signature&#8221; (hard working &#8220;duck&#8221; web application) examined <font size=1>&#8230; you guessed it &#8230;<\/font> via a <a target=\"_blank\" title='Client pre-emptive iframe' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=pre-emptive' rel=\"noopener\">&#8220;client pre-emptive iframe&#8221;<\/a> determination of its existence.  We limit the height and width of that HTML iframe to reflect the height and width of a font character, but bear with us if the size of this changes a bit over time.  We&#8217;ll see.  The iframe starts in &#8220;scribble&#8221; data capture mode, reflecting you creating your own unique font character versions, hence the &#8220;local font&#8221; concept. <\/p>\n<\/blockquote>\n<p> &#8230; how we wanted to truly differentiate the functionalities of &#8230;<\/li>\n<li>&#8220;Font Learning via <i>Textarea<\/i>&#8220;<\/li>\n<li>&#8220;Font Learning via <i>Both<\/i>&#8220;<\/li>\n<\/ul>\n<p> &#8230; and today&#8217;s the day for that differentiation to occur, so that, in our books <font size=1>&#8230; but not our pamphlettes &#8230;<\/font><\/p>\n<ul>\n<li>&#8220;Font Learning via <i>Textarea<\/i>&#8221; &#8230; will, in the posse of &#8220;textareas&#8221; display, for &#8220;local fonts&#8221; linked to, will display those &#8220;local font&#8221; characters at the appropriate time within the &#8220;textarea&#8221; of focus, as the user types the (keyboard) character of interest, as the &#8220;linework&#8221; it is represented as in the &#8220;local font&#8221; data (in <a target=\"_blank\" title='Web Storage information from w3schools' href='https:\/\/www.w3schools.com\/html\/html5_webstorage.asp' rel=\"noopener\">web storage<\/a> &#8220;localStorage&#8221; &#8230; so local to the web browser the user is currently using), else for other (keyboard) characters the usual functionality of &#8220;textarea&#8221; display and data collection and input, apply &#8230; and will not show those &#8220;local font&#8221; mappings after clicking the &#8220;Canvas&#8221; button<\/li>\n<li>&#8220;Font Learning via <i>Both<\/i>&#8221; &#8230; is as above but will show those &#8220;local font&#8221; mappings after clicking the &#8220;Canvas&#8221; button, as well<\/li>\n<\/ul>\n<p>Given we are not mentioning <a target=\"_blank\" title='Google search for @font-face' href='https:\/\/www.google.com.au\/search?q=font-face&#038;ie=utf-8&#038;oe=utf-8&#038;client=firefox-b-ab&#038;gfe_rd=cr&#038;dcr=0&#038;ei=seNVWt2FJoLp8wfq7oOgDw' rel=\"noopener\">&#8220;@font-face&#8221;<\/a> (for online font methodologies) anywhere, how do we achieve the new functionality differentiation for those two options above?  <a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">Canvases<\/a> again, a whole <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=zgywD3XJaWU' rel=\"noopener\">&#8220;phalanx&#8221;<\/a> of them, <a target=\"_blank\" title='Overlay blog postings here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay' rel=\"noopener\">overlayed<\/a> (via CSS <a target=\"_blank\" title='CSS position:absolute information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_class_position.asp' rel=\"noopener\">position:absolute<\/a> and <a target=\"_blank\" title='CSS z-index information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_pos_z-index.asp' rel=\"noopener\">z-index<\/a> properties) on top of the <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=-kbTbg00AJU' rel=\"noopener\">&#8220;posse&#8221;<\/a> of &#8220;textareas&#8221; at places where &#8220;local font&#8221; characters can be plucked out of storage and used in the displays.<\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to continue down this &#8220;use of local fonts&#8221; freeway.<\/p>\n<hr>\n<p id='tplfept'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Event Paste Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-event-paste-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Event Paste Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Event Paste Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using_tutti_frutti.jpg\" title=\"Textarea Pointing Local Font Event Paste Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Event Paste Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Textarea Pointing Local Font Event Usage Tutorial' href='#tplfeut'>Textarea Pointing Local Font Event Usage Tutorial<\/a>&#8216;s bugs have in large part been addressed today.  <font size=1>I&#8217;d rather not discuss.<\/font><\/p>\n<p>Moving forward, today, we catered for the possibilities of a paste operation delivered into our &#8220;posse&#8221; of &#8220;textareas&#8221; <font size=1>&#8230; <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=-kbTbg00AJU' rel=\"noopener\"><i>Clag<\/i> salespeople perhaps?<\/a> &#8230;<\/font> on the scenario that we are using &#8220;local fonts&#8221;, and when you use &#8220;local fonts&#8221; we want you to have many keyboard &#8220;onkeypress&#8221; events try and keep up with what you are typing &#8230; so we looked up the web and got the code below, largely thanks to <a target=\"_blank\" title='Useful link' href='https:\/\/stackoverflow.com\/questions\/3368578\/trigger-a-keypress-keydown-keyup-event-in-js-jquery' rel=\"noopener\">this useful link<\/a> (thanks) helps us out with &#8230;<\/p>\n<p><code><br \/>\n\/\/ Thanks to https:\/\/stackoverflow.com\/questions\/3368578\/trigger-a-keypress-keydown-keyup-event-in-js-jquery<br \/>\nfunction triggerEvent(el, type, keyCode) {<br \/>\n    if ('createEvent' in document) {<br \/>\n            \/\/ modern browsers, IE9+<br \/>\n            var e = document.createEvent('HTMLEvents');<br \/>\n            e.keyCode = keyCode;<br \/>\n            e.initEvent(type, false, true);<br \/>\n            el.dispatchEvent(e);<br \/>\n    } else {<br \/>\n        \/\/ IE 8<br \/>\n        var e = document.createEventObject();<br \/>\n        e.keyCode = keyCode;<br \/>\n        e.eventType = type;<br \/>\n        el.fireEvent('on'+e.eventType, e);<br \/>\n    }<br \/>\n}<br \/>\n<br \/>\nfunction pasted(element) {<br \/>\n    setTimeout(function(){<br \/>\n     if (dynamiccanvas) {<br \/>\n      for (var iii=0; iii&lt;element.value.length; iii++) {<br \/>\n        triggerEvent(document.getElementById(focusto), 'keypress', element.value.substring(iii,eval(1 + iii)).charCodeAt());<br \/>\n      }<br \/>\n     }<br \/>\n    }, 4);<br \/>\n}<br \/>\n<\/code><\/p>\n<p> &#8230; for HTML &#8220;textarea&#8221; elements containing <i>onpaste=&#8221;pasted(this);&#8221;<\/i> within their attributes.<\/p>\n<p>As far as dealing with non-monospaced fonts, we again got good advice from the &#8220;net&#8221; and used the code of <a tage=_blank le='Useful link' href='https:\/\/stackoverflow.com\/questions\/118241\/calculate-text-width-with-javascript'>this useful link<\/a> (thanks) as below &#8230;<\/p>\n<p><code><br \/>\n\/\/ Handy JavaScript to measure the size taken to render the supplied text;<br \/>\n\/\/ you can supply additional style information too if you have it.<br \/>\n\/\/ Thanks to https:\/\/stackoverflow.com\/questions\/118241\/calculate-text-width-with-javascript<br \/>\nfunction measureText(pText, pFontFamily, pFontSize, pStyle) {<br \/>\n     var lDiv = document.createElement('div');<br \/>\n<br \/> <br \/>\n     document.body.appendChild(lDiv);<br \/>\n<br \/> <br \/>\n     if (pStyle != null) {<br \/>\n         lDiv.style = pStyle;<br \/>\n     }<br \/>\n     lDiv.style.fontFamily = \"\" + pFontFamily;<br \/>\n     lDiv.style.fontSize = \"\" + pFontSize.replace('px','') + \"px\";<br \/>\n     lDiv.style.position = \"absolute\";<br \/>\n     lDiv.style.left = -1000;<br \/>\n     lDiv.style.top = -1000;<br \/>\n<br \/> <br \/>\n     lDiv.innerHTML = pText + pText;<br \/>\n<br \/> <br \/>\n     var lResult = {<br \/>\n         width: lDiv.clientWidth,<br \/>\n         height: lDiv.clientHeight<br \/>\n     };<br \/>\n<br \/> <br \/>\n     lResult.width\/=2;<br \/>\n     \/\/lResult.width*=1.2;<br \/>\n<br \/> <br \/>\n     document.body.removeChild(lDiv);<br \/>\n     lDiv = null;<br \/>\n<br \/> <br \/>\n     return lResult;<br \/>\n }<br \/>\n<\/code><\/p>\n<p> &#8230; to be constantly updating our Javascript&#8217;s global <i>var charwh = {width: 0, height: 0};<\/i> so that real rendered character widths are calculated to allow us, when in &#8220;local fonts&#8221; mode, more reliably draw &#8220;local font&#8221; linework and non-&#8220;local font&#8221; characters alike with a suitable width for that Font Family and Font Style and Font Size combination.<\/p>\n<p>And thanks to the wonderful <a target=\"_blank\" title='Rainbow colours' href='https:\/\/www.webnots.com\/vibgyor-rainbow-color-codes\/' rel=\"noopener\">rainbow colours<\/a> webpage helping us out with our (tutti frutti) &#8220;local fonts&#8221; execution example as shown in today&#8217;s <a target=\"_blank\" title='Tutorial picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using_tutti_frutti.jpg' rel=\"noopener\">tutorial picture<\/a>.<\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-----------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-----------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to continue down this &#8220;use of local fonts&#8221; boulevard.<\/p>\n<hr>\n<p id='tplfeut'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Event Usage Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-event-usage-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Event Usage Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Event Usage Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using.jpg\" title=\"Textarea Pointing Local Font Event Usage Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Event Usage Tutorial<\/p><\/div>\n<p>Today we embark on our journey to incorporate the &#8220;local fonts&#8221; of yesterday&#8217;s <a title='Textarea Pointing Local Font Colour Tutorial' href='#tplfct'>Textarea Pointing Local Font Colour Tutorial<\/a>, and earlier, in real scenarios.  The first cab off the rank is this web application, &#8220;Textarea Pointing&#8221; we&#8217;ve been working on.  We now allow you to (but need more refinement on the detail of) &#8230;<\/p>\n<ul>\n<li>specify a font family which is a &#8220;local font&#8221; name (which the user can arrange at the Javascript prompt window asking for this &#8220;local font&#8221; name of use)<\/li>\n<li>while you enter keyboard characters in the bank of &#8220;textarea&#8221; elements we trap the <strike><a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeyup<\/i><\/a><\/strike> <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onkeypress<\/i><\/a> event to obtain the (keyboard) character that was pressed, while already existant was functionality at the &#8220;textarea&#8221; <a target=\"_blank\" title='Events information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_eventattributes.asp' rel=\"noopener\"><i>onclick<\/i><\/a> event to have available to us that first &#8220;textarea&#8221; top left position (that we then offset our position from based on font size characteristics and the <strike><i>onkeyup<\/i><\/strike> <i>onkeypress<\/i> detection of ascii code 13 for carriage return (to create a new line within the &#8220;textarea&#8221;))<\/li>\n<li>as necessary, if the keyboard character has been digitised into the &#8220;local font&#8221; record the &#8220;linework&#8221; of that character for that &#8220;local font&#8221;, else record the way that character would be placed as text, into the underlying HTML5 canvas element<\/li>\n<li>as the user then next presses the &#8220;Canvas&#8221; button they see the results of this merging of default font with &#8220;local font&#8221; rendering<\/li>\n<\/ul>\n<p><b><i><\/p>\n<p>Stop Press<\/p>\n<p><\/i><\/b><\/p>\n<p>New preference to use <i>onkeypress<\/i> is to do with its better interpretation (with respect to <i>onkeyup<\/i>) of those characters that share a keyboard button and are not letters nor numbers (eg. the comma).  Thanks to this <a target=\"_blank\" title='Useful information' href='https:\/\/stackoverflow.com\/questions\/3977642\/how-to-know-if-keyup-is-a-character-key-jquery' rel=\"noopener\">useful link<\/a> and <a target=\"_blank\" title='Set me right about Firefox, thanks' href='https:\/\/stackoverflow.com\/questions\/25556097\/keypress-working-in-chrome-but-not-firefox' rel=\"noopener\">this Firefox good advice<\/a>, thanks, for excellent information here.<\/p>\n<p> &#8230; but, as you can see from today&#8217;s <a target=\"_blank\" title='Tutorial picture' href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_font_using.jpg' rel=\"noopener\">tutorial picture<\/a> tweaking all this correctly, is a work in progress.  Of course, one issue is that most fonts are not monospaced fonts, as Courier New is, so letters such as &#8220;i&#8221; take up a much smaller width to characters like &#8220;m&#8221; and &#8220;w&#8221; &#8230; oh! happy days?!  Making it more generic is a work in progress too, but we are encouraged by the early workings of the &#8220;proof of concept&#8221; parts to this &#8220;local font&#8221; usage.<\/p>\n<p>The <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html----------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html----------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to start down this &#8220;use of local fonts&#8221;.<\/p>\n<hr>\n<p id='tplfct'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Colour Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-colour-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Colour Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Colour Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas_ls_rasterise_font_edit_tuttifrutti.jpg\" title=\"Textarea Pointing Local Font Colour Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Colour Tutorial<\/p><\/div>\n<p>The normal way we deal with fonts online is to define a &#8230;<\/p>\n<ul>\n<li>font family<\/li>\n<li>font style<\/li>\n<li>font size<\/li>\n<\/ul>\n<p> &#8230; or say nothing and let the defaults happen.  That can then be modified by a &#8230;<\/p>\n<ul>\n<li>font colour<\/li>\n<\/ul>\n<p> &#8230; and the whole sets of characters you&#8217;ve defined these settings for will have those characteristics &#8220;mapped&#8221; onto them.  However, with our &#8220;local fonts&#8221;, we are making the rules (and though we are not sure this thinking will &#8220;map&#8221; over to our work later, when we will try to have all this data capture amount to creating a real online font (we&#8217;ll at least look into it)), and we are free to rejoin yesterday&#8217;s <a title='Textarea Pointing Local Font Editing Tutorial' href='#tplfet'>Textarea Pointing Local Font Editing Tutorial<\/a>&#8216;s &#8230;<\/p>\n<blockquote><p>\nDid you notice how we differentiated the X co-ordinates as &#8220;Integers&#8221; (ie. counting numbers) and did not say that about the Y co-ordinates?  That&#8217;s because we want some flexibility down the track to be able to add some business logic somewhere, but try not to break the basic delimitation rules of the design\n<\/p><\/blockquote>\n<p> &#8230; to take up the challenge of using an mantissa part to that Y co-ordinate consisting of (for the case of {startYCoord}) &#8230;<\/p>\n<p><code><br \/>\n{startYCoord} is made up of {startIntegerYCoord}[.{Red3Digits}{Green3Digits}{Blue3Digits}]<br \/>\n<\/code><\/p>\n<p> &#8230; enabling what we like to call &#8220;tutti frutti&#8221; ideas with your font characters, in that they can have multiple colours in their makeup at the font creation level.  The creator of the local font can control this by setting a colour and then clicking on a previously digitized font character, to modify it for this new colour setting imbued in its co-ordinate makeup.  Cute, huh?<\/p>\n<p>In order to achieve that idea, we again needed to set up more &#8220;interplay&#8221; between &#8230;<\/p>\n<ul>\n<li>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html--------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html--------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to allow for these new &#8220;colourful&#8221; local &#8220;Font Creation&#8221; canvas editing functionalities &#8230; supervising &#8230;<\/li>\n<li>Called HTML and Javascript and CSS (with the canvas element) <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html---------GETME' title='signature_signature.html' rel=\"noopener\">signature_signature.html<\/a> <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html---------GETME' title='signature_signature.html' rel=\"noopener\">changed this way<\/a> sharing canvas co-ordinates when a parent web application is interested in &#8220;rasterizations&#8221;, sometimes colourful<\/li>\n<\/ul>\n<hr>\n<p id='tplfet'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Editing Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-editing-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Editing Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Editing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas_ls_rasterise_font_edit.jpg\" title=\"Textarea Pointing Local Font Editing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Editing Tutorial<\/p><\/div>\n<p>A basic design, as presented in the first of the &#8220;Local Font&#8221; thread of blog postings called <a title='Textarea Pointing Local Font Tutorial' href='#tplft'>Textarea Pointing Local Font Tutorial<\/a> yesterday provided a blueprint to move forward on this project.  We think we can work with its architecture.  Did you notice how we differentiated the X co-ordinates as &#8220;Integers&#8221; (ie. counting numbers) and did not say that about the Y co-ordinates?  That&#8217;s because we want some flexibility down the track to be able to add some business logic somewhere, but try not to break the basic delimitation rules of the design, but more on that idea later.<\/p>\n<p>Today, we want to set about improving on aspects to the user experience (<a target=\"_blank\" title='UX information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/User_experience' rel=\"noopener\">UX<\/a>) of a user maintaining a &#8220;local font&#8221;.  How would it be if I said to you to use this piece of functionality you had to repeat a set of actions 128 (-34 nonprintable inapplicables) times to complete a font set, and could not come back in just to edit one of those 128 (-34 nonprintable inapplicables) characters.  I&#8217;d imagine you&#8217;d be pretty unimpressed.  By the end of today though &#8230;<\/p>\n<ul>\n<li>yes, you still should complete, once, those 128 (-34 nonprintable inapplicables) font characters, to complete a &#8220;local font&#8221; character set (of data captures) &#8230; but &#8230;<\/li>\n<li>as we say, &#8220;just the once&#8221; &#8230; and &#8230;<\/li>\n<li>a set that has only one character defined can still be <i>worked with<\/i> (and yes, we&#8217;ll be getting to <i>that<\/i> in future tutorials), before you visit all\/some of those 128 (-34 nonprintable inapplicables) characters &#8230; this blog post is hereby dedicated to <a target=\"_blank\" title=\"Alice's Restaurant\" href=\"https:\/\/www.youtube.com\/watch?v=m57gzA2JCcM\" rel=\"noopener\">Alice&#8217;s Restaurant<\/a> &#8230;<\/li>\n<li>any one font character edit (out of those 128 (-34 nonprintable inapplicables)) can have old attempts &#8220;Retained&#8221; (where you see that old attempt, and add your new &#8220;scribble&#8221; data to that old attempt, as required) or &#8220;Cleared&#8221; (in order to start again) &#8230; as new HTML <a target=\"_blank\" title='HTML a tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_a.asp' rel=\"noopener\"><i>a<\/i><\/a> tags added into our new &#8220;local font&#8221; menu <a target=\"_blank\" title='HTML table tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_table.asp' rel=\"noopener\"><i>table<\/i><\/a><\/li>\n<li>the user (has a mechanism now whereby they) can choose to now wipe the slate clean for a whole &#8220;local font&#8221; name of their choosing, and start again with it, as required<\/li>\n<\/ul>\n<p>In order to achieve that second last idea, we needed to set up more &#8220;interplay&#8221; (such as making the <i>nocookies=<\/i> URL argument be able to contain the pen up\/pen down instructions for an old attempt at the font character in question, as needed, and if not, signal a &#8220;Cleared&#8221; scenario) among &#8230;<\/p>\n<ul>\n<li>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to allow for these new local &#8220;Font Creation&#8221; canvas editing functionalities &#8230; supervising &#8230;<\/li>\n<li>Called HTML and Javascript and CSS (with the canvas element) <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html--------GETME' title='signature_signature.html' rel=\"noopener\">signature_signature.html<\/a> <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html--------GETME' title='signature_signature.html' rel=\"noopener\">changed this way<\/a> sharing canvas co-ordinates when a parent web application is interested in &#8220;rasterizations&#8221; &#8230; and calling &#8230;<\/li>\n<li>External Javascript called <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.js-------------------------------GETME' title='signature_signature.js' rel=\"noopener\">signature_signature.js<\/a> <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.js-------------------------------GETME' title='signature_signature.js' rel=\"noopener\">changed this way<\/a> regarding stopping localStorage and HTTP Cookie logic within its usual logic (collecting people&#8217;s signatures, that is, and more had to change regarding its workings for &#8220;local font&#8221; work)<\/li>\n<\/ul>\n<p>Hopefully this improves the web application, as far as the user using it goes.  This may all sound pretty obvious, but often it is not easy to arrange to improve these aspects to your applications.  It tends to matter (or not) on a case by case basis.<\/p>\n<hr>\n<p id='tplft'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Local Font Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-local-font-tutorial\/' rel=\"noopener\">Textarea Pointing Local Font Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Local Font Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas_ls_rasterise_font.jpg\" title=\"Textarea Pointing Local Font Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Local Font Tutorial<\/p><\/div>\n<p>A large part of the design of a web application relates to the agreed message formats.  Yesterday&#8217;s <a title='Textarea Pointing Rasterise Tutorial' href='#tprt'>Textarea Pointing Rasterise Tutorial<\/a> started us down the road of a new message format whose delimitation highlights goes like an <a target=\"_blank\" title='Javascript encodeURIComponent method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_encodeURIComponent.asp' rel=\"noopener\">encodeURIComponent<\/a>() version of &#8230;<\/p>\n<p><code><br \/>\n{header}:[{startIntegerCoord}.{Red3Digits}{Green3Digits}{Blue3Digits}{Another3Digits}[,{nonStartIntegerCoords}*][;{startIntegerCoord}.{Red3Digits}{Green3Digits}{Blue3Digits}{Another3Digits}[,{nonStartIntegerCoords}*]*]*]<br \/>\n<\/code><\/p>\n<p> &#8230; where in general terms &#8220;,&#8221; is &#8220;pen down&#8221; and &#8220;;&#8221; is &#8220;pen up&#8221; (and &#8220;:&#8221; separates a {header} from &#8220;the rest&#8221;), and in yesterday&#8217;s thoughts &#8230;<\/p>\n<p><code><br \/>\n{header} consists of {dataLength}.{numberOfPixelsInOneRowWidth}<br \/>\n<\/code><\/p>\n<p> &#8230; and because of this, these message types stand alone (important when designing a message format) in that any one {startIntegerCoord} or any of {nonStartIntegerCoords} could get an (x,y) co-ordinate set be defined via (for the case of {startIntegerCoord}) &#8230;<\/p>\n<p><code><br \/>\nx = ({startIntegerCoord} % {numberOfPixelsInOneRowWidth})<br \/>\ny = (({startIntegerCoord} - x) \/ {numberOfPixelsInOneRowWidth})<br \/>\n<\/code><\/p>\n<p>But we&#8217;ve digressed a little from today&#8217;s &#8220;Textarea Pointing Local Font Tutorial&#8221; topic haven&#8217;t we?  Well, not entirely, because the messages used to define our &#8220;local fonts&#8221; (yes, we are setting about a system of defining fonts local to other web applications on the same domain using [canvasContext].strokeText() or [canvasContext].fillText() (if we are interested), the storage means being as a few tutorials ago &#8230;<\/p>\n<blockquote>\n<ul>\n<li>a fully blown <a target=\"_blank\" title='Database information from Wikipedia' href='https:\/\/en.wikipedia.org\/wiki\/Database' rel=\"noopener\">database<\/a> solution &#8230; too much &#8230;<\/li>\n<li>HTTP <a target=\"_blank\" title='Cookie information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/HTTP_cookie' rel=\"noopener\">Cookies<\/a> &#8230; too little &#8230;<\/li>\n<li>HTML5 <a target=\"_blank\" title='Web Storage information from w3schools' href='https:\/\/www.w3schools.com\/html\/html5_webstorage.asp' rel=\"noopener\">Web Storage<\/a> localStorage &#8230; just right<\/li>\n<\/ul>\n<\/blockquote>\n<p> &#8230; hence the encodeURIComponent() bit to the blurb above) &#8230; will base themselves on the same delimitation rules, but it&#8217;s just that, with &#8220;local font&#8221; messaging &#8230;<\/p>\n<p><code><br \/>\n{header} is {nameOfYourLocalFont}<br \/>\n<\/code><\/p>\n<p> &#8230; and that will not start with a number <font size=1>&#8230; now will it, &#8220;compliant user&#8221;? &#8230;<\/font> so the logic should be able to categorize logic for those via &#8230;<\/p>\n<p><code><br \/>\n{header}:[{startIntegerXCoord}.{Red3DigitsIsZero}{Green3DigitsIsZero}{Blue3DigitsIsZero}{asciiCharacterCodeIn3Digits}[,{startYCoord}]][{,{nonStartIntegerXCoord},{nonStartYCoord}}*][{;{penUpIntegerXCoord},{penUpYCoord}}*][{,{nonStartIntegerXCoord},{nonStartYCoord}}*]*]*]<br \/>\n<\/code><\/p>\n<p>It&#8217;s in our thinking to capture these co-ordinates via any\/both of &#8230;<\/p>\n<ol>\n<li><a target=\"_blank\" title='HTML textarea tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_textarea.asp' rel=\"noopener\">textarea<\/a><\/li>\n<li><b><a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">canvas<\/a><\/b><\/li>\n<\/ol>\n<p> &#8230; but for today&#8217;s progress, <b>just canvas<\/b> work in an HTML iframe channeling our <a target=\"_blank\" title='Signature Signature Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/signature-signature-primer-tutorial\/' rel=\"noopener\">Signature Signature Primer Tutorial<\/a>&#8216;s &#8220;Signature of Signature&#8221; (hard working &#8220;duck&#8221; web application) examined <font size=1>&#8230; you guessed it &#8230;<\/font> via a <a target=\"_blank\" title='Client pre-emptive iframe' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=pre-emptive' rel=\"noopener\">&#8220;client pre-emptive iframe&#8221;<\/a> determination of its existence.  We limit the height and width of that HTML iframe to reflect the height and width of a font character, but bear with us if the size of this changes a bit over time.  We&#8217;ll see.  The iframe starts in &#8220;scribble&#8221; data capture mode, reflecting you creating your own unique font character versions, hence the &#8220;local font&#8221; concept. <\/p>\n<p>In summary, codewise &#8230;<\/p>\n<ul>\n<li>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-----GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">changed this way<\/a> to allow for these new local &#8220;Font Creation&#8221; (initially via canvas) logics available as (non default) options off an HTML select element dropdown (hived off the web application H1 title) &#8230; supervising, newly &#8230;<\/li>\n<li>Called HTML and Javascript and CSS (with the canvas element) <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html-------GETME' title='signature_signature.html' rel=\"noopener\">signature_signature.html<\/a> <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.html-------GETME' title='signature_signature.html' rel=\"noopener\">changed this way<\/a> sharing canvas co-ordinates when a parent web application is interested in &#8220;rasterizations&#8221; &#8230; and calling &#8230;<\/li>\n<li>External Javascript called <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.js------------------------------GETME' title='signature_signature.js' rel=\"noopener\">signature_signature.js<\/a> <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/signature_signature.js------------------------------GETME' title='signature_signature.js' rel=\"noopener\">changed this way<\/a> regarding stopping localStorage and HTTP Cookie logic within its usual logic (collecting people&#8217;s signatures, that is)<\/li>\n<\/ul>\n<hr>\n<p id='tprt'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Rasterise Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-rasterise-tutorial\/' rel=\"noopener\">Textarea Pointing Rasterise Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Rasterise Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas_ls_rasterise.jpg\" title=\"Textarea Pointing Rasterise Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Rasterise Tutorial<\/p><\/div>\n<p>Following up on yesterday&#8217;s <a title='Textarea Pointing Web Storage Tutorial' href='#tpwst'>Textarea Pointing Web Storage Tutorial<\/a> and <a title='Textarea Pointing Canvas Tutorial' href='#tpct'>Textarea Pointing Canvas Tutorial<\/a> preceeding it, we have the means now to embellish the reporting functionalities surrounding the use of HTML5 <a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">canvas<\/a> element, and two extremely useful (and fundamental) &#8230;<\/p>\n<ul>\n<li>[canvasContext].<a target=\"_blank\" title='Canvas methods information from W3schools' href='https:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">getImageData<\/a>() &#8230; to derive pixel information via canvas &#8230; and (it&#8217;s what you do in the middle here that is the most impactive &#8230; we do <i>inversing colours<\/i> and <i>grayscale<\/i> manipulations via pixel changes here, in between) &#8230;<\/li>\n<li>[canvasContext].putImageData() &#8230; to place pixel information into canvas<\/li>\n<\/ul>\n<p> &#8230; and you&#8217;ve also got the more geometrically based &#8230;<\/p>\n<ul>\n<li>[canvasContext].<a target=\"_blank\" title='Canvas methods information from W3schools' href='https:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">translate<\/a>()<\/li>\n<li>[canvasContext].scale()<\/li>\n<li>[canvasContext].rotate()<\/li>\n<\/ul>\n<p> &#8230; do what they say, to create new image conversions for our (central) canvas element.<\/p>\n<p>But of more interest, today, at least for us, is us starting down that &#8220;reverse route&#8221; of scanning (post &#8220;blobbing&#8221;).  Even though two days ago we said &#8230;<\/p>\n<blockquote><p>\nThis is all great, but that&#8217;s it, unless you want to run that image data back through an intelligent scanning process to try to regain the &#8220;character data&#8221;?  Some scanners do this, but do you really think you are going to continue getting a good result that way forever?  We say, hang on to data in rawer forms and resolutions until the very last minute, and only go to these very well programmed for &#8220;graphical&#8221; forms (of final reporting) for your final reporting, or if you know that only that &#8220;blobby&#8221; &#8220;graphical&#8221; form is all that&#8217;s required anyway.   If so, think about using HTML canvas from the start.  It&#8217;s data capture capabilities, as we at this blog <a target=\"_blank\" title='Canvas bog posts at this blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/canvas' rel=\"noopener\">have been at pains<\/a> to point out for a long time now, are also excellent.\n<\/p><\/blockquote>\n<p> &#8230; we couldn&#8217;t resist while we had the opportunity in code in between &#8230;<\/p>\n<ul>\n<li>[canvasContext].getImageData() &#8230; to derive pixel information via canvas &#8230; and &#8230;<\/li>\n<li>[canvasContext].putImageData() &#8230; to place pixel information into canvas<\/li>\n<\/ul>\n<p> &#8230; to read canvas pixels and we &#8220;Re-stringify&#8221; or (we label it) &#8220;Rasterise&#8221; the data to create the slightly shaky (but we may be able to improve it) first goes at re-scanning already &#8220;blobbed&#8221; out &#8220;graphics&#8221; data &#8230; just to see how far all this is feasible?!  We need more work retaining non black and white colours, and we&#8217;ll let you know more about that as time goes on, but in the meantime &#8230;<\/p>\n<p>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-----GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">canvas manipulation changes<\/a> and <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html------GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">rasterisation changes<\/a> helped out with these canvas based manipulations, and called into play <a target=\"_blank\" title='Client pre-emptive iframe' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=pre-emptive' rel=\"noopener\">&#8220;client pre-emptive iframe&#8221;<\/a> determinations of whether <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/pixellate.php------------GETME\" title=\"pixellate.php\" rel=\"noopener\">the changes needed to integrate<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/pixellate.php------------GETME\" title=\"pixellate.php\" rel=\"noopener\">pixellate.php<\/a>&#8216;s GD Image Manipulations at the Pixel Level we last talked about with <a target=\"_blank\" title='PHP GD Image at Pixel Level Animation Rotation Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-gd-image-at-pixel-level-animation-rotation-tutorial\/' rel=\"noopener\">PHP GD Image at Pixel Level Animation Rotation Tutorial<\/a> can take us further down the &#8220;pixellated&#8221; road of discovery <font size=1>swear, &#8216;guv, it was only lemonade in that there flask<\/font>.<\/p>\n<hr>\n<p id='tpwst'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Web Storage Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-web-storage-tutorial\/' rel=\"noopener\">Textarea Pointing Web Storage Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Web Storage Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas_ls.jpg\" title=\"Textarea Pointing Web Storage Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Web Storage Tutorial<\/p><\/div>\n<p>We add some &#8220;accountability&#8221; to where we stopped off at yesterday with <a title='Textarea Pointing Canvas Tutorial' href='#tpct'>Textarea Pointing Canvas Tutorial<\/a> today.  We define &#8220;accountability&#8221; in this context, and with our rules, short of bothering with &#8230;<\/p>\n<ul>\n<li>a fully blown <a target=\"_blank\" title='Database information from Wikipedia' href='https:\/\/en.wikipedia.org\/wiki\/Database' rel=\"noopener\">database<\/a> solution &#8230; too much &#8230;<\/li>\n<li>HTTP <a target=\"_blank\" title='Cookie information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/HTTP_cookie' rel=\"noopener\">Cookies<\/a> &#8230; too little &#8230;<\/li>\n<li>HTML5 <a target=\"_blank\" title='Web Storage information from w3schools' href='https:\/\/www.w3schools.com\/html\/html5_webstorage.asp' rel=\"noopener\">Web Storage<\/a> localStorage &#8230; just right<\/li>\n<\/ul>\n<p>Porridge is served!  How to make this decision?  To us, it goes by &#8220;permanence factor&#8221; (database really good) and &#8220;data size requirements&#8221; (and today we store the whole <i>innerHTML<\/i> of the HTML form that encompasses all our &#8220;textarea posse&#8221; and this is far too much for HTTP Cookies &#8230; so HTML5 localStorage is <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=RCldiADPDEM' rel=\"noopener\">our decision<\/a>).<\/p>\n<p>There are these aspects to doing this &#8230;<\/p>\n<ul>\n<li>in the menu section of the webpage have one select element id=ssaveas (dropdown) (with an initial option element labelled &#8220;Fill in Save As or choose&#8221;) and one input type=text element<\/li>\n<li>at document.body onload event look through localStorage &#8230; as per the Javascript &#8230;<br \/>\n<code><br \/>\n    if (window.localStorage) {<br \/>\n     for (var iq in window.localStorage) {<br \/>\n      val = localStorage.getItem(iq);<br \/>\n      if (val) {<br \/>\n       if (iq.substring(0,3) == 'tp_') {<br \/>\n        document.getElementById('ssaveas').innerHTML+='&lt;option value=\"' + iq.substring(3) + '\"&gt;Recall \"' + iq.substring(3) + '\"&lt;\/option&gt;';<br \/>\n       }<br \/>\n      }<br \/>\n     }<br \/>\n    }<br \/>\n<\/code><br \/>\n &#8230; to further populate, as necessary, the dropdown, that has &#8230;\n<\/li>\n<li>onchange event for select element dropdown reads localStorage &#8230; as per Javascript (for var<font size=1>iable<\/font> <i>newo<\/i> being that webpage snapshot&#8217;s name) &#8230; as entered by user &#8230;<br \/>\n<code><br \/>\n    if (localStorage) {<br \/>\n     if (localStorage.getItem('tp_' + newo)) {<br \/>\n       var bih=decodeURIComponent(localStorage.getItem('tp_' + newo));<br \/>\n       document.getElementById('myform').innerHTML=bih;<br \/>\n     }<br \/>\n    }<br \/>\n<\/code>\n<\/li>\n<li>at onblur event of the input type=text element &#8230; Javascript (for var<font size=1>iable<\/font> <i>newo<\/i> being that webpage snapshot&#8217;s name and  var<font size=1>iable<\/font> <i>hcont<\/i> is the HTML code for a &#8220;New Window&#8221; scenario) as per &#8230;<br \/>\n<code><br \/>\n if (newo != '') {<br \/>\n    if (localStorage) {<br \/>\n     if (localStorage.getItem('tp_' + newo)) {<br \/>\n       localStorage.removeItem('tp_' + newo);<br \/>\n     }<br \/>\n     var bbit='m' + hcont.split('&lt;f' + 'orm')[1].split('&gt;')[0] + '&gt;';<br \/>\n     localStorage.setItem('tp_' + newo, encodeURIComponent(hcont.split('&lt;fo' + 'r')[1].replace(bbit,'').split('&lt;\/f' + 'orm&gt;')[0]));<br \/>\n     document.getElementById('ssaveas').innerHTML+='&lt;option value=\"' + newo + '\"&gt;Recall \"' + newo + '\"&lt;\/option&gt;';<br \/>\n    }<br \/>\n }<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html----GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html----GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">code changes<\/a> were all clientside, like yesterday&#8217;s work.<\/p>\n<p>Accountability food for thought, we hope?!<\/p>\n<hr>\n<p id='tpct'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Canvas Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-canvas-tutorial\/' rel=\"noopener\">Textarea Pointing Canvas Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Canvas Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf_canvas.jpg\" title=\"Textarea Pointing Canvas Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Canvas Tutorial<\/p><\/div>\n<p>With our blog posting thread last left off with yesterday&#8217;s <a title='Textarea Pointing PDF Tutorial' href='#tppdft'>Textarea Pointing PDF Tutorial<\/a>, I know we&#8217;ve been holding out on involving &#8230;<\/p>\n<ul>\n<li>graphical data forms<\/li>\n<li><a target=\"_blank\" title='HTML img element information from w3schools' href='https:\/\/www.w3schools.com\/tags\/tag_img.asp' rel=\"noopener\">image<\/a> data<\/li>\n<li>HTML5 <a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">canvas<\/a> element<\/li>\n<li><a target=\"_blank\" title='Data URL (or Data URI) information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Data_URI_scheme' rel=\"noopener\">data URI<\/a><\/li>\n<\/ul>\n<p> &#8230; not for &#8220;nga, nga, nga nga, nga&#8221; reasons, but because we want to show that the starting out with &#8220;textarea character data&#8221; sets is a useful layer of information that can sit on top and easily pass onto these (last two above in particular) functionalities above in optional reporting modes of use, but still keep that &#8220;textual context&#8221; in place as well.  Win, win, we&#8217;d say.<\/p>\n<p>However, on non-mobile web browsers in particular, you&#8217;ve got to appreciate how the modern browsers interface to <i>canvas<\/i> elements and <i>image<\/i> data (which can be derived from that <i>canvas<\/i> element by the oft mentioned [canvasElement].<a target=\"_blank\" title='HTML5 canvas element toDataURL method information' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLCanvasElement\/toDataURL' rel=\"noopener\">toDataURL<\/a>() method) with a myriad of right click (Windows or two finger gesture on Mac OS X) options, our favourites of which are &#8230;<\/p>\n<ul>\n<li>image &#8211; Open Image in New Tab (or Window)<\/li>\n<li>image &#8211; Save Image to Desktop<\/li>\n<li>image &#8211; Save Image As&#8230;<\/li>\n<li>image &#8211; Copy Image<\/li>\n<li>image &#8211; Share Mail (to client email (ie. your own email address is &#8220;From&#8221; email address) as image attachment)<\/li>\n<li>image &#8211; Share Message<\/li>\n<li>canvas &#8211; Save Page as Web Archive<\/li>\n<li>canvas &#8211; Print Page&#8230; Open PDF in PDF Reader<\/li>\n<li>canvas &#8211; Print Page&#8230; Save As PDF<\/li>\n<li>canvas &#8211; Print Page&#8230; Save As PostScript<\/li>\n<li>canvas &#8211; Print Page&#8230; Mail PDF (to client email (ie. your own email address is &#8220;From&#8221; email address) with a PDF attachment)<\/li>\n<\/ul>\n<p> &#8230; so much so that we just want all this clientside (no PHP serverside &#8220;anything&#8221; today) to wash over you with your mind &#8220;swimming&#8221; with possibilities, perhaps?!<\/p>\n<p>Take a look at today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html---GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> HTML and Javascript (DOM) and CSS code changed <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html---GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">this way<\/a> as all that needed to change to involve canvas and image data and data URIs in our Textarea Pointing project.<\/p>\n<p>If there is no serverside &#8220;anything&#8221; going on, what is the &#8220;glue&#8221; that holds all this clientside interfacing together?  These days, more and more, it is the use of <a target=\"_blank\" title='Data URL (or Data URI) information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Data_URI_scheme' rel=\"noopener\">data URI<\/a> portable data that can be used in, just with today&#8217;s work &#8230;<\/p>\n<ul>\n<li>HTML img element src attribute<\/li>\n<li>HTML img element style attribute background URL(data URI)<\/li>\n<\/ul>\n<p>This is all great, but that&#8217;s it, unless you want to run that image data back through an intelligent scanning process to try to regain the &#8220;character data&#8221;?  Some scanners do this, but do you really think you are going to continue getting a good result that way forever?  We say, hang on to data in rawer forms and resolutions until the very last minute, and only go to these very well programmed for &#8220;graphical&#8221; forms (of final reporting) for your final reporting, or if you know that only that &#8220;blobby&#8221; &#8220;graphical&#8221; form is all that&#8217;s required anyway.   If so, think about using HTML canvas from the start.  It&#8217;s data capture capabilities, as we at this blog <a target=\"_blank\" title='Canvas bog posts at this blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/canvas' rel=\"noopener\">have been at pains<\/a> to point out for a long time now, are also excellent.<\/p>\n<p>Another Paul Kelly song <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=6_ndC07C2qw' rel=\"noopener\">seems apt<\/a>!<\/p>\n<hr>\n<p id='tppdft'>Previous relevant <a target=\"_blank\" title='Textarea Pointing PDF Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-pdf-tutorial\/' rel=\"noopener\">Textarea Pointing PDF Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing PDF Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing_email_pdf.jpg\" title=\"Textarea Pointing PDF Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing PDF Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Textarea Pointing Email Tutorial' href='#tpet'>Textarea Pointing Email Tutorial<\/a> was a start to our &#8220;sharing&#8221; functionality &#8220;push&#8221; with our new Textarea Pointing project.  That work involved &#8230;<\/p>\n<ul>\n<li>(new window) with menu<\/li>\n<li>(new window) without menu<\/li>\n<li>email with HTML attachment &#8230; and today we add to that &#8230;<\/li>\n<li><b>email with <a target=\"_blank\" title='Portable document format (PDF) information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Portable_Document_Format' rel=\"noopener\">PDF<\/a> attachment &#8230; as well as &#8230;<\/b><\/li>\n<li><b>PDF download to client device<\/b><\/li>\n<li><b>PDF display via default client PDF viewer<\/b><\/li>\n<\/ul>\n<p> &#8230; that required, again, <a target=\"_blank\" title='Linux diff PDF Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-diff-pdf-tutorial\/' rel=\"noopener\">Linux diff PDF Tutorial<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php---GETME\" rel=\"noopener\">prediff.php<\/a> PHP code integration <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php---GETME\" rel=\"noopener\">in this changed way<\/a>.  This time, though, rather than <i>$outputpdf-&gt;Cell($x, $y, $line_of_text);<\/i> being the best <a target=\"_blank\" title='Fpdf PHP class' href='http:\/\/www.fpdf.org\/' rel=\"noopener\">Fpdf<\/a> means of displaying of the PDF text, we found &#8230;<\/p>\n<p><code><br \/>\n$outputpdf-&gt;Text($x, $y, $line_of_text);<br \/>\n<\/code><\/p>\n<p> &#8230; to be more applicable to programming like for the way vinyl records work with their stylus, in other words, at a given &#8230;<\/p>\n<ul>\n<li><font size=1>HTML textarea element (x,y)<\/font> <b>position<\/b> &#8230; we gather &#8230;<\/li>\n<li><font size=1>HTML textarea element<\/font> <b>font information<\/b> <font size=1>stored in the <i>alt<\/i> attribute<\/font> &#8230; to place text &#8230;<\/li>\n<li><font size=1>to be able to<\/font> &#8230;<br \/>\n<b>$outputpdf-&gt;SetFont($fontFamily, $fontStyle, $fontSize);<br \/>\n$outputpdf-&gt;SetTextColor($fontColR, $fontColG, $fontColB);<br \/>\n$outputpdf-&gt;Text($x, $y, $line_of_text);<\/b>\n<\/li>\n<\/ul>\n<p> &#8230; as the &#8220;work of the code&#8221; needed to transition from our &#8220;user capture with character data&#8221; (in the &#8220;textarea&#8221;s) to a graphical system (or <a target=\"_blank\" title='Widget information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Software_widget' rel=\"noopener\">&#8220;widget&#8221;<\/a>, you might like to think of this as).  It just so happens that the first (graphical) &#8220;widget&#8221; design of interest is the creation of PDF, as it is a good conduit between &#8220;character data&#8221; and a &#8220;graphical look&#8221;.  A &#8220;widget&#8221; feeling thing being what it is though, expect more integrations to come, as time goes on!<\/p>\n<p>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html--GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> code changed <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html--GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">this way<\/a>.<\/p>\n<hr>\n<p id='tpet'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Email Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-email-tutorial\/' rel=\"noopener\">Textarea Pointing Email Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Email Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/textarea_pointing_email.jpg\" title=\"Textarea Pointing Email Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Email Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Textarea Pointing Primer Tutorial' href='#tppt'>Textarea Pointing Primer Tutorial<\/a> was a little too localised in its application in our books.  Not if a web application is not of generic use, but this one could be of generic use, in our <strike>pamphlettes<\/strike> books.<\/p>\n<p>Our favourite &#8220;sharing&#8221; idea is email, by far, as today, as far as that goes, we are going to offer email &#8220;services&#8221; via a <a target=\"_blank\" title='Client pre-emptive iframe' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=pre-emptive' rel=\"noopener\">&#8220;client pre-emptive iframe&#8221;<\/a> determination of whether where you have placed today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.htm\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">textarea_pointing.htm<\/a> code (changed <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html-GETME\" title=\"textarea_pointing.htm\" rel=\"noopener\">this way<\/a>) has, relative to it, an existant <i>..\/PHP\/Geographicals\/prediff.php<\/i> PHP code source (that we left to go on our Textarea Pointing project) of <a target=\"_blank\" title='Linux diff PDF Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-diff-pdf-tutorial\/' rel=\"noopener\">Linux diff PDF Tutorial<\/a> (<a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php\" rel=\"noopener\">live run<\/a>&#8216;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php--GETME\" rel=\"noopener\">prediff.php<\/a> PHP code&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/prediff.php--GETME\" rel=\"noopener\">last changes<\/a> were used to cater for the Textarea Pointing HTML email attachment requirement).<\/p>\n<p>We like to use a &#8220;client pre-emptive iframe&#8221; technique initial check for whether the HTML finds <i>prediff.php<\/i> because the email functionality is optional after all.  If <i>prediff.php<\/i> is not found, then the Email button is never shown, simple as that.  But the other two displays of the HTML in new popup windows &#8230;<\/p>\n<ul>\n<li>with menu<\/li>\n<li>without menu &#8230; as well as &#8230;<\/li>\n<li>email with HTML attachment<\/li>\n<\/ul>\n<p> &#8230; complete the scope of the new &#8220;Sharing&#8221; functionalities today, and this year, on this!<\/p>\n<p>So &#8230; <font size=9>Happy New Year!<\/font><\/p>\n<hr>\n<p id='tppt'>Previous relevant <a target=\"_blank\" title='Textarea Pointing Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-pointing-primer-tutorial\/' rel=\"noopener\">Textarea Pointing Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Textarea Pointing Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/\/HTMLCSS\/textarea_pointing.jpg\" title=\"Textarea Pointing Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Textarea Pointing Primer Tutorial<\/p><\/div>\n<p>Completely new idea today, so hoping this does not put some of you &#8220;episodic&#8221; users off.  <font size=1>We&#8217;ll get back to incomplete recent &#8220;threads&#8221; at a later date.<\/font>  This is because we had pause for thought, due to yesterday&#8217;s <a target=\"_blank\" title='Linux diff PDF Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-diff-pdf-tutorial\/' rel=\"noopener\">PDF textual data positioning work<\/a>, regarding <b>one<\/b> of our favourite HTML fundamental element types of interest (that we are always comparing) &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='HTML div information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp' rel=\"noopener\">div<\/a><\/li>\n<li><a target=\"_blank\" title='HTML textarea information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_textarea.asp' rel=\"noopener\"><b>textarea<\/b><\/a><\/li>\n<\/ul>\n<p>To quote <a target=\"_blank\" title='HTML Textarea and Div Talents Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-textarea-and-div-talents-primer-tutorial\/' rel=\"noopener\">HTML Textarea and Div Talents Primer Tutorial<\/a> (as it was addressing the <b>textarea<\/b> HTML element) &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-textarea-and-div-talents-primer-tutorial\/'>\n<p>It&#8217;s crucial for getting HTML or non-caretted Text (that is internally turned into HTML behind the scenes) &#8230; via those <a target=\"_blank\" title='Excel Online Spreadsheet Monthly Planner Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/excel-online-spreadsheet-monthly-planner-primer-tutorial\/' rel=\"noopener\">wonderful<\/a> <a target=\"_blank\" title='Tab navigation button or panel information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Tab_(GUI)' rel=\"noopener\">tabs<\/a> &#8230; off the user and onto the MySql database, and then out to the client user as part of a webpage.  Out at that webpage, though, we&#8217;ve no doubt this content is embedded in an HTML <a target=\"_blank\" title='HTML div tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_div.asp' rel=\"noopener\">div<\/a> element, the other &#8220;talent&#8221; here.<\/p>\n<p><\/p>\n<p>But their strengths and weaknesses go like this, at least to us, in the limited HTML text view of things &#8230;<\/p>\n<p><\/p>\n<table border=\"100\">\n<tbody>\n<tr>\n<th>Text Functionality Issue<\/th>\n<th>HTML Element Type<\/th>\n<th>Strength<\/th>\n<th>Weakness (where a \u201cYes\u201d is like \u2026 \u201cOh No!\u201d)\n<\/th>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Display Monocolour Text<\/td>\n<td>Textarea\n<\/td>\n<td>Yes<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Div\n<\/td>\n<td>Yes<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Display Editable Text<\/td>\n<td>Textarea\n<\/td>\n<td>Yes<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Div\n<\/td>\n<td><\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Display Multicolour Text<\/td>\n<td>Textarea\n<\/td>\n<td><\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Div\n<\/td>\n<td>Yes<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/blockquote>\n<p>Nothing there above gives much encouragement about the HTML <b>textarea<\/b>&#8216;s &#8220;positioning&#8221; talents.  But what if we were to create a <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=-kbTbg00AJU' rel=\"noopener\">&#8220;posse&#8221;<\/a>, or perhaps a <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=zgywD3XJaWU' rel=\"noopener\">&#8220;phalanx&#8221;<\/a>, of <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=wIrHAa0WljQ' rel=\"noopener\">&#8220;textarea&#8221;<\/a>s to bank up with &#8220;bits and pieces&#8221; of the positioning <i>&#8220;issue&#8221;<\/i> (under the auspices of an HTML <a target=\"_blank\" title='HTML form information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_form.asp' rel=\"noopener\">form<\/a> element, for later accountability)?<\/p>\n<p>What do we mean by <i>&#8220;issue&#8221;<\/i> here?  Well, something like a letter, as with the end product of a scanning process involving a hardcopy letter, is that much more useful if what we end up with is the &#8220;characters&#8221; that go to make up that letter (or report, or essay), not some graphic (or totally visual) encapsulation of it, which can be what happens when you involve as your HTML &#8220;capture&#8221; element the <a target=\"_blank\" title='HTML Canvas element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp' rel=\"noopener\">&#8220;canvas&#8221;<\/a> element.  No, we want that &#8220;posse&#8221; of &#8220;textarea&#8221;s be that &#8220;character&#8221; source, which later, we can present as an overall graphic at a later date, for sharing purposes for instance, and maintain the &#8220;letter&#8221; (or report or essay) data continuously as the user edits.<\/p>\n<p>How to do?  We click\/touch with a base &#8220;textarea&#8221; and that is enough to arrange for an <a target=\"_blank\" title='Overlay blog postings here' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay' rel=\"noopener\">&#8220;overlay&#8221;<\/a> &#8220;textarea&#8221; (via CSS <a target=\"_blank\" title='CSS position:absolute information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_class_position.asp' rel=\"noopener\">position:absolute<\/a> and <a target=\"_blank\" title='CSS z-index information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_pos_z-index.asp' rel=\"noopener\">z-index<\/a> properties, some <a target=\"_blank\" title='CSS3 background-color information from w3schools' href='https:\/\/www.w3schools.com\/cssref\/pr_background-color.asp' rel=\"noopener\">background-color:transparent<\/a> styling, along with <i>div id=dscript<\/i> (innerHTML) appended dynamic CSS styling making use of CSS <a target=\"_blank\" title='CSS3 calc information' href='https:\/\/www.htmlgoodies.com\/html5\/css\/using-the-css3-calc-function.html' rel=\"noopener\">calc<\/a>&#8216;ing <i>&lt;style&gt; .mboard2 { width: calc(85% &#8211; 56px); } &lt;\/style&gt;<\/i> type syntax (where the <i>56px<\/i> would have been derived via the onclick event logic, the <i>85%<\/i> is to allow for a 15% width menu at the right, and the <i>2<\/i> in <i>mboard2<\/i> refers to the second <i>textarea<\/i> in question)) to follow (ironically an HTML div element is by far the best &#8220;container&#8221; in a (Javascript DOM controlled) <a target=\"_blank\" title='Linked list information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Linked_list' rel=\"noopener\">linked list<\/a> fashion for this, rather than appending to the HTML form element&#8217;s innerHTML (which seems to wipe out previous textarea values)), like a linked list of &#8220;textarea&#8221;s.  Along the way we allow for font information to be collected and kept as well (for now, via the <i>textarea<\/i>&#8216;s <a target=\"_blank\" title='HTML alt attribute information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_alt.asp' rel=\"noopener\"><i>alt<\/i><\/a> attribute), to add to the chances for variety with our overall &#8220;letter&#8221; (or report or essay) reporting end product.<\/p>\n<p>Which leaves us to talk about the &#8220;textarea pointing&#8221; <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html\" title=\"Click picture\" rel=\"noopener\">live run<\/a>&#8216;s underlying HTML and Javascript and CSS <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/textarea_pointing.html_GETME\" title=\"textarea_pointing.html\" rel=\"noopener\">textarea_pointing.html<\/a> code for your perusal.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35213' onclick='var dv=document.getElementById(\"d35213\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/textarea\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35213' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35258' onclick='var dv=document.getElementById(\"d35258\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/email\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35258' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35275' onclick='var dv=document.getElementById(\"d35275\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/pdf\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35275' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35305' onclick='var dv=document.getElementById(\"d35305\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/canvas\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35305' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35327' onclick='var dv=document.getElementById(\"d35327\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/web-storage\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35327' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35347' onclick='var dv=document.getElementById(\"d35347\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/rotate\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35347' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35361' onclick='var dv=document.getElementById(\"d35361\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/font\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35361' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35398' onclick='var dv=document.getElementById(\"d35398\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/ux\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35398' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35417' onclick='var dv=document.getElementById(\"d35417\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/colour\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35417' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35427' onclick='var dv=document.getElementById(\"d35427\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/onkeyup\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35427' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35449' onclick='var dv=document.getElementById(\"d35449\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/paste\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35449' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35474' onclick='var dv=document.getElementById(\"d35474\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dropdown\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35474' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35520' onclick='var dv=document.getElementById(\"d35520\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/onkeydown\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35520' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d65303' onclick='var dv=document.getElementById(\"d65303\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/shadow\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65303' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d65560' onclick='var dv=document.getElementById(\"d65560\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/onkeyup\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d65560' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Our fascination with the HTML textarea element (well, you had to be there) continues further to some ideas at Textarea and Div Box Shadow Primer Tutorial recently. Today&#8217;s interest is to do with a piece of functionality, that as a &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/textarea-content-masking-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2698,1824,3175,400,576,652,673,2533,751,3973,1812,2687,997,1254,1262,1319],"class_list":["post-65560","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-carriage-return","tag-character","tag-character-set","tag-event","tag-html","tag-javascript","tag-keyboard","tag-line-feed","tag-mask","tag-masking","tag-onkeyup","tag-pattern","tag-programming","tag-text","tag-textarea","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65560"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=65560"}],"version-history":[{"count":9,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65560\/revisions"}],"predecessor-version":[{"id":65569,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/65560\/revisions\/65569"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=65560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=65560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=65560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}