Changeset 4068 for toilet


Ignore:
Timestamp:
Nov 30, 2009, 1:47:24 AM (10 years ago)
Author:
Sam Hocevar
Message:

Add a "border" filter to add a border around text.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • toilet/trunk/src/filter.c

    r2988 r4068  
    3838static void filter_left(context_t *);
    3939static void filter_right(context_t *);
     40static void filter_border(context_t *);
    4041
    4142struct
     
    5657    { "left", filter_left, "rotate 90 degrees counterclockwise" },
    5758    { "right", filter_right, "rotate 90 degrees clockwise" },
     59    { "border", filter_border, "surround text with a border" },
    5860};
    5961
     
    237239}
    238240
     241static void filter_border(context_t *cx)
     242{
     243    int w, h;
     244
     245    w = caca_get_canvas_width(cx->torender);
     246    h = caca_get_canvas_height(cx->torender);
     247
     248    caca_set_canvas_boundaries(cx->torender, -1, -1, w + 2, h + 2);
     249
     250    caca_draw_cp437_box(cx->torender, 0, 0, w + 2, h + 2);
     251}
     252
Note: See TracChangeset for help on using the changeset viewer.