Text replacement with alternative font faces

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{% load headline %}

{{ foo|headline:"font.ttf,20,#000" }}
{{ foo|headline:"font.ttf,20,#000,underlined,all" }}
{{ foo|headline:"base,br" }}

{% headline "font.ttf,20,#000" %}Big {{ foo }}{% endheadline %}
{% headline "font.ttf,20,#000,strikeout,none" %}Big {{ foo }}{% endheadline %}
{% headline "base" %}Big {{ foo }}{% endheadline %}

{% headlines foo_list bar_dict baz_var "And some text" as headers "font.ttf,20,#000" %}
{% headlines foo_list bar_dict baz_var "And some text" as headers "font.ttf,20,#000,all" %}
{% headlines foo_list bar_dict baz_var "And some text" as headers "base" %}

{% for head in headers %}
   <img src="{{ head.file }}" alt="{{ head.text }}" width="{{ head.width }}" height="{{ head.height }}" />
{% endfor %}

More like this

  1. simple text image view by derelm 4 years, 10 months ago
  2. YUI Loader as Django middleware by akaihola 3 years, 9 months ago
  3. Avoid widows using a template filter by jcroft 4 years, 11 months ago
  4. Analogue template filter to removetags that also removes the content of the tag by piquadrat 1 year, 2 months ago
  5. simple tag-cloud Template Tag by metty 2 years, 4 months ago

Comments

akaihola (on July 14, 2009):

See also django-rendertext and django-cairo-text.

#

(Forgotten your password?)