djangosnippets.org: Latest snippets tagged with 'typography'http://djangosnippets.org/tags/typography/2009-10-02T21:34:09.990633-05:00Wrappable text
2009-10-02T21:34:09.990633-05:00jdunckhttp://djangosnippets.org/snippets/1751/<p>Sometimes you have an uncontrolled amount of text in a horizontally constrained space.</p>
<p>The wrappable filter places zero-width breaking spaces into the given text so that it can wrap at any point, as necessary for the containing width. Sometimes better than eliding (chopping long text...) or cropping/scrolling overflow.</p>
Freely redistributableEnhanced "avoid widows" template filters
2007-07-25T20:25:44.137065-05:00SmileyChrishttp://djangosnippets.org/snippets/340/<p>Building on <a href="http://www.djangosnippets.org/snippets/17/">jcroft's snippet</a>, here's a slightly more advanced version which has two filters, one for basic text and the other for html snippets.</p>
<p>Usage is like so:</p>
<pre><code><h2>{{ blog_entry.headline|escape|widont }}</h2>
{{ blog_entry.html|widont_html }}
</code></pre>
<p>On top of Jeff's reasons for using these filters, they are important because they help …</p>
Freely redistributableSmartyPants Filter
2007-04-17T01:23:15.467243-05:00obeattiehttp://djangosnippets.org/snippets/184/<p>Really simple filter for using Smartpants in your template -- placed in your custom filters file. Requires python smartypants to be installed.</p>
Freely redistributableAvoid widows using a template filter
2007-02-25T21:23:27.917368-06:00jcrofthttp://djangosnippets.org/snippets/17/<p><strong>Support good typography! Avoid widows! </strong></p>
<p>"Widows" are single words that end up on their own line, thanks to automatic line-breaks. This is an no-no in graphic design, and is especially unsightly in headers and other short bursts of text. This filter automatically replaces the space before the last word of …</p>
Freely redistributable