[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


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 &Oslash;yvind Kol&aring;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'>&nbsp;arc</a>
</div><div id='snippet_list_entry'><a href='arc_negative.html'>&nbsp;arc_negative</a>
</div><div id='snippet_list_entry'><a href='caps.html'>&nbsp;caps</a>
</div><div id='snippet_list_entry'><a href='clipping.html'>&nbsp;clipping</a>
</div><div id='snippet_list_entry'><a href='curve_rectangle.html'>&nbsp;curve_rectangle</a>
</div><div id='snippet_list_entry'><a href='curve_to.html'>&nbsp;curve_to</a>
</div><div id='snippet_list_entry'><a href='fill_and_stroke.html'>&nbsp;fill_and_stroke</a>
</div><div id='snippet_list_entry'><a href='fill_and_stroke2.html'>&nbsp;fill_and_stroke2</a>
</div><div id='snippet_list_entry'><a href='gradient.html'>&nbsp;gradient</a>
</div><div id='snippet_list_entry'><a href='image.html'>&nbsp;image</a>
</div><div id='snippet_list_entry'><a href='image_clipping.html'>&nbsp;image_clipping</a>
</div><div id='snippet_list_entry'><a href='joins.html'>&nbsp;joins</a>
</div><div id='snippet_list_entry'><a href='libsvg.html'>&nbsp;libsvg</a>
</div><div id='snippet_list_entry'><a href='operator_add.html'>&nbsp;operator_add</a>
</div><div id='snippet_list_entry'><a href='operator_atop.html'>&nbsp;operator_atop</a>
</div><div id='snippet_list_entry'><a href='operator_atop_reverse.html'>&nbsp;operator_atop_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_in.html'>&nbsp;operator_in</a>
</div><div id='snippet_list_entry'><a href='operator_in_reverse.html'>&nbsp;operator_in_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_out.html'>&nbsp;operator_out</a>
</div><div id='snippet_list_entry'><a href='operator_out_reverse.html'>&nbsp;operator_out_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_over.html'>&nbsp;operator_over</a>
</div><div id='snippet_list_entry'><a href='operator_over_reverse.html'>&nbsp;operator_over_reverse</a>
</div><div id='snippet_list_entry'><a href='operator_saturate.html'>&nbsp;operator_saturate</a>
</div><div id='snippet_list_entry'><a href='operator_xor.html'>&nbsp;operator_xor</a>
</div><div id='snippet_list_entry'><a href='path.html'>&nbsp;path</a>
</div><div id='snippet_list_entry'><a href='text.html'>&nbsp;text</a>
</div><div id='snippet_list_entry'><a href='text_align_center.html'>&nbsp;text_align_center</a>
</div><div id='snippet_list_entry_selected'><a href='text_align_right.html'>&nbsp;text_align_right
</a></div><div id='snippet_list_entry'><a href='text_extents.html'>&nbsp;text_extents</a>
</div><div id='snippet_list_entry'><a href='xxx_dash.html'>&nbsp;xxx_dash</a>
</div><div id='snippet_list_entry'><a href='xxx_long_lines.html'>&nbsp;xxx_long_lines</a>
</div><div id='snippet_list_entry'><a href='xxx_multi_segment_caps.html'>&nbsp;xxx_multi_segment_caps</a>
</div><div id='snippet_list_entry'><a href='xxx_self_intersect.html'>&nbsp;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, &amp;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>





More information about the cairo-commit mailing list