<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0 elementToProof ContentPasted1">I
have a question, is someone using the file </span><code><span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0 elementToProof ContentPasted1"></span><span style="font-family: "Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.6667px;">cairo-ft.h</span></code><span style="font-family: "Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14.6667px;"></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted2">Kind
regards,</span><br style="background-color:rgb(255, 255, 255)" class="ContentPasted2">
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted2">--
Rafał</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="font-family:"Segoe UI Web (East European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><br>
</span></div>
<div id="signature_bookmark"></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Od:</b> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp><br>
<b>Wysłane:</b> sobota, 12 listopada 2022 13:05<br>
<b>Do:</b> Rafał Jopek <rafaljopek@hotmail.com>; cairo@cairographics.org <cairo@cairographics.org><br>
<b>Temat:</b> Re: [cairo] cairo-ft.h</font>
<div class="elementToProof"> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText elementToProof">What `pkg-config --cflags freetype2 cairo` would return in your environment?<br>
In my case, it returns like below.<br>
<br>
$ pkg-config --cflags freetype2 cairo<br>
-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16<br>
<br>
The code you pasted,<br>
<br>
> #include <cairo/cairo.h><br>
> #include <cairo/cairo-ft.h><br>
> //#include <cairo.h><br>
> //#include <cairo-ft.h><br>
> <br>
> #include <freetype2/ft2build.h><br>
> //#include <ft2build.h><br>
<br>
looks like the situation that CFLAGS was not set properly, and cannot find cairo.h or ft2build.h, and you might have tried to fix by a workaround in C source (and failed). Please check your `pkg-config --cflags freetype2 cairo` you wrote in Makefile<br>
<br>
Regards,<br>
mpsuzuki<br>
<br>
On 2022/11/12 18:35, Rafał Jopek wrote:<br>
> Hi,<br>
> <br>
> Maybe someone is trying to make a compilation of this simple codes<br>
> For me, it signals an error even though I have all the dependencies installed, we are talking about MSYS2<br>
> <br>
> ```<br>
> C:/msys64/mingw64/include/cairo/cairo-ft.h:46:10: fatal error: ft2build.h: No such file or directory<br>
> 46 | #include <ft2build.h><br>
> | ^~~~~~~~~~~~<br>
> ```<br>
> <br>
> free-type.c<br>
> <br>
> ```<br>
> <br>
> // free-type.c<br>
> #include <stdio.h><br>
> #include <stdlib.h><br>
> #include <cairo/cairo.h><br>
> #include <cairo/cairo-ft.h><br>
> //#include <cairo.h><br>
> //#include <cairo-ft.h><br>
> <br>
> #include <freetype2/ft2build.h><br>
> //#include <ft2build.h><br>
> <br>
> #include FT_SFNT_NAMES_H<br>
> #include FT_FREETYPE_H<br>
> #include FT_GLYPH_H<br>
> #include FT_OUTLINE_H<br>
> #include FT_BBOX_H<br>
> #include FT_TYPE1_TABLES_H<br>
> <br>
> int main()<br>
> {<br>
> FT_Library value;<br>
> FT_Error status;<br>
> FT_Face face;<br>
> <br>
> cairo_t *c;<br>
> cairo_surface_t *cs;<br>
> cairo_font_face_t * ct;<br>
> int size = 200;<br>
> <br>
> cs = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, size, size);<br>
> c = cairo_create (cs);<br>
> <br>
> const char * filename = "/usr/local/share/fonts/Droid/DroidSansFallbackFull.ttf";<br>
> <br>
> status = FT_Init_FreeType (& value);<br>
> if (status != 0) {<br>
> fprintf (stderr, "Error %d opening library.\n", status);<br>
> exit (EXIT_FAILURE);<br>
> }<br>
> status = FT_New_Face (value, filename, 0, & face);<br>
> if (status != 0) {<br>
> fprintf (stderr, "Error %d opening %s.\n", status, filename);<br>
> exit (EXIT_FAILURE);<br>
> }<br>
> ct = cairo_ft_font_face_create_for_ft_face (face, 0);<br>
> cairo_set_font_face (c, ct);<br>
> cairo_set_font_size (c, size/3);<br>
> cairo_set_source_rgb (c, 0, 0, 0);<br>
> cairo_move_to (c, size/6, size/3);<br>
> cairo_show_text (c, "あい");<br>
> cairo_set_source_rgb (c, 0.5, 0.5, 0);<br>
> cairo_move_to (c, size/6, 5*size/6);<br>
> cairo_show_text (c, "金柑");<br>
> cairo_surface_write_to_png (cs, "free-type.png");<br>
> return 0;<br>
> }<br>
> <br>
> <br>
> ```<br>
> <br>
> Makefile<br>
> <br>
> ```<br>
> <br>
> C=free-type.c<br>
> CFLAGS = -Wall -g `pkg-config --cflags freetype2 cairo`<br>
> LDFLAGS = `pkg-config --libs freetype2 cairo`<br>
> <br>
> all: free-type.png<br>
> <br>
> free-type.png: free-type<br>
> ./free-type<br>
> <br>
> free-type: $(C)<br>
> $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(C)<br>
> <br>
> clean:<br>
> -rm -f free-type free-type.png<br>
> <br>
> <br>
> ```<br>
> <br>
> <br>
> Kind regards,<br>
> -- Rafał<br>
> <br>
</div>
</span></font></div>
</body>
</html>