/hatchshow-a-jquery-typesetting-plugin/index.html
HTML | 77 lines | 66 code | 10 blank | 1 comment | 0 complexity | 9b11155d2a2b80a749c2eaa3efdc9b70 MD5 | raw file
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="description" content="A jQuery typesetting plugin I wrote. It balances measures. Named for the poster shop. (from Charlie Park)">
- <link rel="alternate" href="http://charliepark.org/feed/" type="application/rss+xml">
- <meta name="viewport" content="width=device-width">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <link rel="openid2.provider" href="https://www.google.com/accounts/o8/ud" />
- <!-- old OpenID credentials; keep around for a bit longer <link rel="openid.server" href="http://charliepark.mp/server" /> <link rel="openid.delegate" href="http://charliepark.mp/"> -->
- <title>HATCHSHOW.js</title>
- <link href="/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css">
- </head>
- <body>
- <header>
- <h2 class="site_title"><a href="/">Charlie Park</a> <span style="color:#ccc;font-size:19px;"></span></h2>
- <ul id="nav"><li class="nav_list_item" style="text-align:left"><a class="nav_list_link" href="/about">about me</a></li><li class="nav_list_item" style="left:2px;"><a class="nav_list_link" href="/projects">projects</a></li><li class="nav_list_item" style="text-align:right"><a class="nav_list_link" href="/archives">archives</a></li></ul>
- </header>
- <section id="main_content">
- <h1 class="post_title">HATCHSHOW.js</h1>
- <div class="meta_wrapper"><time datetime="2012-10-02">October 2, 2012</time><ul class="tag_list_in_post"><li class="inline tag_list_item"><a class="tag_list_link" href="/tag/a thing I made">a thing I made</a></li><li class="inline tag_list_item"><a class="tag_list_link" href="/tag/jQuery">jQuery</a></li><li class="inline tag_list_item"><a class="tag_list_link" href="/tag/front-end stuff">front-end stuff</a></li></ul></div>
- <p><img src="http://charliepark.org/images/hatchshow-a-jquery-typesetting-plugin/hatchshowprint_jc.jpg" style="margin:0 auto" /></p>
- <p>I’ve always loved the posters from <a href="http://countrymusichalloffame.org/historical-posters/">HATCH SHOW PRINT</a>. You can see one above. See how they expand the type size until it fills the line? (“Johnny” is a smaller size than “Cash”, and “the fabulous” is even smaller.) I love that.</p>
- <p>About a year ago, I was working on Monotask and wanted to make a way to dynamically create text that resized, based on the width of its container and the amount of text on the line. Typesetting and JavaScript are two of my favorite things … why not combine them? So I made a jQuery plugin: <a href="http://charliepark.org/hatchshow/">HATCHSHOW.js</a> I put a page up for it, and shared it on Twitter, but I realized I never posted it here on the blog. So this is a post to rectify that.</p>
- <p>Click on the image here to go check out <a href="http://charliepark.org/hatchshow/">HATCHSHOW.js</a>.</p>
- <p><a href="http://charliepark.org/hatchshow/"><img src="http://charliepark.org/images/hatchshow.png" alt="A Johnny Cash concert poster." /></a></p>
- <p>The plugin is really simple. All you do is wrap the “lines” you want the effect applied to with a <span class=”hsjs”>, and it does the rest. You’ll probably want to make a few adjustments for the line height and for individual kerning adjustments. But the plugin does most of the work.</p>
- <p>As you’ll see if you check out the <a href="http://charliepark.org/hatchshow/">HATCHSHOW</a> page, the font-size for every letter on that page was generated dynamically. Cue theremin: By an <em>algorithm</em>. (Ooooo!)</p>
- <p>The more astute among you are probably saying “Yeah, but this is the same thing <a href="http://fittextjs.com/">Fittext.js</a> does, isn’t it?” Good question, but no. Fittext is for a single line — a headline or the name of the page / service / whatever. HATCHSHOW is intended for multi-line displays, kind of like what you see in that concert poster up top.</p>
- <p>If you build anything cool with it, be sure to let me know! And if you want the code, it’s right on <a href="http://charliepark.org/hatchshow/">the HATCHSHOW page</a> (click on the “check out the code” link at the bottom, then scroll down).</p>
- <p>Have fun!</p>
- <footer>
- <p class="next_actions">I would really enjoy connecting with you <a href="http://twitter.com/charliepark/">on Twitter</a><br>(but I’m taking a little break from it at the moment).</p>
- </footer>
- </section>
- <aside id="sidebar">
- <h3>My Most Popular Posts</h3>
- <p>You’ll like these.</p>
- <ul>
- <li><a href="/slopegraphs">Slopegraphs</a></li>
- <li><a href="/a-slopegraph-update">A Slopegraph Update</a></li>
- <li><a href="/beautiful-buttons-for-twitter-bootstrappers">Beautiful Buttons for Twitter Bootstrappers</a></li>
- <li><a href="/tags-in-jekyll">Tags in Jekyll</a></li>
- </ul>
- </aside>
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <div id="search"><div id="cse" style="width: 100%;">Loading</div></div>
- <script src="http://www.google.com/jsapi" type="text/javascript"></script>
- <script type="text/javascript">
- google.load('search', '1', {language : 'en'});
- google.setOnLoadCallback(function() {
- var customSearchControl = new google.search.CustomSearchControl('003013616125562838920:lezwpvqsqgo');
- customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
- customSearchControl.draw('cse');
- }, true);
- </script>
- <script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-15921981-1");
- pageTracker._trackPageview();
- } catch(err) {}
- </script>
- </body>
- </html>