Syncotype Your Baselines

Published 2 years ago, at the end of July under Software

Syncotype Your BaselinesI often have trouble aligning text and graphics horizontally on the Web. To help horizontally-challenged designers like myself, Wilson Miner wrote a fantastic guide for building pages on a baseline grid. If you do the math right it works beautifully — but I often find myself tweaking and nudging to get every last element snapped in place. To aid that process, I wrote a simple bookmarklet script that overlays a baseline grid atop everything on the page you’re viewing.

I’m calling it Syncotype. Either install the Safari/Firefox bookmarklet or add one script tag to your page, and the Syncotype box appears in the upper right. Enter your line height and offset from the top of the page in pixels and Syncotype overlays your baseline in red.

Update: Now as a bookmarklet!

You can try it out here.

Installing the Bookmarklet

Install Syncotype as a bookmarklet and you can summon it on any page, any time. Note: Because Syncotype is an external script, it may time-out occassionally. Just click the bookmarklet until it works.

Safari/Firefox
Just drag the below bookmarklet link into your bookmark bar, or right click it and add it to your bookmarks in Firefox:

Syncotype

The One-Line Script

Syncotype isn’t for live sites, it’s for spot-checking your horizontal alignment on a pre-production page. To use it, just add the following script tag to your page:

<script type="text/javascript" src="http://s.robgoodlatte.com/syncotype.js"></script>

To iron out all the bugs and to keep things simple, I’m going to keep it as a hosted external script for now. I will provide a download link for those interested when I am more confident in the script. Feel free to do whatever you’d like with it, I’m putting it into the public domain. I’m not certain if anyone else will find it useful — I’m just throwing it out there.

Browser Support

  • Safari 2, 3
  • IE 7
  • Firefox 1.5+
  • Opera 8+

Known Issues

  • When Syncotype is active, text and form fields are not selectable on the page. An overlay div is placed over the entire page rather than being set in the background where it could be painted over. Suggestions are welcome on other ways to accomplish this.

Special thanks to Emmett Nicholas for a ton of great code suggestions.
Thanks to Ben Spaulding for suggesting I make a bookmarklet.
Photo by brainsluice under Creative Commons.


 

