Skip to content

Commit 05f022c

Browse files
committed
test/test1.f90: prints the cairo_text_extents of the F
1 parent ae874c3 commit 05f022c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test1.f90

+7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
! Last modification: vmagnin, 2024-03-30
2+
13
program test1
24
use cairo
35
use cairo_enums
6+
use cairo_types
47

58
implicit none
69
type(c_ptr) :: surface, c
710
integer(c_int) :: r
11+
type(cairo_text_extents_t), target :: extents
812

913
! Initialize
1014
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 200, 200)
@@ -25,6 +29,9 @@ program test1
2529
call cairo_show_text(c, "F"//c_null_char)
2630
call cairo_stroke(c)
2731

32+
call cairo_text_extents(c, "F"//c_null_char, c_loc(extents))
33+
print '(A, 6F8.2)', "Cairo text extents: ", extents
34+
2835
! Write .png
2936
r = cairo_surface_write_to_png(surface, "F.png"//c_null_char)
3037

0 commit comments

Comments
 (0)