{"id":61982,"date":"2023-12-14T03:01:59","date_gmt":"2023-12-13T17:01:59","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=61982"},"modified":"2023-12-14T10:54:09","modified_gmt":"2023-12-14T00:54:09","slug":"angled-text-tool-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/angled-text-tool-primer-tutorial\/","title":{"rendered":"Angled Text Tool Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/angled_text_helper_tool.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Angled Text Tool Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/angled_text_helper_tool.jpg\" title=\"Angled Text Tool Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">Angled Text Tool Primer Tutorial<\/p><\/div>\n<p>Buoyed by our new found confidence in [element].<a target=_blank title='getBoundingClientRect' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Element\/getBoundingClientRect'>getBoundingClientRect<\/a>() when dealing with rotated text, in the clientside Javascript realm of proceedings, as we talked about with yesterday&#8217;s <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/google-chart-image-chart-angled-text-annotation-tutorial\/' title='Google Chart Image Chart Angled Text Annotation Tutorial'>Google Chart Image Chart Angled Text Annotation Tutorial<\/a>, today, we&#8217;re writing a new, and so far pretty simple &#8230;<\/p>\n<p><code><br \/>\nAngled Text Helper Tool<br \/>\n<\/code><\/p>\n<p> &#8230; and we&#8217;re hoping over time, perhaps it can deserve that moniker &#8220;tool&#8221; for some readers and users out there!  We hope so.<\/p>\n<p>What&#8217;s hard about angled text, leaving aside any &#8220;trying to fit in with PHP <a target=_blank title='GD and Image Functions' href='http:\/\/php.net\/manual\/en\/ref.image.php'>GD<\/a> <a target=_blank title='PHP GD imagettftext' href='https:\/\/www.php.net\/manual\/en\/function.imagettftext.php'>imagettftext<\/a> interfacing&#8221;?  For us, it&#8217;s that rotations, by default, happen in the middle of text, but that &#8220;middle of text&#8221; is not a data point collected naturally for an HTML element ( though is derivable, <a target=_blank title=? href='https:\/\/www.youtube.com\/watch?v=e9_7GcQeiqw&#038;t=2m37s'>again<\/a>, via [element].getBoundingClientRect() ) meaning &#8230;<\/p>\n<ul>\n<li>for angled text it is hard to &#8220;sidle up&#8221; to something easily &#8230; and &#8230;<\/li>\n<li>for angled text it is hard to &#8220;snugly fit it in&#8221; within a containing something easily<\/li>\n<\/ul>\n<p>Our proof of concept <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/angled_text_helper_tool.html\">Angled Text Tool<\/a> throws it to the user to try to fit some rotated text snugly up into the top left corner of a webpage, supplying their own editable CSS, onto a raw HTML div element, where what is asked, so far, is &#8230;<\/p>\n<ul>\n<li>text itself &#8230; in a textarea element<\/li>\n<li>clockwise angle from horizontal in degrees angle &#8230; in an input type=number textbox &#8230;<\/li>\n<li>user CSS &#8230; to be applied to said HTML div &#8230; in a textbox &#8230;<\/li>\n<li>checkbox for whether to display a finishing &#8220;bounding box&#8221;<\/li>\n<\/ul>\n<p>Simple premise, but see how you go, trying our <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/angled_text_helper_tool.html_GETME\">&#8220;proof of concept&#8221; &#8220;first draft&#8221;<\/a> HTML and Javascript and CSS &#8220;would be&#8221; tool.<\/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='#d61982' onclick='var dv=document.getElementById(\"d61982\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/transform\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d61982' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Buoyed by our new found confidence in [element].getBoundingClientRect() when dealing with rotated text, in the clientside Javascript realm of proceedings, as we talked about with yesterday&#8217;s Google Chart Image Chart Angled Text Annotation Tutorial, today, we&#8217;re writing a new, and &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/angled-text-tool-primer-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,37],"tags":[3363,4597,4262,281,2208,576,652,3965,997,1071,4474,4598,1298,1300,1319],"class_list":["post-61982","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-angle","tag-angled-text","tag-containing","tag-css","tag-getboundingclientrect","tag-html","tag-javascript","tag-justify","tag-programming","tag-rotate","tag-sidle","tag-snug","tag-transform","tag-translate","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/61982"}],"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=61982"}],"version-history":[{"count":3,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/61982\/revisions"}],"predecessor-version":[{"id":61985,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/61982\/revisions\/61985"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=61982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=61982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=61982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}