Skip to content

Commit 381a1b0

Browse files
committed
Merge branch 'topic/vadim/pangocairo' into 'master'
Subprogram to set default Pango/Cairo backend. See merge request eng/ide/gtkada!31
2 parents 2c87481 + ae38ace commit 381a1b0

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/pango-cairo.adb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- GtkAda - Ada95 binding for Gtk+/Gnome --
33
-- --
4-
-- Copyright (C) 2010-2018, AdaCore --
4+
-- Copyright (C) 2010-2025, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -26,6 +26,28 @@ with Glib.Object; use Glib.Object;
2626

2727
package body Pango.Cairo is
2828

29+
---------------------------
30+
-- Set_Default_Font_Type --
31+
---------------------------
32+
33+
procedure Set_Default_Font_Type
34+
(Font_Type : Standard.Cairo.Cairo_Font_Type)
35+
is
36+
function pango_cairo_font_map_new_for_font_type
37+
(fonttype : Standard.Cairo.Cairo_Font_Type) return System.Address with
38+
Import, Convention => C,
39+
Link_Name => "pango_cairo_font_map_new_for_font_type";
40+
41+
procedure pango_cairo_font_map_set_default
42+
(fontmap : System.Address) with
43+
Import, Convention => C,
44+
Link_Name => "pango_cairo_font_map_set_default";
45+
46+
begin
47+
pango_cairo_font_map_set_default
48+
(pango_cairo_font_map_new_for_font_type (Font_Type));
49+
end Set_Default_Font_Type;
50+
2951
-----------------
3052
-- Show_Layout --
3153
-----------------

src/pango-cairo.ads

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- GtkAda - Ada95 binding for Gtk+/Gnome --
33
-- --
4-
-- Copyright (C) 2010-2018, AdaCore --
4+
-- Copyright (C) 2010-2025, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify it --
77
-- under terms of the GNU General Public License as published by the Free --
@@ -37,4 +37,13 @@ package Pango.Cairo is
3737
-- Draws a pango layout in the specified cairo context. The top-left corner
3838
-- of Layout will be drawn at the current point of the cairo context.
3939

40+
procedure Set_Default_Font_Type (Font_Type : Standard.Cairo.Cairo_Font_Type);
41+
-- Sets the default fontmap used by default. This can be used to
42+
-- change the Cairo font backend that the default fontmap uses,
43+
-- for example. The old default font map is unreffed.
44+
-- Note that since Pango 1.32.6, the default fontmap is per-thread.
45+
-- This function only changes the default fontmap for the current thread.
46+
-- Default fontmaps of existing threads are not changed. Default fontmaps
47+
-- of any new threads will still be created using the default mechanism.
48+
4049
end Pango.Cairo;

0 commit comments

Comments
 (0)