### PangoCairoshow_glyph_item Source: https://docs.gtk.org/PangoCairo/func.show_glyph_item.html Draws the glyphs in glyph_item in the specified cairo context, embedding the text associated with the glyphs in the output if the output format supports it (PDF for example), otherwise it acts similar to pango_cairo_show_glyph_string(). The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context. Note that text is the start of the text for layout, which is then indexed by glyph_item->item->offset. ```APIDOC ## void pango_cairo_show_glyph_item (cairo_t* cr, const char* text, PangoGlyphItem* glyph_item) ### Description Draws the glyphs in `glyph_item` in the specified cairo context, embedding the text associated with the glyphs in the output if the output format supports it (PDF for example), otherwise it acts similar to `pango_cairo_show_glyph_string()`. The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context. Note that `text` is the start of the text for layout, which is then indexed by `glyph_item->item->offset`. ### Method void ### Endpoint pango_cairo_show_glyph_item ### Parameters #### Path Parameters - **cr** (cairo_t*) - Required - A Cairo context. - **text** (const char*) - Required - The UTF-8 text that `glyph_item` refers to. The value is a NUL terminated UTF-8 string. - **glyph_item** (PangoGlyphItem*) - Required - A `PangoGlyphItem`. ### Request Example ```json { "cr": "cairo_t*", "text": "string", "glyph_item": "PangoGlyphItem*" } ``` ### Response #### Success Response (200) - **void** - This function does not return a value. #### Response Example ```json { "message": "Operation successful" } ``` ``` -------------------------------- ### GET pango_cairo_context_get_resolution Source: https://docs.gtk.org/PangoCairo/func.context_get_resolution.html Retrieves the resolution in dots per inch (DPI) currently set for the specified PangoCairo context. ```APIDOC ## GET pango_cairo_context_get_resolution ### Description Gets the resolution for the context. A negative value is returned if no resolution has been set. ### Method GET ### Parameters #### Path Parameters - **context** (PangoContext) - Required - A PangoContext, from a pangocairo font map. ### Response #### Success Response (200) - **return** (double) - The resolution in dots per inch. ``` -------------------------------- ### PangoCairoFontMapget_resolution Source: https://docs.gtk.org/PangoCairo/method.FontMap.get_resolution.html Gets the resolution for the fontmap. This function is available since Pango version 1.10. ```APIDOC ## PangoCairoFontMapget_resolution ### Description Gets the resolution for the fontmap. See `pango_cairo_font_map_set_resolution()`. ### Method N/A (This is a function signature, not a REST endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) - **Return value** (double) - The resolution in “dots per inch”. #### Response Example N/A ``` -------------------------------- ### GET pango_cairo_context_get_shape_renderer Source: https://docs.gtk.org/PangoCairo/func.context_get_shape_renderer.html Retrieves the callback function and associated user data for rendering attributes of type PANGO_ATTR_SHAPE. ```APIDOC ## GET pango_cairo_context_get_shape_renderer ### Description Retrieves the callback function and associated user data for rendering attributes of type PANGO_ATTR_SHAPE as set by pango_cairo_context_set_shape_renderer(), if any. ### Parameters #### Path Parameters - **context** (PangoContext) - Required - A PangoContext, from a pangocairo font map. - **data** (gpointer*) - Required - Pointer to gpointer to return user data. ### Response #### Success Response (200) - **Return value** (PangoCairoShapeRendererFunc) - The shape rendering callback previously set on the context, or NULL if no shape rendering callback have been set. ``` -------------------------------- ### PangoCairoFontget_scaled_font Source: https://docs.gtk.org/PangoCairo/method.Font.get_scaled_font.html Gets the cairo_scaled_font_t used by PangoCairoFont. The scaled font can be referenced and kept using cairo_scaled_font_reference(). ```APIDOC ## GET PangoCairoFontget_scaled_font ### Description Gets the `cairo_scaled_font_t` used by `font`. The scaled font can be referenced and kept using `cairo_scaled_font_reference()`. ### Method GET ### Endpoint /websites/gtk_pangocairo/pango_cairo_font_get_scaled_font ### Parameters #### Path Parameters - **font** (PangoCairoFont) - Required - A `PangoFont` from a `PangoCairoFontMap`. The argument can be `NULL`. ### Response #### Success Response (200) - **cairo_scaled_font_t** - The `cairo_scaled_font_t` used by `font`. The returned data is owned by the instance. The return value can be `NULL`. ``` -------------------------------- ### GET pango_cairo_font_map_get_font_type Source: https://docs.gtk.org/PangoCairo/method.FontMap.get_font_type.html Retrieves the type of Cairo font backend currently utilized by the specified PangoCairoFontMap. ```APIDOC ## GET pango_cairo_font_map_get_font_type ### Description Gets the type of Cairo font backend that the provided fontmap uses. ### Method GET ### Endpoint pango_cairo_font_map_get_font_type(PangoCairoFontMap* fontmap) ### Parameters #### Path Parameters - **fontmap** (PangoCairoFontMap*) - Required - The PangoCairoFontMap instance to query. ### Response #### Success Response (200) - **cairo_font_type_t** (enum) - The Cairo font backend type used by the fontmap. ``` -------------------------------- ### PangoCairoFontMapget_default Source: https://docs.gtk.org/PangoCairo/type_func.FontMap.get_default.html Gets the default PangoCairoFontMap for the current thread. This map is used by Cairo for font rendering. The type of the returned object depends on the Cairo font backend. The default font map can be changed using pango_cairo_font_map_set_default(). Since Pango 1.32.6, the default font map is per-thread, allowing safe usage across multiple threads. ```APIDOC ## PangoCairoFontMapget_default ### Description Gets a default `PangoCairoFontMap` to use with Cairo. The type of the returned object will depend on the particular font backend Cairo was compiled to use; you generally should only use the `PangoFontMap` and `PangoCairoFontMap` interfaces on the returned object. The default Cairo fontmap can be changed by using `pango_cairo_font_map_set_default()`. This can be used to change the Cairo font backend that the default fontmap uses for example. Note that since Pango 1.32.6, the default fontmap is per-thread. Each thread gets its own default fontmap. In this way, PangoCairo can be used safely from multiple threads. ### Method GET ### Endpoint /websites/gtk_pangocairo ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **PangoFontMap** (PangoFontMap*) - The default PangoCairo fontmap for the current thread. This object is owned by Pango and must not be freed. #### Response Example ```json { "font_map": "" } ``` ``` -------------------------------- ### Render text in a circle with Pango and Cairo Source: https://docs.gtk.org/PangoCairo/pango_cairo.html Demonstrates creating a PangoLayout, applying transformations to a Cairo context, and rendering text in a circular pattern. ```c #include #include #define RADIUS 150 #define N_WORDS 10 #define FONT "Sans Bold 27" static void draw_text (cairo_t *cr) { PangoLayout *layout; PangoFontDescription *desc; int i; /* Center coordinates on the middle of the region we are drawing */ cairo_translate (cr, RADIUS, RADIUS); /* Create a PangoLayout, set the font and text */ layout = pango_cairo_create_layout (cr); pango_layout_set_text (layout, "Text", -1); desc = pango_font_description_from_string (FONT); pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); /* Draw the layout N_WORDS times in a circle */ for (i = 0; i < N_WORDS; i++) { int width, height; double angle = (360. * i) / N_WORDS; double red; cairo_save (cr); /* Gradient from red at angle == 60 to blue at angle == 240 */ red = (1 + cos ((angle - 60) * G_PI / 180.)) / 2; cairo_set_source_rgb (cr, red, 0, 1.0 - red); cairo_rotate (cr, angle * G_PI / 180.); /* Inform Pango to re-layout the text with the new transformation */ pango_cairo_update_layout (cr, layout); pango_layout_get_size (layout, &width, &height); cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS); pango_cairo_show_layout (cr, layout); cairo_restore (cr); } /* free the layout object */ g_object_unref (layout); } int main (int argc, char **argv) { cairo_t *cr; char *filename; cairo_status_t status; cairo_surface_t *surface; if (argc != 2) { g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n"); return 1; } filename = argv[1]; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 2 * RADIUS, 2 * RADIUS); cr = cairo_create (surface); cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_paint (cr); draw_text (cr); cairo_destroy (cr); status = cairo_surface_write_to_png (surface, filename); cairo_surface_destroy (surface); if (status != CAIRO_STATUS_SUCCESS) { g_printerr ("Could not save png to '%s'\n", filename); return 1; } return 0; } ``` -------------------------------- ### PangoCairo FontMap Instance Methods Source: https://docs.gtk.org/PangoCairo/iface.FontMap.html Methods for interacting with PangoCairoFontMap instances, including resolution and context management. ```APIDOC ## Instance Methods ### pango_cairo_font_map_create_context - Description: Create a PangoContext for the given fontmap. - Status: Deprecated (1.22), Since: 1.10 ### pango_cairo_font_map_get_font_type - Description: Gets the type of Cairo font backend that fontmap uses. - Since: 1.18 ### pango_cairo_font_map_get_resolution - Description: Gets the resolution for the fontmap. - Since: 1.10 ### pango_cairo_font_map_set_default - Description: Sets a default PangoCairoFontMap to use with Cairo. - Since: 1.22 ### pango_cairo_font_map_set_resolution - Description: Sets the resolution for the fontmap. - Since: 1.10 ``` -------------------------------- ### void pango_cairo_show_layout_line Source: https://docs.gtk.org/PangoCairo/func.show_layout_line.html Draws a PangoLayoutLine in the specified cairo context at the current point. ```APIDOC ## void pango_cairo_show_layout_line ### Description Draws a PangoLayoutLine in the specified cairo context. The origin of the glyphs (the left edge of the line) will be drawn at the current point of the cairo context. ### Parameters - **cr** (cairo_t*) - Required - A Cairo context. - **line** (PangoLayoutLine*) - Required - A PangoLayoutLine. ``` -------------------------------- ### Create New PangoCairoFontMap Source: https://docs.gtk.org/PangoCairo/type_func.FontMap.new.html Creates a new PangoCairoFontMap object. Use PangoCairo.font_map_get_default in most cases. The returned object type depends on the Cairo backend. You can override the backend type using the PANGOCAIRO_BACKEND environment variable. ```c PangoFontMap* pango_cairo_font_map_new ( void ) ``` -------------------------------- ### PangoCairoshow_layout Source: https://docs.gtk.org/PangoCairo/func.show_layout.html Draws a PangoLayout in the specified cairo context. The top-left corner of the PangoLayout will be drawn at the current point of the cairo context. ```APIDOC ## void pango_cairo_show_layout (cairo_t* cr, PangoLayout* layout) ### Description Draws a `PangoLayout` in the specified cairo context. The top-left corner of the `PangoLayout` will be drawn at the current point of the cairo context. Available since: 1.10 ### Method void ### Endpoint pango_cairo_show_layout ### Parameters #### Path Parameters - **cr** (cairo_t) - Required - A Cairo context. - **layout** (PangoLayout) - Required - A Pango layout. ### Request Example ```json { "cr": "cairo_t*", "layout": "PangoLayout*" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "message": "Layout displayed successfully" } ``` ``` -------------------------------- ### PangoCairolayout_path Source: https://docs.gtk.org/PangoCairo/func.layout_path.html Adds the text in a PangoLayout to the current path in the specified cairo context. The top-left corner of the PangoLayout will be at the current point of the cairo context. ```APIDOC ## PangoCairolayout_path ### Description Adds the text in a `PangoLayout` to the current path in the specified cairo context. The top-left corner of the `PangoLayout` will be at the current point of the cairo context. ### Method void ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (void) This function does not return a value. #### Response Example None ``` -------------------------------- ### Declare PangoCairoFontMapcreate_context Source: https://docs.gtk.org/PangoCairo/method.FontMap.create_context.html This is the declaration for the PangoCairoFontMapcreate_context method. Use pango_font_map_create_context() instead as this method is deprecated. ```c PangoContext* pango_cairo_font_map_create_context ( PangoCairoFontMap* fontmap ) ``` -------------------------------- ### PangoCairo create_layout Source: https://docs.gtk.org/PangoCairo/func.create_layout.html Creates a layout object set up to match the current transformation and target surface of the Cairo context. This layout can then be used for text measurement or drawing. ```APIDOC ## POST /pango_cairo_create_layout ### Description Creates a layout object set up to match the current transformation and target surface of the Cairo context. This layout can then be used for text measurement with functions like `pango_layout_get_size()` or drawing with functions like `pango_cairo_show_layout()`. ### Method POST ### Endpoint /pango_cairo_create_layout ### Parameters #### Request Body - **cr** (cairo_t*) - Required - A Cairo context. ### Request Example { "cr": "" } ### Response #### Success Response (200) - **PangoLayout*** (PangoLayout*) - The newly created PangoLayout object. #### Response Example { "layout": "" } ``` -------------------------------- ### PangoCairolayout_line_path Source: https://docs.gtk.org/PangoCairo/func.layout_line_path.html Adds the text in PangoLayoutLine to the current path in the specified cairo context. ```APIDOC ## PangoCairolayout_line_path ### Description Adds the text in `PangoLayoutLine` to the current path in the specified cairo context. The origin of the glyphs (the left edge of the line) will be at the current point of the cairo context. Available since: 1.10 ### Method void ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### PangoCairoFontMapcreate_context Source: https://docs.gtk.org/PangoCairo/method.FontMap.create_context.html Creates a PangoContext for the given fontmap. This method is deprecated and should not be used in new code. Use pango_font_map_create_context() instead. This method is not directly available to language bindings. ```APIDOC ## POST /websites/gtk_pangocairo/PangoCairoFontMapcreate_context ### Description Create a `PangoContext` for the given fontmap. ### Method POST ### Endpoint /websites/gtk_pangocairo/PangoCairoFontMapcreate_context ### Parameters #### Path Parameters - **fontmap** (PangoCairoFontMap) - Required - The font map to create the context from. ### Request Body ```json { "fontmap": "PangoCairoFontMap" } ``` ### Response #### Success Response (200) - **PangoContext** (PangoContext) - The newly created context; free with g_object_unref(). The returned data is owned by the instance. #### Response Example ```json { "PangoContext": "PangoContext" } ``` ``` -------------------------------- ### PangoCairo FontMap Functions Source: https://docs.gtk.org/PangoCairo/iface.FontMap.html Functions for creating and retrieving PangoCairo font map instances. ```APIDOC ## Functions ### pango_cairo_font_map_get_default - Description: Gets a default PangoCairoFontMap to use with Cairo. - Since: 1.10 ### pango_cairo_font_map_new - Description: Creates a new PangoCairoFontMap object. - Since: 1.10 ### pango_cairo_font_map_new_for_font_type - Description: Creates a new PangoCairoFontMap object of the type suitable to be used with cairo font backend of type fonttype. - Parameters: fonttype (type) - Required - Since: 1.18 ``` -------------------------------- ### PangoCairoFontMapNew Source: https://docs.gtk.org/PangoCairo/type_func.FontMap.new.html Creates a new PangoCairoFontMap object. This object is used to cache font information and global parameters like resolution. It's generally recommended to use PangoCairoFontMapGetDefault instead. ```APIDOC ## PangoCairoFontMapNew ### Description Creates a new `PangoCairoFontMap` object. A fontmap is used to cache information about available fonts, and holds certain global parameters such as the resolution. In most cases, you can use `func@PangoCairo.font_map_get_default] instead. Note that the type of the returned object will depend on the particular font backend Cairo was compiled to use; You generally should only use the `PangoFontMap` and `PangoCairoFontMap` interfaces on the returned object. You can override the type of backend returned by using an environment variable `PANGOCAIRO_BACKEND`. Supported types, based on your build, are fc (fontconfig), win32, and coretext. If requested type is not available, NULL is returned. Ie. this is only useful for testing, when at least two backends are compiled in. ### Method void ### Endpoint N/A (Function call) ### Parameters None ### Return value _Type:_ `PangoFontMap` The newly allocated `PangoFontMap`, which should be freed with g_object_unref(). The caller of the function takes ownership of the data, and is responsible for freeing it. ``` -------------------------------- ### void pango_cairo_error_underline_path Source: https://docs.gtk.org/PangoCairo/func.error_underline_path.html Adds a squiggly line to the current path in a cairo context to indicate a spelling error. ```APIDOC ## void pango_cairo_error_underline_path ### Description Add a squiggly line to the current path in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle. ### Parameters - **cr** (cairo_t*) - Required - A Cairo context. - **x** (double) - Required - The X coordinate of one corner of the rectangle. - **y** (double) - Required - The Y coordinate of one corner of the rectangle. - **width** (double) - Required - Non-negative width of the rectangle. - **height** (double) - Required - Non-negative height of the rectangle. ``` -------------------------------- ### pango_cairo_create_context Source: https://docs.gtk.org/PangoCairo/func.create_context.html Creates a PangoContext object configured to match the transformation and target surface of a given Cairo context. ```APIDOC ## pango_cairo_create_context ### Description Creates a context object set up to match the current transformation and target surface of the Cairo context. This context can then be used to create a layout using pango_layout_new(). ### Parameters #### Path Parameters - **cr** (cairo_t*) - Required - A Cairo context. ### Return Value - **PangoContext*** - The newly created PangoContext. The caller takes ownership of the data and is responsible for freeing it. ``` -------------------------------- ### Pango Cairo Functions Source: https://docs.gtk.org/PangoCairo/index.html This section covers the various functions available in the Pango Cairo 1.0 library for rendering text and glyphs using Cairo contexts. ```APIDOC ## Pango Cairo Functions ### Description Provides functions to integrate Pango text rendering with Cairo graphics contexts. ### Functions #### `pango_cairo_context_get_font_options` * **Description**: Retrieves any font rendering options previously set with `pango_cairo_context_set_font_options()`. * **Since**: 1.10 #### `pango_cairo_context_get_resolution` * **Description**: Gets the resolution for the context. * **Since**: 1.10 #### `pango_cairo_context_get_shape_renderer` * **Description**: Sets callback function for context to use for rendering attributes of type `PANGO_ATTR_SHAPE`. * **Since**: 1.18 #### `pango_cairo_context_set_font_options` * **Description**: Sets the font options used when rendering text with this context. * **Since**: 1.10 #### `pango_cairo_context_set_resolution` * **Description**: Sets the resolution for the context. * **Since**: 1.10 #### `pango_cairo_context_set_shape_renderer` * **Description**: Sets callback function for context to use for rendering attributes of type `PANGO_ATTR_SHAPE`. * **Since**: 1.18 #### `pango_cairo_create_context` * **Description**: Creates a context object set up to match the current transformation and target surface of the Cairo context. * **Since**: 1.22 #### `pango_cairo_create_layout` * **Description**: Creates a layout object set up to match the current transformation and target surface of the Cairo context. * **Since**: 1.10 #### `pango_cairo_error_underline_path` * **Description**: Add a squiggly line to the current path in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. * **Since**: 1.14 #### `pango_cairo_glyph_string_path` * **Description**: Adds the glyphs in `glyphs` to the current path in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_layout_line_path` * **Description**: Adds the text in `PangoLayoutLine` to the current path in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_layout_path` * **Description**: Adds the text in a `PangoLayout` to the current path in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_show_error_underline` * **Description**: Draw a squiggly line in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. * **Since**: 1.14 #### `pango_cairo_show_glyph_item` * **Description**: Draws the glyphs in `glyph_item` in the specified cairo context. * **Since**: 1.22 #### `pango_cairo_show_glyph_string` * **Description**: Draws the glyphs in `glyphs` in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_show_layout` * **Description**: Draws a `PangoLayout` in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_show_layout_line` * **Description**: Draws a `PangoLayoutLine` in the specified cairo context. * **Since**: 1.10 #### `pango_cairo_update_context` * **Description**: Updates a `PangoContext` previously created for use with Cairo to match the current transformation and target surface of a Cairo context. * **Since**: 1.10 #### `pango_cairo_update_layout` * **Description**: Updates the private `PangoContext` of a `PangoLayout` created with `pango_cairo_create_layout()` to match the current transformation and target surface of a Cairo context. * **Since**: 1.10 ``` -------------------------------- ### PangoCairoFont Interface Source: https://docs.gtk.org/PangoCairo/iface.Font.html Details about the PangoCairoFont interface, its purpose, and how it extends Pango.Font. ```APIDOC ## PangoCairoFont Interface ### Description `PangoCairoFont` is an interface exported by fonts for use with Cairo. The actual type of the font will depend on the particular font technology Cairo was compiled to use. Available since: 1.18 ### Prerequisite In order to implement Font, your type must inherit from `PangoFont`. ### Instance methods #### pango_cairo_font_get_scaled_font Gets the `cairo_scaled_font_t` used by `font`. The scaled font can be referenced and kept using `cairo_scaled_font_reference()`. Available since: 1.18 ``` -------------------------------- ### void pango_cairo_update_layout Source: https://docs.gtk.org/PangoCairo/func.update_layout.html Updates the private PangoContext of a PangoLayout to match the current transformation and target surface of a Cairo context. ```APIDOC ## void pango_cairo_update_layout ### Description Updates the private PangoContext of a PangoLayout created with pango_cairo_create_layout() to match the current transformation and target surface of a Cairo context. ### Parameters #### Path Parameters - **cr** (cairo_t) - Required - A Cairo context. - **layout** (PangoLayout) - Required - A PangoLayout, from pango_cairo_create_layout(). ``` -------------------------------- ### Set PangoCairo Context Resolution Source: https://docs.gtk.org/PangoCairo/func.context_set_resolution.html Configures the resolution for a PangoContext. A value of 0 or less resets the resolution to the font map's default. ```C void pango_cairo_context_set_resolution ( PangoContext* context, double dpi ) ``` -------------------------------- ### Pango Cairo Callbacks Source: https://docs.gtk.org/PangoCairo/index.html Information about the callback function type for rendering shape attributes. ```APIDOC ## Pango Cairo Callbacks ### Description Callback function types used in Pango Cairo. ### Callbacks #### `ShapeRendererFunc` * **Description**: Function type for rendering attributes of type `PANGO_ATTR_SHAPE` with Pango’s Cairo renderer. ``` -------------------------------- ### PangoCairocontext_get_font_options Source: https://docs.gtk.org/PangoCairo/func.context_get_font_options.html Retrieves any font rendering options previously set with pango_cairo_context_set_font_options(). This function does not report options that are derived from the target surface by pango_cairo_update_context(). ```APIDOC ## PangoCairocontext_get_font_options ### Description Retrieves any font rendering options previously set with `pango_cairo_context_set_font_options()`. This function does not report options that are derived from the target surface by `pango_cairo_update_context()`. Available since: 1.10 ### Method GET ### Endpoint N/A (This is a function call, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (cairo_font_options_t) - The font options previously set on the context, or NULL if no options have been set. This value is owned by the context and must not be modified or freed. #### Response Example ```json { "example": "cairo_font_options_t* options = pango_cairo_context_get_font_options(context);" } ``` ``` -------------------------------- ### Pango Cairo Interfaces Source: https://docs.gtk.org/PangoCairo/index.html Details on the interfaces provided by Pango Cairo for font and font map integration with Cairo. ```APIDOC ## Pango Cairo Interfaces ### Description Interfaces for integrating Pango fonts and font maps with Cairo. ### Interfaces #### `PangoCairoFont` * **Description**: An interface exported by fonts for use with Cairo. * **Since**: 1.18 #### `PangoCairoFontMap` * **Description**: An interface exported by font maps for use with Cairo. * **Since**: 1.10 ``` -------------------------------- ### void pango_cairo_update_context Source: https://docs.gtk.org/PangoCairo/func.update_context.html Updates a PangoContext to match the current transformation and target surface of a Cairo context. ```APIDOC ## void pango_cairo_update_context ### Description Updates a PangoContext previously created for use with Cairo to match the current transformation and target surface of a Cairo context. If any layouts have been created for the context, it is necessary to call pango_layout_context_changed() on those layouts. ### Parameters - **cr** (cairo_t) - Required - A Cairo context. - **context** (PangoContext) - Required - A PangoContext, from a pangocairo font map. ``` -------------------------------- ### PangoCairoshow_glyph_string Source: https://docs.gtk.org/PangoCairo/func.show_glyph_string.html Draws the glyphs in `glyphs` in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context. ```APIDOC ## PangoCairoshow_glyph_string ### Description Draws the glyphs in `glyphs` in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context. ### Method void ### Endpoint N/A (Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (void) This function does not return a value. #### Response Example None ### Parameters - **cr** (cairo_t) - Required - A Cairo context. - **font** (PangoFont) - Required - A PangoFont from a PangoCairoFontMap. - **glyphs** (PangoGlyphString) - Required - A PangoGlyphString. ``` -------------------------------- ### PangoCairoFontMapset_default Source: https://docs.gtk.org/PangoCairo/method.FontMap.set_default.html Sets a default PangoCairoFontMap to use with Cairo. This can be used to change the Cairo font backend that the default fontmap uses. Note that since Pango 1.32.6, the default fontmap is per-thread. This function only changes the default fontmap for the current thread. A value of NULL for fontmap will cause the current default font map to be released and a new default font map to be created on demand. ```APIDOC ## void pango_cairo_font_map_set_default ### Description Sets a default `PangoCairoFontMap` to use with Cairo. This can be used to change the Cairo font backend that the default fontmap uses for example. The old default font map is unreffed and the new font map referenced. Note that since Pango 1.32.6, the default fontmap is per-thread. This function only changes the default fontmap for the current thread. Default fontmaps of existing threads are not changed. Default fontmaps of any new threads will still be created using `pango_cairo_font_map_new()`. A value of `NULL` for `fontmap` will cause the current default font map to be released and a new default font map to be created on demand, using `pango_cairo_font_map_new()`. Available since: 1.22 ### Method void ### Endpoint pango_cairo_font_map_set_default ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ### Parameters `fontmap` (PangoCairoFontMap) - The new default font map. The argument can be `NULL`. ``` -------------------------------- ### PangoCairoglyph_string_path Source: https://docs.gtk.org/PangoCairo/func.glyph_string_path.html Adds the glyphs in `glyphs` to the current path in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be at the current point of the cairo context. ```APIDOC ## PangoCairoglyph_string_path ### Description Adds the glyphs in `glyphs` to the current path in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be at the current point of the cairo context. ### Method void ### Endpoint N/A (This is a function, not an API endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None (This function returns void) #### Response Example None ### Parameters - **cr** (cairo_t) - A Cairo context. The data is owned by the caller of the function. - **font** (PangoFont) - A `PangoFont` from a `PangoCairoFontMap`. The data is owned by the caller of the function. - **glyphs** (PangoGlyphString) - A `PangoGlyphString`. The data is owned by the caller of the function. ### Availability Available since: 1.10 ``` -------------------------------- ### pango_cairo_context_set_resolution Source: https://docs.gtk.org/PangoCairo/func.context_set_resolution.html Sets the resolution for the PangoCairo context, determining the scale factor between points and Cairo units. ```APIDOC ## pango_cairo_context_set_resolution ### Description Sets the resolution for the context. This is a scale factor between points specified in a PangoFontDescription and Cairo units. The default value is 96. ### Parameters - **context** (PangoContext) - Required - A PangoContext from a pangocairo font map. - **dpi** (double) - Required - The resolution in dots per inch. A 0 or negative value uses the resolution from the font map. ``` -------------------------------- ### pango_cairo_font_map_new_for_font_type Source: https://docs.gtk.org/PangoCairo/type_func.FontMap.new_for_font_type.html Creates a new PangoCairoFontMap object suitable for the specified Cairo font backend type. ```APIDOC ## pango_cairo_font_map_new_for_font_type ### Description Creates a new PangoCairoFontMap object of the type suitable to be used with cairo font backend of type fonttype. ### Parameters #### Path Parameters - **fonttype** (cairo_font_type_t) - Required - Desired cairo_font_type_t. ### Response #### Success Response - **Return Value** (PangoFontMap) - The newly allocated PangoFontMap of suitable type which should be freed with g_object_unref(), or NULL if the requested cairo font backend is not supported. ``` -------------------------------- ### void pango_cairo_context_set_shape_renderer Source: https://docs.gtk.org/PangoCairo/func.context_set_shape_renderer.html Sets a callback function for the PangoContext to use when rendering attributes of type PANGO_ATTR_SHAPE. ```APIDOC ## void pango_cairo_context_set_shape_renderer ### Description Sets a callback function for the context to use for rendering attributes of type PANGO_ATTR_SHAPE. Available since version 1.18. ### Parameters - **context** (PangoContext) - Required - A PangoContext, from a pangocairo font map. - **func** (PangoCairoShapeRendererFunc) - Optional - Callback function for rendering attributes of type PANGO_ATTR_SHAPE, or NULL to disable shape rendering. - **data** (gpointer) - Optional - User data that will be passed to func. - **dnotify** (GDestroyNotify) - Optional - Callback that will be called when the context is freed to release data. ``` -------------------------------- ### pango_cairo_context_set_font_options Source: https://docs.gtk.org/PangoCairo/func.context_set_font_options.html Sets the font options used when rendering text with a PangoCairo context, overriding options derived from the target surface. ```APIDOC ## pango_cairo_context_set_font_options ### Description Sets the font options used when rendering text with this context. These options override any options that pango_cairo_update_context() derives from the target surface. ### Parameters - **context** (PangoContext) - Required - A PangoContext, from a pangocairo font map. - **options** (cairo_font_options_t) - Optional - A cairo_font_options_t, or NULL to unset any previously set options. A copy is made. ``` -------------------------------- ### pango_cairo_show_error_underline Source: https://docs.gtk.org/PangoCairo/func.show_error_underline.html Draws a squiggly line in a cairo context to indicate a spelling error within a specified rectangle. ```APIDOC ## pango_cairo_show_error_underline ### Description Draw a squiggly line in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle. ### Parameters - **cr** (cairo_t*) - Required - A Cairo context. - **x** (double) - Required - The X coordinate of one corner of the rectangle. - **y** (double) - Required - The Y coordinate of one corner of the rectangle. - **width** (double) - Required - Non-negative width of the rectangle. - **height** (double) - Required - Non-negative height of the rectangle. ### Since 1.14 ``` -------------------------------- ### PangoCairoFontMapset_resolution Source: https://docs.gtk.org/PangoCairo/method.FontMap.set_resolution.html Sets the resolution for the fontmap. This is a scale factor between points specified in a PangoFontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3). Available since: 1.10 ```APIDOC ## void pango_cairo_font_map_set_resolution ### Description Sets the resolution for the fontmap. This is a scale factor between points specified in a `PangoFontDescription` and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3). ### Method void ### Endpoint pango_cairo_font_map_set_resolution ### Parameters #### Path Parameters - **fontmap** (PangoCairoFontMap*) - Required - The PangoCairoFontMap to set the resolution for. - **dpi** (double) - Required - The resolution in “dots per inch”. (Physical inches aren’t actually involved; the terminology is conventional.). ### Request Example { "fontmap": "", "dpi": 96.0 } ### Response #### Success Response (200) - **None** - This method does not return a value. #### Response Example null ``` -------------------------------- ### PangoCairoShapeRendererFunc Source: https://docs.gtk.org/PangoCairo/callback.ShapeRendererFunc.html Function type definition for rendering shape attributes using the Pango Cairo renderer. ```APIDOC ## PangoCairoShapeRendererFunc ### Description Function type for rendering attributes of type PANGO_ATTR_SHAPE with Pango’s Cairo renderer. ### Parameters - **cr** (cairo_t*) - A Cairo context with current point set to where the shape should be rendered. - **attr** (PangoAttrShape*) - The PANGO_ATTR_SHAPE to render. - **do_path** (gboolean) - Whether only the shape path should be appended to current path of cr and no filling/stroking done. - **data** (gpointer) - User data passed to pango_cairo_context_set_shape_renderer(). ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.