diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 50ea17b36..b4068b5d2 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -7598,6 +7598,27 @@ clutter_actor_grab_key_focus (ClutterActor *self) clutter_stage_set_key_focus (CLUTTER_STAGE (parent), self); } +/** + * clutter_actor_get_pango_context: + * @self: a #ClutterActor + * + * Retrieves the #PangoContext for @self. The actor's #PangoContext + * is already configured using the appropriate font map, resolution + * and font options. + * + * The returned #PangoContext will be updated each time the options + * stored by the default #ClutterBackend change. + * + * You can use the returned #PangoContext to create a #PangoLayout + * and render text using cogl_pango_render_layout() to reuse the + * glyphs cache also used by Clutter. + * + * Return value: the #PangoContext for a #ClutterActor. The returned + * #PangoContext is owned by the actor and should not be unreferenced + * by the application code + * + * Since: 1.0 + */ PangoContext * clutter_actor_get_pango_context (ClutterActor *self) { diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index f49fa66da..4c60d40ff 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -521,6 +521,18 @@ clutter_backend_get_font_options (ClutterBackend *backend) return priv->font_options; } +/** + * clutter_backend_set_font_name: + * @backend: a #ClutterBackend + * @font_name: the name of the font + * + * Sets the default font to be used by Clutter. The @font_name string + * must either be %NULL, which means that the font name from the + * default #ClutterBackend will be used; or be something that can + * be parsed by the pango_font_description_from_string() function. + * + * Since: 1.0 + */ void clutter_backend_set_font_name (ClutterBackend *backend, const gchar *font_name) @@ -541,6 +553,18 @@ clutter_backend_set_font_name (ClutterBackend *backend, g_signal_emit (backend, backend_signals[FONT_CHANGED], 0); } +/** + * clutter_backend_get_font_name: + * @backend: a #ClutterBackend + * + * Retrieves the default font name as set by + * clutter_backend_set_font_name(). + * + * Return value: the font name for the backend. The returned string is + * owned by the #ClutterBackend and should never be modified or freed + * + * Since: 1.0 + */ G_CONST_RETURN gchar * clutter_backend_get_font_name (ClutterBackend *backend) { diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index fa094506a..2bda1aeea 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -478,6 +478,7 @@ clutter_actor_get_rotationx clutter_actor_grab_key_focus +clutter_actor_get_pango_context CLUTTER_TYPE_GEOMETRY @@ -872,14 +873,16 @@ clutter_behaviour_ellipse_get_type clutter-backend ClutterBackend clutter_get_default_backend -clutter_backend_get_resolution clutter_backend_set_resolution -clutter_backend_get_double_click_time +clutter_backend_get_resolution clutter_backend_set_double_click_time -clutter_backend_get_double_click_distance +clutter_backend_get_double_click_time clutter_backend_set_double_click_distance +clutter_backend_get_double_click_distance clutter_backend_set_font_options clutter_backend_get_font_options +clutter_backend_set_font_name +clutter_backend_get_font_name CLUTTER_BACKEND CLUTTER_IS_BACKEND