From d636a3bba350769259dd7804560bac708c2eab92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E5=AE=87?= Date: Tue, 20 Oct 2020 11:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L07CairoText/CMakeLists.txt | 4 ++-- L07CairoText/main.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/L07CairoText/CMakeLists.txt b/L07CairoText/CMakeLists.txt index 5aea9f4..714ac70 100644 --- a/L07CairoText/CMakeLists.txt +++ b/L07CairoText/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.17) -project(L07CairoCircle) +project(L07CairoText) set(CMAKE_CXX_STANDARD 14) @@ -19,4 +19,4 @@ link_libraries( cairo ) -add_executable(L07CairoCircle main.c) \ No newline at end of file +add_executable(L07CairoText main.c) \ No newline at end of file diff --git a/L07CairoText/main.c b/L07CairoText/main.c index 5057de7..f92aa2a 100644 --- a/L07CairoText/main.c +++ b/L07CairoText/main.c @@ -6,7 +6,11 @@ void draw(cairo_surface_t *cairosurf) { cairo_t *cr = cairo_create(cairosurf); - + cairo_select_font_face( + cr, "Sans", + CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_NORMAL + ); cairo_set_font_size(cr, FONT_SIZE); cairo_move_to(cr, 0, FONT_SIZE); cairo_show_text(cr, "Hello Cairo");