90 Insightful and/or Inappropriate remarks

  1. David Hemphill July 31st at 3:44 pm

    I find this to be extremely useful and can’t wait to use it. Thanks for sharing!

  2. Ben Spaulding July 31st at 3:58 pm

    Brilliant! Syncotype may be the most useful tool for setting type on the web that I’ve ever seen. Thanks for sharing it.

    One thought / suggestion: could Syncotype be made into a bookmarklet, thus allowing it to be used to make adjustments on a live site?

  3. Ben — Thanks! That’s a fantastic idea, I’ll see what I can do.
    Update: Bookmarklet now available!

  4. Hey Rob, thanks for posting this. By the way, this box that I am typing in is VERY wide, going way past your wrapper. Are you meaning to do this?

  5. Thanks Rob, this really is great. I’ve read a number of articles on vertical rhythm and though I’ve tried to implement a consistent spacing I always find myself coming up a bit short for one reason or another. Having the ability to overlay the grid is going to be very helpful. Thanks again.

  6. Nate Klaiber July 31st at 7:43 pm

    This tool is absolutely beautiful. Beats having to use the image background.

    Thanks for the great work….

  7. Link: Check your baselines with Syncotype at Joshua Clanton July 31st at 7:56 pm

    [...] Goodlatte has just released a really handy bookmarklet called Syncotype to help check the vertical rhythm of the typography on a web page. Once you’ve installed it, [...]

  8. Eric Florenzano July 31st at 8:26 pm

    Even as a non-designer, I think I’ll probably end up using this to help build some basic CSS that looks good. Thanks!

  9. Hey Rob, sorry about the earlier post. It happens to be an issue with my computer. My default Windows XP fonts were messed with, and have now created some headaches. Sorry about that.

  10. Emmett Nicholas July 31st at 11:38 pm

    Hey Rob,
    I played around with javascript today and figured out a way to overlay the lines without “disabling” the content underneath:

    http://www.duke.edu/~efn/syncotype/test.html

    It also fixes an issue where your window.onload would override the existing onload handler. It doesn’t look nice as yours, and it doesn’t fade, and IE draws the lines as 2 pixels thick instead of 1, but other than that, it seems to work.

  11. Zach Inglis August 1st at 4:04 am

    Glad you fixed those bugs. It is now totally awesome.

    Nice work. Very simple but works well.

  12. Chris Mendoza August 1st at 4:22 am

    Rob, Awesome work, that script will most definately come in handy in the future!

  13. Again, nice work Rob.

  14. Mark Boulton August 1st at 6:00 am

    Very, very useful Rob. Nice work.

  15. ‘Tis a beautiful thing, Rob. Nice work!

  16. To continue the patting on the back, nice work Rob.

  17. » Baseline & Gridding - Web Design Marketing Podcast & Blog August 1st at 12:53 pm

    [...] Goodlatte has developed a nice script to help you design that baseline, it’s free and extremely [...]

  18. Julian Schrader August 1st at 4:00 pm

    Great Bookmarklet, very nice! Thanks a lot!

  19. Dennison Uy - Graphic Designer August 2nd at 6:01 am

    Awesome work! Keep it up!

  20. Rob this is awesome!

  21. Thanks for sharing. This looks very useful.

  22. mykola bilokonsky August 2nd at 9:44 am

    Hey, neat. I keep meaning to learn to do the vertical spacing thing a bit better, this will help remind me because I’ll feel like an ass when I’m obviously not even close. Very nice tool!

  23. Could you explain the offset to me?

    I get the line-height - but the offset does what?

  24. Never mind. Figured it out.

  25. Samuel Mikel Bowles August 2nd at 4:38 pm

    I’d like to use Syncotype to line things up on my blog. For example if I add a photo to a blog post and I want to make sure that I got the dimensions correct so it hasn’t thrown my grid off. Currently to test in this situation I have one of two options a) Use the script tag and know that anyone who visits while I am testing will see garish red lines or b) use the bookmarklet which requires interaction every time I reload.

    I’d like to suggest a third option:

    I would like to see Syncotype respond to an anchor tacked on to the end of the URL. This would allow me to install the script tag but know that if my URL does not end in #syncotype users will not be able to see the for-testing-only lines. Adding #syncotype to the end would also be the equivalent of pushing the “Syncotype It!” button in the Control Box eliminating the need to click it each time I hit reload.

    Finally tacking on dimensions would allow a specific grid to be created with each reload for example #syncotype-18 would create a grid with a line height of 18 and an offset of 0 while #syncotype-18-50 would create the same grid with an offset of 50.

    Hopefully this solution (an anchor vs. a query string) allows it to work equally well on both static and dynamic sites eliminating any conflicts with existing query strings.

    Now, I am admittedly nowhere near the javascript expert you are but I took the liberty of writing the code to implement these changes. Feel free to either use this code or improve it should you decide my idea is worth implementation.

    Also, it seems that you are using the same code base for both the bookmarklet and the one-line script. I have done no testing to ensure that I did not break the bookmarklet - there’s a pretty good chance I have.

    If you have time I’d love to hear your thoughts on this either for or against as well as any comments you have on my implementation.

    Thanks for a great tool!
    -Samuel Mikel Bowles

    Changes:

    At the bottom of the function renderControlBox() (apx line 72) I added the following code if statement:


    if(document.location.href.split("#")[1].match(”syncotype-”) != null) {

    var lheight = document.location.href.split(”#”)[1].split(”-”)[1];
    var offset = document.location.href.split(”#”)[1].split(”-”)[2];
    if (offset == undefined) { offset = “0″;}

    RG_Syncotype.drawBaselines(lheight, offset);
    }

    Then I wrapped the final two lines (apx 111 & 112) in an if statement like this:


    if(document.location.href.split("#")[1].match(”syncotype”) != null) {
    RG_Syncotype.combine = function combine(func1, func2){return function(){if (func1){func1();}if (func2){func2();}};};
    window.onload = RG_Syncotype.combine(window.onload, synco_initialize);
    }

  26. Syncotype?CSS Cachebuster?????? —— ???? August 2nd at 6:58 pm

    [...] Syncotype???????????????????????????????????????????????????????line-height?offset??????????syncotype it????????????????? [...]

  27. Should the type not be sitting ON the baseline to be a true baseline grid?
    rather than being between the baselines?

  28. Weyr

  29. Samuel Mikel Bowles August 4th at 10:05 am

    @Emmett Nicholas

    The fix for your IE bug is pretty straight forward. Simply add “span.style.overflow =’hidden’;” to your draw function to get it working in at least the modern versions of IE.

  30. Samuel Mikel Bowles August 4th at 11:32 am

    I’ve just published a fork of Syncotype that I am calling Syncotype-Alt at my site which offers the following improvements:

    * Huge speed improvements (this was one of my primary complaints)*
    * Everything is done in javascript/html/css with no external images*
    * No effects (fading in/out) are used.*
    * Fixes an issue where Syncotype’s window.onload would override an existing onload handler.*
    * The overlay lines no longer disable the content.*
    * The control box now stays hidden until a special #anchor is added to the URL.
    * Added ability to make changes and reload without direct interaction.

    You can find the updated script here:
    http://samuel.bowles.es/2007/08/syncotype/

  31. Great additions Samuel! I’ll be incorporating Emmett’s refactorings in addition to some of your feature additions in my release over the next few days.

  32. Well that’s a nifty wee bookmarklet if ever I saw one, cheers!

    Any chance of a version to create a vertical grid as well?

  33. Saves me creating a baseline graphic each time.

    Excellent work.

  34. links for 2007-08-05 « toonz August 5th at 4:22 pm

    [...] Syncotype Your Baselines — RobGoodlatte.com (tags: typography design css grid javascript) [...]

  35. Jeremy Ricketts August 6th at 7:02 am

    You can safely add Camino to the list of supported browsers.

    Wonderful work by the way.

  36. Links for 8/6/07 [my NetNewsWire tabs] August 6th at 7:38 am

    [...] Syncotype Your Baselines — RobGoodlatte.com [...]

  37. Rob … superb … and great site too !

  38. Baseline tool for firefox/safari - DesignersTalk August 6th at 9:19 am

    [...] tool for firefox/safari Syncotype Your Baselines — RobGoodlatte.com [...]

  39. Awesome job. This is ridiculously useful.

  40. Emmett Nicholas August 6th at 9:45 am

    I updated my version of the script:

    http://www.duke.edu/~efn/syncotype/test.html

    * It now looks just like Rob’s original version (except no fading)
    * Fixed the IE pixel issue in my previous version (thanks Samuel Mikel Bowles)

  41. Mark Jardine August 6th at 10:43 am

    Awesome bookmarklet. It doesn’t seem to handle floating point numbers. What if I have a base type size of 11px with a 1.5em line-height? The vertical rhythm should be 16.5em.

  42. links for 2007-08-06 : Christopher Schmitt August 6th at 1:26 pm

    [...] Syncotype Your Baselines A guide for building pages on a baseline grid. (tags: blog typography design css grid javascript webdesign tools csscookbook) [...]

  43. Thanks for this awesome tool! This is right up there with Firebug and the Web Developer Toolbar on my usefulness scale. Keep up the good work.

  44. Samuel Mikel Bowles August 6th at 8:23 pm

    I’ve just published an update to Syncotype-Alt to take advantage of some of Emmett’s latest improvements. I did, however, opt to keep this version of the script sans-images for performance reasons. This means the script can’t look quite as nice as Rob’s but it is a bit quicker.

    My code has been improved (although it’s still not as pretty and OOy as Emmett’s) but most importantly it keeps the “command-line” features I added in place.

    Let me know if you find the updates useful and if there’s anything I can do to continue improving the script.

    You can find my latest update on the script here:
    http://samuel.bowles.es/2007/08/syncotype-alt-updated/

  45. Thank you! great tool!

  46. Syncotype, rejilla base para web August 7th at 8:17 am

    [...] el uso de una rejilla base para organizar visualmente los textos de un sitio web, un tipo llamado Rob Goodlatte ha creado un script en javascript llamado Syncotype que genera una rejilla base en tus sitios de pruebas para poder ajustar a tu gusto los [...]

  47. Craig Vidler | Weblog » links for 2007-08-07 August 7th at 11:19 am

    [...] Syncotype Your Baselines — RobGoodlatte.com Handy bookmarklet for checking grid-based CSS layouts (tags: typography design css bookmarklets) This entry was written by Craig and posted on August 7, 2007 at 6:19 pm and filed under Bookmarks. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL. « links for 2007-08-05 [...]

  48. Criterion » Archivo del weblog » Resumen no-vacacional agosto 2007 (II) August 7th at 1:03 pm

    [...] también nos habla de Syncotype [en], un pequeño js que te permite crear rejillas-web y así controlar mejor la [...]

  49. alceste’s blog » Blog Archive » About better layouts, CSS and ease of use thru grids August 8th at 1:00 am

    [...] PS: Plus a nice tool to check the consistency of your alignments [...]

  50. Samuel Mikel Bowles August 9th at 10:21 am

    Emmett, it seems there are some CSS specificity issues in your latest version of Syncotype which causes the script to be unusable in documents with a strict doctype. To see what I mean switch the doctype you’re using in the test suite from this:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">

    to this:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    I think I fixed the issue by being sure to always add ‘px’ to the end of your style declarations (tip of the hat to Clint Ecker for pointing this out.) These lines need to be changed:


    span.style.left = 0;
    span.style.top = i;
    span.style.height = 1;

    to this:


    span.style.left = '0px';
    span.style.top = i + 'px';
    span.style.height = '1px';

    I’ve updated Syncotype-Alt to reflect this bug fix. You can find the latest update here:
    http://samuel.bowles.es/2007/08/syncotype-alt-updated/

  51. Getting baselined | favrik › Waking up… » Blog Archive August 11th at 4:55 am

    [...] came from a recent development: a CSS framework. To experience the beauty of having a baseline try syncotype and, for this site, set the line-height to 24px. Syncotype [...]

  52. I’d just like to say thanks for creating this wonderful piece of code. Before Syncotype, I’d have an absolutely positioned #lines div on each page (it was a hassle).

    I’d love to use the version mentioned that allows you to interact with the page, but it doesn’t seem to work with the bookmarklet (the only reason IMO this is useful).

    Thanks!

  53. Nachlese Juli 2007- Die Seiten des Monats » Allgemeines August 13th at 10:10 am

    [...] Syncotype Your Baselines Ein Bookmarklet zur horizontalen Ausrichtung von Texten in raster-basierten Designs. [...]

  54. Best of July 2007 | Best of the Month August 13th at 10:11 am

    [...] Syncotype Your Baselines “I often have trouble aligning text and graphics horizontally on the Web. To help horizontally-challenged designers like myself, Wilson Miner wrote a fantastic guide for building pages on a baseline grid. If you do the math right it works beautifully — but I often find myself tweaking and nudging to get every last element snapped in place. To aid that process, I wrote a simple bookmarklet script that overlays a baseline grid atop everything on the page you’re viewing.” [...]

  55. Best of July 2007 . August 13th at 1:18 pm

    [...] Syncotype Your Baselines “I often have trouble aligning text and graphics horizontally on the Web. To help horizontally-challenged designers like myself, Wilson Miner wrote a fantastic guide for building pages on a baseline grid. If you do the math right it works beautifully — but I often find myself tweaking and nudging to get every last element snapped in place. To aid that process, I wrote a simple bookmarklet script that overlays a baseline grid atop everything on the page you’re viewing.” [...]

  56. lost node » Blog Archive » Best of July 2007 August 13th at 3:26 pm

    [...] Syncotype Your Baselines “I often have trouble aligning text and graphics horizontally on the Web. To help horizontally-challenged designers like myself, Wilson Miner wrote a fantastic guide for building pages on a baseline grid. If you do the math right it works beautifully — but I often find myself tweaking and nudging to get every last element snapped in place. To aid that process, I wrote a simple bookmarklet script that overlays a baseline grid atop everything on the page you’re viewing.” [...]

  57. Syncotype Demo | moraaz.org - feed all tech! August 13th at 11:54 pm

    [...] grid in red. You can also install Syncotype as a bookmarklet and summon it on any page — read the blog post for full details or view the [...]

  58. This is genius, I’m so pleased I found it.

  59. SitePoint Blogs » News Wire: A Blueprint for CSS Design August 17th at 1:43 am

    [...] Syncotype Your Baselines A short-and-sweet tool to assist in aligning page elements to a regular baseline grid. When invoked, this bookmarklet will overlay any page with a regular horizontal grid so that you can check your element alignment. Works in all major browsers. (thanks gnarly!) (tags: css software design) [...]

  60. you are the fucking man, thanks for sharing this valuable tool for us lesser designers

  61. User First Web » links for 2007-08-19 August 19th at 12:20 am

    [...] Syncotype Your Baselines — RobGoodlatte.com Adds lines to a page to make sure that you’ve got the text lined up on your grid (tags: leading typography grid design bookmarklet) [...]

  62. I just drag’n'dropped the bookmarklet in Firefox and it didn’t work.
    It’s because some characters were converted to %XX when bookmarked.
    Thanks.

  63. Web 2.0 Blog » Blog Archive » Nachlese Juli 2007- Die Seiten des Monats - aus dem Blog:Dr. Web Weblog[Quelle] September 1st at 12:26 am

    [...] Syncotype Your Baselines Ein Bookmarklet zur horizontalen Ausrichtung von Texten in raster-basierten Designs. [...]

  64. {Daniel T Ott} » Thoughts » Thinking In Ems September 2nd at 9:25 pm

    [...] that this seems like it could be a pain. It is. What was my secret weapon? Rob Goodlotte’s Syncotype. What it does is place a horizontal grid over the page you’re viewing, at any size [...]

  65. Rejilla base también para la web « CuatroTipos September 12th at 4:05 am

    [...] asientan la mayoría de los caracteres. ¿Por que no en la web? Eso debió pensar un tipo llamado Rob Goodlatte, quien a partir de una guía de A List Apart en la que se proponía el uso de una rejilla base para [...]

  66. Sophie » Best of July 2007 September 12th at 6:48 am

    [...] Syncotype Your Baselines “I often have trouble aligning text and graphics horizontally on the Web. To help horizontally-challenged designers like myself, Wilson Miner wrote a fantastic guide for building pages on a baseline grid. If you do the math right it works beautifully — but I often find myself tweaking and nudging to get every last element snapped in place. To aid that process, I wrote a simple bookmarklet script that overlays a baseline grid atop everything on the page you’re viewing.” [...]

  67. [...] Syncotype Going hand in hand with Blueprint is Syncotype, a great little bookmarklet that superimposes lines over any webpage. [...]

  68. » Tudo alinhado? Mesmo? October 1st at 12:09 am

    [...] este bookmarklet feito pelo Rob Goodlatte. A única coisa que você precisa fazer para instala-lo é arrastar o link [...]

  69. Seven Smooth Steps to Superb Grids | Sacha Greif October 1st at 10:04 am

    [...] is the hardest part. To help you with it, you can use Syncotype to check that everything fits on the baseline, or Grid Layouts to do the same for the vertical [...]

  70. 4 Bookmarklets che mi stanno semplificando la vita - Laburno October 2nd at 2:52 pm

    [...] Syncotype Your Baseline: sovrappone alla pagina una griglia per controllare il corretto andamento del ritmo verticale. La uso moltissimo quando in layout intricati devo controllare che bordi e margini non vadano ad intaccare la baseline del documento. [...]

  71. 2007 - A Year in links Color Charge December 27th at 5:06 pm

    [...] Rob Goodlatte - Syncotype Your Baselines [...]

  72. Adam Messinger March 15th at 5:15 pm

    This is outstandingly useful, but I’ve found one small problem. I tried it out on an in-development site that has a 19.5 pixel line-height. Syncotype doesn’t seem to like decimals at all — I couldn’t get any lines to show up. Using either 19 or 20 pixels was just a little bit “off.”

    Other than that, it’s great. In the future, I’ll probably shoot for whole number line heights just so I can use it!

  73. Ben Johnson April 4th at 11:43 am

    You’re amazing. Thank you!

  74. hi ,very thanks

  75. This script has been a favorite tool of mine. I’ve been using it for over a year now and it makes it really easy to adjust your layouts and see the how each browser interprets measurements from your CSS file. Indispensable. Thanks, dude!

  76. Oops! Not quite a year. Duhhh….

  77. It looks good. Thanks for the article.

  78. Nice work.
    Thanks for the great tool.

  79. 5 bookmarklets that will make your life easier | Sacha Greif August 2nd at 1:19 pm

    [...] 2) Syncotype [...]

  80. Good work, thanks.

  81. plakali esanjor September 3rd at 9:15 am

    Looks very good
    Thank you for the work

  82. love it. please host it forever.

  83. overeenandPat June 1st at 3:29 pm

    39998 viagra compra 45472 10354 enkrjvfd ordina viagra 35691 fdjskv fdvf http://members.ebay.it/ws/eBayISAPI.dll?ViewUserPage&userid=viagra-compra viagra compra :) kdjc

  84. overeenandPat June 1st at 4:44 pm

    35336 viagra 93963 11516 eechjbhs ordina viagra 37287 dslkcnisld http://members.ebay.it/ws/eBayISAPI.dll?ViewUserPage&userid=viagra-compra viagra compra :) cuckjsd

  85. overeenandPat June 2nd at 12:22 am

    75321 viagra compra 6980 46744 enkrjvfd viagra compra 65353 jhf m mv http://myworld.ebay.it/viagra-compra compra viagra :) hjd skc

  86. overeenandPat June 2nd at 2:11 am

    89497 viagra 57264 24876 newwm viagra 49726 jhf m mv http://myworld.ebay.it/viagra-compra viagra compra :) cndksjncs

  87. No Credit Check Loans Yeah June 3rd at 3:29 pm

    Thank you, Knock Off Coach Purses Photos [url=http://www.movabletype.org/members/knock_off_coach_purses#1]Knock Off Coach Purses Photos[/url], yszm, High Risk Personal Loans For Everybody [url=http://www.movabletype.org/members/high_risk_personal_loans#1]High Risk Personal Loans For Everybody[/url], qqpyy, kim kardashian sex tape [url=http://www.movabletype.org/members/kim_kardashian_sex_tape#1]kim kardashian sex tape[/url], zjhk, Cheapest no credit check loans [url=http://www.movabletype.org/members/no_credit_check_loans#1]Cheapest no credit check loans[/url], doosw, Best fake coach purses [url=http://www.movabletype.org/members/fake_coach_purses#1]Best fake coach purses[/url], %OO,

  88. Genc Rashiti June 29th at 6:36 am

    this script is awsome … thx for this handy tool

  89. The bookmarklet doesn’t seem to work with FF3.5

  90. thinsoldier July 6th at 1:04 pm

    Works in 3.5 for me.

    Feature requests:
    Toggle to assign the lines to body tag instead of a div overlaying the entire page (gets in the way of right-click-inspect-element)

    Use data urls to generate the 1 line image. What will happen to the script if url(http://s.robgoodlatte.com/i/18.png) is not available for some reason?

    [+] and [-] keys for easy nudging of values with immediate visual feedback.

    Make the syncotype box fixed to the upper corner of the window so it’s always visible even when we scroll down a long page.

 

Enlighten Me