Implement cairo_set_scaled_font().

This commit is contained in:
Behdad Esfahbod 2006-04-15 03:58:42 -04:00 committed by Behdad Esfahbod
parent db111197ac
commit d0356a87f7
29 changed files with 44 additions and 81 deletions

View file

@ -14,6 +14,3 @@ BeOS surface support
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,9 +14,6 @@ How a font should be rendered
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_font_options_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Base class for fonts
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_font_face_t ##### -->
<para>

View file

@ -14,6 +14,3 @@ Font support for FreeType
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ OpenGL accelerated rendering using the Glitz library
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -17,9 +17,6 @@ Rendering to memory buffers
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM cairo_format_t ##### -->
<para>

View file

@ -29,9 +29,6 @@ Generic matrix operations
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT cairo_matrix_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Creating paths and manipulating path data
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT cairo_path_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Gradients and filtered sources
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_pattern_t ##### -->
<para>

View file

@ -14,6 +14,3 @@ Rendering PDF documents
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,9 +14,6 @@ Reading and writing PNG images
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### USER_FUNCTION cairo_read_func_t ##### -->
<para>

View file

@ -14,6 +14,3 @@ Rendering PostScript documents
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ Rendering to Quartz surfaces
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,9 +14,6 @@ Caching metrics for a particular font size
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_scaled_font_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Decoding cairo's status
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM cairo_status_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Base class for surfaces
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_surface_t ##### -->
<para>

View file

@ -14,9 +14,6 @@ Rendering text and sets of glyphs
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT cairo_glyph_t ##### -->
<para>

View file

@ -14,6 +14,3 @@ Manipulating the current transformation matrix
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,9 +14,6 @@ Generic data types used in the cairo API
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION cairo_bool_t ##### -->
<para>

View file

@ -114,9 +114,6 @@ if (cairo_version() >= %CAIRO_VERSION_ENCODE(1, 0, 0))
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO CAIRO_VERSION ##### -->
<para>

View file

@ -14,6 +14,3 @@ Font support for Microsoft Windows
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ Microsoft Windows surface support
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ X Window System rendering using the XCB library
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ X Window System rendering using the XCB library
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ XLib/Xrender Backend
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,3 @@ X Window System rendering using XLib
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -24,9 +24,6 @@ The cairo drawing context
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF cairo_t ##### -->
<para>

View file

@ -1984,6 +1984,46 @@ cairo_get_font_options (cairo_t *cr,
_cairo_gstate_get_font_options (cr->gstate, options);
}
/**
* cairo_set_scaled_font:
* @cr: a #cairo_t
* @scaled_font: a #cairo_scaled_font_t
*
* Replaces the current font face, font matrix, and font options in
* the #cairo_t with those of the #cairo_scaled_font_t. Except for
* some translation, the current CTM of the #cairo_t should be the
* same as that of the #cairo_scaled_font_t, which can be accessed
* using cairo_scaled_font_get_ctm().
**/
void
cairo_set_scaled_font (cairo_t *cr,
const cairo_scaled_font_t *scaled_font)
{
if (cr->status)
return;
cr->status = scaled_font->status;
if (cr->status)
goto BAIL;
cr->status = _cairo_gstate_set_font_face (cr->gstate, scaled_font->font_face);
if (cr->status)
goto BAIL;
cr->status = _cairo_gstate_set_font_matrix (cr->gstate, &scaled_font->font_matrix);
if (cr->status)
goto BAIL;
cr->status = _cairo_gstate_set_font_options (cr->gstate, &scaled_font->options);
if (cr->status)
goto BAIL;
return;
BAIL:
_cairo_set_error (cr, cr->status);
}
/**
* cairo_text_extents:
* @cr: a #cairo_t

View file

@ -852,6 +852,10 @@ cairo_public void
cairo_get_font_options (cairo_t *cr,
cairo_font_options_t *options);
cairo_public void
cairo_set_scaled_font (cairo_t *cr,
const cairo_scaled_font_t *scaled_font);
cairo_public void
cairo_show_text (cairo_t *cr, const char *utf8);