[cairo-commit] cairo-demo/cairo_snippets index.html_template, NONE,
1.1 text_align_right.html, NONE, 1.1
OEyvind Kolaas
commit at pdx.freedesktop.org
Wed May 26 14:06:47 PDT 2004
- Previous message: [cairo-commit] cairo-demo/cairo_snippets text_align_center.cairo,
NONE, 1.1 text_extents.cairo, NONE, 1.1 ChangeLog, 1.14,
1.15 text_centering.cairo, 1.2, NONE
- Next message: [cairo-commit]
cairo-demo/cairo_snippets text_align_right.html, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: pippin
Update of /cvs/cairo/cairo-demo/cairo_snippets
In directory pdx:/tmp/cvs-serv22124
Added Files:
index.html_template text_align_right.html
Log Message:
--- NEW FILE: index.html_template ---
<p>
This page contains samples of cairo's rendered output and the
code snippets used to create them.
</p>
<p>
The <em>user space</em> is the unit square ( (0,0) - (1, 1) ).
The snippets are meant to be short, and easy to understand
</p>
<p>
<a href='http://cvs.cairographics.org/cairo-demo/cairo_snippets/'>cairo_snippets</a>,
part of the cairo-demo module in cairo CVS, is used to create these webpages,
cairo_snippets serves as a testbed for the rendered output of various cairo backends,
the images rendered on these webpages uses the cairo_snippets_png program, which is
backend by the software image backend.
</p>
<p>
The snippet enviroment, and the original snippets were originally
created by Øyvind Kolås for a paper submitted
to <a href='http://2004.guadec.org/'>GUADEC 2004</a>.
</p>
<p>
All snippet code is considered to be part of the public domain,
since it is instructional material.
</p>
<p>
A page with <a href='snippets.html'>all snippets</a> is also available
</p>
--- NEW FILE: text_align_right.html ---
<html>
<head><title>cairo: snippets</title>
<style type='text/css'>
@import url(http://cairographics.org/styles.css);
@import url(cairo_snippets.css);
</style>
<body>
<a name='PageTop'></a>
<div id='main'>
<div id='logo'><a href='http://cairographics.org/'><img border='0' src='http://cairographics.org/cairo/cairo_banner.png' alt='cairographics.org'/></a></div>
<div id='snippet_page_title'><h1><a href='index.html'>cairo samples</a></h1></div>
<div id='snippet_list'>
<div id='snippet_list_entry'><a href='arc.html'> arc</a>
</div><div id='snippet_list_entry'><a href='arc_negative.html'> arc_negative</a>
</div><div id='snippet_list_entry'><a href='caps.html'> caps</a>
</div><div id='snippet_list_entry'><a href='clipping.html'> clipping</a>
</div><div id='snippet_list_entry'><a href='curve_rectangle.html'> curve_rectangle</a>
</div><div id='snippet_list_entry'><a href='curve_to.html'> curve_to</a>
</div><div id='snippet_list_entry'><a href='fill_and_stroke.html'> fill_and_stroke</a>
</div><div id='snippet_list_entry'><a href='fill_and_stroke2.html'> fill_and_stroke2</a>
</div><div id='snippet_list_entry'><a href='gradient.html'> gradient</a>
</div><div id='snippet_list_entry'><a href='image.html'> image</a>
</div><div id='snippet_list_entry'><a href='image_clipping.html'> image_clipping</a>
</div><div id='snippet_list_entry'><a href='joins.html'> joins</a>
</div><div id='snippet_list_entry'><a href='libsvg.html'> libsvg</a>
</div><div id='snippet_list_entry'><a href='operator_add.html'> operator_add</a>
</div><div id='snippet_list_entry'><a href='operator_atop.html'> operator_atop</a>
</div><div id='snippet_list_entry'><a href='operator_atop_reverse.html'> operator_atop_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_in.html'> operator_in</a>
</div><div id='snippet_list_entry'><a href='operator_in_reverse.html'> operator_in_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_out.html'> operator_out</a>
</div><div id='snippet_list_entry'><a href='operator_out_reverse.html'> operator_out_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_over.html'> operator_over</a>
</div><div id='snippet_list_entry'><a href='operator_over_reverse.html'> operator_over_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_saturate.html'> operator_saturate</a>
</div><div id='snippet_list_entry'><a href='operator_xor.html'> operator_xor</a>
</div><div id='snippet_list_entry'><a href='path.html'> path</a>
</div><div id='snippet_list_entry'><a href='text.html'> text</a>
</div><div id='snippet_list_entry'><a href='text_align_center.html'> text_align_center</a>
</div><div id='snippet_list_entry_selected'><a href='text_align_right.html'> text_align_right
</a></div><div id='snippet_list_entry'><a href='text_extents.html'> text_extents</a>
</div><div id='snippet_list_entry'><a href='xxx_dash.html'> xxx_dash</a>
</div><div id='snippet_list_entry'><a href='xxx_long_lines.html'> xxx_long_lines</a>
</div><div id='snippet_list_entry'><a href='xxx_multi_segment_caps.html'> xxx_multi_segment_caps</a>
</div><div id='snippet_list_entry'><a href='xxx_self_intersect.html'> xxx_self_intersect</a>
</div></div>
<div id='snippet_prev'><a href='text_align_center.html'>prev</a></div>
<div id='snippet_next'><a href='text_extents.html'>next</a></div>
<div id='snippet'>
<div id='snippet_image'><img src='text_align_right.png'/></div>
<div id='snippet_source'><pre>cairo_text_extents_t extents;
const char *utf8 = "cairo";
double x,y;
cairo_select_font (cr, "Sans",
CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_scale_font (cr, 0.2);
cairo_text_extents (cr, utf8, &extents);
x = 0.5-(extents.width +extents.x_bearing);
y = 0.5;
cairo_move_to (cr, x, y);
cairo_show_text (cr, utf8);
/* draw helping lines */
cairo_set_rgb_color (cr, 1,0.2,0.2);
cairo_set_alpha (cr, 0.6);
cairo_arc (cr, x, y, 0.05, 0, 2*M_PI);
cairo_fill (cr);
cairo_move_to (cr, 0.5, 0);
cairo_rel_line_to (cr, 0, 1);
cairo_move_to (cr, 0, 0.5);
cairo_rel_line_to (cr, 1, 0);
cairo_stroke (cr);
</pre></div>
</div>
</div><p />
<a name='PageBottom'></a>
<br clear='all'/>
<center>
<a href='http://cairographics.org/cairo/glider-blue.svg'
><img border='0' src='http://cairographics.org/cairo/glider-blue.png'>
</a>
</center>
</html>
- Previous message: [cairo-commit] cairo-demo/cairo_snippets text_align_center.cairo,
NONE, 1.1 text_extents.cairo, NONE, 1.1 ChangeLog, 1.14,
1.15 text_centering.cairo, 1.2, NONE
- Next message: [cairo-commit]
cairo-demo/cairo_snippets text_align_right.html, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list