Cairo DLL creation

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
UEZ
Posts: 994
Joined: May 05, 2017 19:59
Location: Germany

Cairo DLL creation

Post by UEZ »

Hi,

can somebody please compile the latest Cairo code to create one Windows DLL for x64 / x86? I'm too silly to do it by my self.
Output should be one DLL same as here: https://github.com/preshing/cairo-windows/releases. Unfortunately preshing stopped creating the DLLs in 2020...

Source can be found here: https://www.cairographics.org/download/

THANKS :!:
srvaldez
Posts: 3384
Joined: Sep 25, 2005 21:54

Re: Cairo DLL creation

Post by srvaldez »

hello UEZ
I tried building the dll but the source is only a build script, the script downloads the source for cairo, pixman, png and zlib
the problem is that the Visual Studio project files are not included, it tries to download the project files from dev.com which seems to be extinct
I tried to contact Jeff Preshing but so far I have no response, I don't have the skills to re-invent those project files and then build the cairo dll
you can simply use the cairo dll from the msys2 distribution but it has at least half a dozen dll dependencies, I can sort out the dependencies and package them for you if you want
UEZ
Posts: 994
Joined: May 05, 2017 19:59
Location: Germany

Re: Cairo DLL creation

Post by UEZ »

@srvaldez: thank you very much for looking into this. libcairo-2.dll exists in several programs, such as Inkscape, GIMP, etc. in the latest version 1.18.0.
I've written an Autoit script which gets the DLL dependencies recursively from a DLL. :D Maybe I will port it to FB...

For example libcairo-2.dll from Inkscape loads 18 additional DLLs - total ~17 mb incl. libcairo-2.dll.
  • libbrotlicommon.dll
    libbrotlidec.dll
    libbz2-1.dll
    libcairo-2.dll
    libexpat-1.dll
    libfontconfig-1.dll
    libfreetype-6.dll
    libgcc_s_dw2-1.dll
    libglib-2.0-0.dll
    libgraphite2.dll
    libharfbuzz-0.dll
    libiconv-2.dll
    libintl-8.dll
    libpcre2-8-0.dll
    libpixman-1-0.dll
    libpng16-16.dll
    libstdc++-6.dll
    libwinpthread-1.dll
    zlib1.dll
The bold marked are imported into libcairo-2.dll.

The one DLL solution provided by Jeff Preshing is the elegant and smallest solution.
Roland Chastain
Posts: 1008
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Cairo DLL creation

Post by Roland Chastain »

Found something that looks interesting: https://sourceforge.net/projects/graphiclibs/
srvaldez
Posts: 3384
Joined: Sep 25, 2005 21:54

Re: Cairo DLL creation

Post by srvaldez »

hello Roland Chastain
this looks promising, but the cairo version that's included in their build is version 1.16.0, it remains to be seen if it will build the latest version

Code: Select all

#include "cairo\Cairo.bi"

? *cairo_version_string
Sleep
Roland Chastain
Posts: 1008
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Cairo DLL creation

Post by Roland Chastain »

Hello srvaldez. Yes. I made a quick attempt with Cairo 1.18.0, without success.

makefile.mingw:15: cairo-1.18.0/build/Makefile.win32.features: No such file or directory
makefile.mingw:17: cairo-1.18.0/src/Makefile.win32.features: No such file or directory
makefile.mingw:18: cairo-1.18.0/src/Makefile.sources: No such file or directory
mingw32-make: *** No rule to make target 'cairo-1.18.0/src/Makefile.sources'. Stop.


Thank you for the code example.
Roland Chastain
Posts: 1008
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Cairo DLL creation

Post by Roland Chastain »

While we are looking for a solution, I tried to write some reusable code to show nicely Cairo version in all programs. The method for drawing the rectangle comes from a C example shipped with Cairo source.

Code: Select all

' cairocolor.bi

type tcairocolor
  r as double
  g as double
  b as double
  a as double
  declare constructor(as uinteger, as double = 1.0)
  declare constructor(as double, as double, as double, as double = 1.0)
end type

constructor tcairocolor(rgb_ as uinteger, a_ as double)
  r = (rgb_ and &hFF0000) / &hFF0000
  g = (rgb_ and &h00FF00) / &h00FF00
  b = (rgb_ and &h0000FF) / &h0000FF
  a = a_
end constructor

constructor tcairocolor(r_ as double, g_ as double, b_ as double, a_ as double)
  r = r_
  g = g_
  b = b_
  a = a_
end constructor

/'
dim c1 as tcairocolor = tcairocolor(rgb(&HFF, &H00, &HFF))

with c1
  print(.r)
  print(.g)
  print(.b)
  print(.a)
end with

dim c2 as tcairocolor = tcairocolor(rgb(&HFF, &H00, &HFF), 0.5)

with c2
  print(.r)
  print(.g)
  print(.b)
  print(.a)
end with

dim c3 as tcairocolor = tcairocolor(1.0, 1.0, 1.0, 0.5)

with c3
  print(.r)
  print(.g)
  print(.b)
  print(.a)
end with
'/

Code: Select all

' cairoversion.bas

#include once "cairo/cairo.bi"
#include once "cairocolor.bi"

sub DrawMain(cr as cairo_t ptr)
' Repaint surface
  cairo_set_source_rgb(cr, 1.0, 0.0, 1.0)
  cairo_paint(cr)
' Select font
  cairo_select_font_face(cr, "Palatino Linotype", 0, 0)
  cairo_set_font_size(cr, 20)
end sub

sub DrawText(cr as cairo_t ptr, text as string, x as double, y as double, rect_color as tcairocolor, text_color as tcairocolor)
  dim as cairo_text_extents_t te
  cairo_text_extents(cr, text, @te)
  
  dim as double lw = cairo_get_line_width(cr)
  
  y -= te.y_bearing ' So that y be the top of rectangle
  
  cairo_save(cr)
  
' Draw rectangle
  cairo_rectangle(cr, x + te.x_bearing - lw, y + te.y_bearing - lw, te.width + 2 * lw, te.height + 2 * lw)
  with rect_color
  cairo_set_source_rgba(cr, .r, .g, .b, .a)
  end with
  cairo_fill(cr)
  
' Draw text
  cairo_move_to(cr, x, y)
  with text_color
  cairo_set_source_rgb(cr, .r, .g, .b)
  end with
  cairo_show_text(cr, text)
  
  cairo_restore(cr)
end sub

sub DrawCairoVersion(cr as cairo_t ptr)
  dim as string version = "Cairo " & *cairo_version_string()
  dim as tcairocolor rect_color = tcairocolor(1.0, 1.0, 1.0, 0.7)
  dim as tcairocolor text_color = tcairocolor(0.0, 0.0, 1.0)
  DrawText(cr, version, 8, 8, rect_color, text_color)
end sub

const WND_W = 480
const WND_H = 480

screenres WND_W, WND_H, 32
line (0, 0)-(WND_W, WND_H), rgb(192, 192, 192), BF

const IMG_W = 464
const IMG_H = 464

dim as any ptr image = imagecreate(IMG_W, IMG_H)
dim as any ptr pixels
imageinfo(image, IMG_W, IMG_H,,, pixels)
dim as long stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, IMG_W) ' https://www.freebasic.net/forum/viewtopic.php?p=215065#p215065
dim as cairo_surface_t ptr sf = cairo_image_surface_create_for_data(pixels, CAIRO_FORMAT_ARGB32, IMG_W, IMG_H, stride)
dim as cairo_t ptr cr = cairo_create(sf)

const DELAY = 100

'do
  DrawMain(cr)
  DrawCairoVersion(cr)
  screenlock()
  put (8, 8), image, PSET
  screenunlock()
  sleep(DELAY)
'loop until len(inkey)

cairo_destroy(cr)
cairo_surface_destroy(sf)
imagedestroy image

sleep
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Cairo DLL creation

Post by St_W »

The issue with the script is that is relies on the old autotools-based build tooling for cairo which has been removed since:
https://www.cairographics.org/news/cairo-1.17.8/ wrote:Additionally, cairo's Autotools build system has been removed; from now on,
cairo will only support the Meson build system. While the end result should
be identical, further testing is appreciated.
So one needs to adapt the script to use Meson instead, which should be doable, but is some work. Maybe I get to look into it over the weekend. Or just manually configure the build using Meson.
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Cairo DLL creation

Post by St_W »

Tried a bit longer and got some test builds: https://users.freebasic-portal.de/stw/f ... -1.8.0.zip

Haven't tested it, just checked the dependencies (which are only system ones). Compiled with VS 2022.

Built manually using mason and a small patch to the build file adding "static: true" for the relevant dependencies:

Code: Select all

--- C:\dev\cairo-windows\cairo\meson.build.org	2024-04-12 11:39:53.000000000 +0200
+++ C:\dev\cairo-windows\cairo\meson.build	2024-04-12 11:32:22.000000000 +0200
@@ -217,25 +217,27 @@
 # Optional keys: requires, libs
 built_features = []
 
 zlib_dep = dependency('zlib',
   required: get_option('zlib'),
   fallback : ['zlib', 'zlib_dep'],
+  static: true
 )
 if zlib_dep.found()
   if zlib_dep.type_name() == 'internal'
     internal_deps += [zlib_dep]
   else
     deps += [zlib_dep]
   endif
   conf.set('HAVE_ZLIB', 1)
 endif
 
 png_dep = dependency('libpng',
   required: get_option('png'),
-  fallback: ['libpng', 'libpng_dep']
+  fallback: ['libpng', 'libpng_dep'],
+  static: true
 )
 if png_dep.found()
   feature_conf.set('CAIRO_HAS_SVG_SURFACE', 1)
   feature_conf.set('CAIRO_HAS_PNG_FUNCTIONS', 1)
   built_features += [
     {
@@ -299,12 +301,13 @@
 freetype_option = freetype_option.disable_auto_if(not freetype_required)
 
 freetype_dep = dependency('freetype2',
   required: freetype_option,
   version: freetype_required_version,
   fallback: ['freetype2', 'freetype_dep'],
+  static: true,
 )
 if freetype_dep.found()
   feature_conf.set('CAIRO_HAS_FT_FONT', 1)
   built_features += [{
     'name': 'cairo-ft',
     'description': 'FreeType font backend',
@@ -632,12 +635,13 @@
   endif
 endif
 
 pixman_dep = dependency('pixman-1',
   version: '>= 0.36.0',
   fallback: ['pixman', 'idep_pixman'],
+  static: true
 )
 if pixman_dep.found()
   feature_conf.set('CAIRO_HAS_IMAGE_SURFACE', 1)
   conf.set('HAS_PIXMAN_GLYPHS', 1)
   if pixman_dep.type_name() == 'internal'
     internal_deps += [pixman_dep]
Afterwards you just need to run:
meson setup builddir_static_x64 --backend vs2022 -D freetype=enabled
meson compile -C builddir_static_x64

.. and it will fetch and compile all the dependencies as well. So the shell script (https://github.com/preshing/cairo-windows) is actually obsolete I think.
UEZ
Posts: 994
Joined: May 05, 2017 19:59
Location: Germany

Re: Cairo DLL creation

Post by UEZ »

Hi St_W,

thanks for the DLLs but it doesn't work because of missing import DLLs which are not default system DLLs.

x86:
VCRUNTIME140D.dll
ucrtbased.dll

x64:
VCRUNTIME140D.dll
VCRUNTIME140_1D.dll
ucrtbased.dll

Can those functions in these DLLs integrated?

Edit: runs properly when copying both missing DLLs for x86. For x64 I need to find them first somewhere...

x86 functions:

Code: Select all

FT_Activate_Size|0x000028A6
FT_Add_Default_Modules|0x000017AD
FT_Add_Module|0x00001BAE
FT_Angle_Diff|0x000016BD
FT_Atan2|0x000028F6
FT_Attach_File|0x000029C8
FT_Attach_Stream|0x00001EFB
FT_Bitmap_Blend|0x000025F9
FT_Bitmap_Convert|0x00003A44
FT_Bitmap_Copy|0x0000174E
FT_Bitmap_Done|0x00001B04
FT_Bitmap_Embolden|0x000040F2
FT_Bitmap_Init|0x00003E90
FT_Bitmap_New|0x00001ED3
FT_CeilFix|0x00001ED8
FT_Cos|0x00004070
FT_DivFix|0x00002900
FT_Done_Face|0x00003652
FT_Done_FreeType|0x00003A30
FT_Done_Library|0x000010C8
FT_Done_MM_Var|0x0000152D
FT_Done_Size|0x00004020
FT_Error_String|0x000015B4
FT_Face_GetCharVariantIndex|0x00002F7C
FT_Face_GetCharVariantIsDefault|0x00004133
FT_Face_GetCharsOfVariant|0x00002167
FT_Face_GetVariantSelectors|0x00001640
FT_Face_GetVariantsOfChar|0x00001DA7
FT_Face_Properties|0x00004138
FT_FloorFix|0x00002F86
FT_Get_Advance|0x000025A4
FT_Get_Advances|0x0000134D
FT_Get_CMap_Format|0x00002C61
FT_Get_CMap_Language_ID|0x000021B7
FT_Get_Char_Index|0x00001492
FT_Get_Charmap_Index|0x000012C6
FT_Get_Color_Glyph_Layer|0x0000131B
FT_Get_Color_Glyph_Paint|0x00002CCA
FT_Get_Colorline_Stops|0x000011CC
FT_Get_First_Char|0x00003607
FT_Get_Font_Format|0x000039D1
FT_Get_Glyph_Name|0x0000150A
FT_Get_Kerning|0x00003EE0
FT_Get_MM_Blend_Coordinates|0x00003490
FT_Get_MM_Var|0x0000408E
FT_Get_MM_WeightVector|0x00002ECD
FT_Get_Module|0x00001AEB
FT_Get_Multi_Master|0x000020FE
FT_Get_Name_Index|0x0000360C
FT_Get_Next_Char|0x00003495
FT_Get_Paint|0x00002879
FT_Get_Paint_Layers|0x00003909
FT_Get_Postscript_Name|0x000019C4
FT_Get_Renderer|0x00002077
FT_Get_Sfnt_LangTag|0x000027A2
FT_Get_Sfnt_Name|0x00003143
FT_Get_Sfnt_Name_Count|0x00004002
FT_Get_Sfnt_Table|0x00003ED6
FT_Get_SubGlyph_Info|0x00001A2D
FT_Get_Track_Kerning|0x00001212
FT_Get_Transform|0x00001EA1
FT_Get_TrueType_Engine_Type|0x00003F6C
FT_Get_Var_Axis_Flags|0x000037EC
FT_Get_Var_Blend_Coordinates|0x0000141F
FT_Get_Var_Design_Coordinates|0x00002C89
FT_Get_X11_Font_Format|0x000033AA
FT_GlyphSlot_Embolden|0x00001E51
FT_GlyphSlot_Oblique|0x00002919
FT_GlyphSlot_Own_Bitmap|0x00003BAC
FT_Gzip_Uncompress|0x0000201D
FT_Init_FreeType|0x00001573
FT_Library_SetLcdFilter|0x000028D3
FT_Library_SetLcdFilterWeights|0x00002BB7
FT_Library_SetLcdGeometry|0x000017E9
FT_Library_Version|0x0000153C
FT_List_Add|0x00002C16
FT_List_Finalize|0x000024AA
FT_List_Find|0x00002D51
FT_List_Insert|0x000038EB
FT_List_Iterate|0x00001046
FT_List_Remove|0x00003EAE
FT_List_Up|0x000021F3
FT_Load_Char|0x00002518
FT_Load_Glyph|0x0000101E
FT_Load_Sfnt_Table|0x00002E4B
FT_Matrix_Invert|0x00002C4D
FT_Matrix_Multiply|0x0000226B
FT_MulDiv|0x0000390E
FT_MulFix|0x0000216C
FT_New_Face|0x000041F6
FT_New_Library|0x000013BB
FT_New_Memory_Face|0x00003A71
FT_New_Size|0x00001631
FT_Open_Face|0x000022B1
FT_Outline_Check|0x00001884
FT_Outline_Copy|0x000026E4
FT_Outline_Decompose|0x00001B36
FT_Outline_Done|0x000027C5
FT_Outline_Embolden|0x00002D9C
FT_Outline_EmboldenXY|0x00003BF2
FT_Outline_Get_Bitmap|0x00003EF4
FT_Outline_Get_CBox|0x00003B20
FT_Outline_Get_Orientation|0x00001D7F
FT_Outline_New|0x00001005
FT_Outline_Render|0x000010FF
FT_Outline_Reverse|0x0000196F
FT_Outline_Transform|0x000017B2
FT_Outline_Translate|0x00003788
FT_Palette_Data_Get|0x00003DCD
FT_Palette_Select|0x00001C12
FT_Palette_Set_Foreground_Color|0x00003E40
FT_Property_Get|0x00001609
FT_Property_Set|0x0000144C
FT_Reference_Face|0x00001BE0
FT_Reference_Library|0x00003FCB
FT_Remove_Module|0x00002F1D
FT_Render_Glyph|0x0000291E
FT_Request_Size|0x000036A2
FT_RoundFix|0x00001A4B
FT_Select_Charmap|0x00002FEA
FT_Select_Size|0x0000248C
FT_Set_Char_Size|0x0000319D
FT_Set_Charmap|0x00002699
FT_Set_Debug_Hook|0x00002A04
FT_Set_Default_Log_Handler|0x00002A9A
FT_Set_Default_Properties|0x00002F45
FT_Set_Log_Handler|0x000040B1
FT_Set_MM_Blend_Coordinates|0x00004025
FT_Set_MM_Design_Coordinates|0x000035DF
FT_Set_MM_WeightVector|0x00003B2F
FT_Set_Named_Instance|0x00001CF3
FT_Set_Pixel_Sizes|0x00002E87
FT_Set_Renderer|0x0000137A
FT_Set_Transform|0x00004183
FT_Set_Var_Blend_Coordinates|0x0000214E
FT_Set_Var_Design_Coordinates|0x00003F8F
FT_Sfnt_Table_Info|0x00002B6C
FT_Sin|0x00001A0F
FT_Stream_OpenGzip|0x00002847
FT_Stream_OpenLZW|0x00003837
FT_Tan|0x000015F0
FT_Trace_Set_Default_Level|0x000027CA
FT_Trace_Set_Level|0x00001564
FT_Vector_From_Polar|0x0000383C
FT_Vector_Length|0x00001D66
FT_Vector_Polarize|0x0000204A
FT_Vector_Rotate|0x00001861
FT_Vector_Transform|0x0000365C
FT_Vector_Unit|0x00001195
TT_New_Context|0x00002EAA
TT_RunIns|0x00001F37
cairo_append_path|0x0000135C
cairo_arc|0x00002A54
cairo_arc_negative|0x00002C7A
cairo_clip|0x000022BB
cairo_clip_extents|0x000037BA
cairo_clip_preserve|0x0000126C
cairo_close_path|0x00002B12
cairo_copy_clip_rectangle_list|0x00002FE0
cairo_copy_page|0x00002680
cairo_copy_path|0x0000362F
cairo_copy_path_flat|0x00001F00
cairo_create|0x000028BA
cairo_curve_to|0x00002B21
cairo_debug_reset_static_data|0x00001271
cairo_destroy|0x00001FCD
cairo_device_acquire|0x0000271B
cairo_device_destroy|0x00002F68
cairo_device_finish|0x00002CFC
cairo_device_flush|0x00003D5A
cairo_device_get_reference_count|0x000028EC
cairo_device_get_type|0x000016DB
cairo_device_get_user_data|0x00002248
cairo_device_observer_elapsed|0x0000146F
cairo_device_observer_fill_elapsed|0x00001F73
cairo_device_observer_glyphs_elapsed|0x00001A9B
cairo_device_observer_mask_elapsed|0x00001FC3
cairo_device_observer_paint_elapsed|0x00001CDA
cairo_device_observer_print|0x00004214
cairo_device_observer_stroke_elapsed|0x000027F7
cairo_device_reference|0x0000229D
cairo_device_release|0x00003C88
cairo_device_set_user_data|0x000028B5
cairo_device_status|0x000017F8
cairo_device_to_user|0x00002A81
cairo_device_to_user_distance|0x00003D82
cairo_dwrite_font_face_create_for_dwrite_fontface|0x00002356
cairo_dwrite_font_face_get_measuring_mode|0x00001EBA
cairo_dwrite_font_face_get_rendering_params|0x00001582
cairo_dwrite_font_face_set_measuring_mode|0x00002C70
cairo_dwrite_font_face_set_rendering_params|0x00003463
cairo_fill|0x00002068
cairo_fill_extents|0x00002FC2
cairo_fill_preserve|0x00002C57
cairo_font_extents|0x0000160E
cairo_font_face_destroy|0x00001730
cairo_font_face_get_reference_count|0x00004124
cairo_font_face_get_type|0x0000379C
cairo_font_face_get_user_data|0x00002194
cairo_font_face_reference|0x00002ED2
cairo_font_face_set_user_data|0x00001C21
cairo_font_face_status|0x00001F87
cairo_font_options_copy|0x00001D4D
cairo_font_options_create|0x000020DB
cairo_font_options_destroy|0x00001816
cairo_font_options_equal|0x00003418
cairo_font_options_get_antialias|0x0000303F
cairo_font_options_get_color_mode|0x000026CB
cairo_font_options_get_color_palette|0x00002B0D
cairo_font_options_get_custom_palette_color|0x00002E2D
cairo_font_options_get_hint_metrics|0x00003003
cairo_font_options_get_hint_style|0x0000141A
cairo_font_options_get_subpixel_order|0x00002C39
cairo_font_options_get_variations|0x000029F0
cairo_font_options_hash|0x00003CD3
cairo_font_options_merge|0x00001E74
cairo_font_options_set_antialias|0x0000158C
cairo_font_options_set_color_mode|0x000015AA
cairo_font_options_set_color_palette|0x000013AC
cairo_font_options_set_custom_palette_color|0x0000217B
cairo_font_options_set_hint_metrics|0x00002522
cairo_font_options_set_hint_style|0x00003CE2
cairo_font_options_set_subpixel_order|0x000041AB
cairo_font_options_set_variations|0x000025F4
cairo_font_options_status|0x0000246E
cairo_format_stride_for_width|0x000012AD
cairo_ft_font_face_create_for_ft_face|0x00002941
cairo_ft_font_face_get_synthesize|0x000039FE
cairo_ft_font_face_set_synthesize|0x000022A2
cairo_ft_font_face_unset_synthesize|0x00002AA4
cairo_ft_scaled_font_lock_face|0x0000368E
cairo_ft_scaled_font_unlock_face|0x00003706
cairo_get_antialias|0x00002FE5
cairo_get_current_point|0x00001424
cairo_get_dash|0x00003FC1
cairo_get_dash_count|0x0000318E
cairo_get_fill_rule|0x000027B1
cairo_get_font_face|0x00001C0D
cairo_get_font_matrix|0x00002883
cairo_get_font_options|0x000031DE
cairo_get_group_target|0x00001E2E
cairo_get_hairline|0x000031A2
cairo_get_line_cap|0x000014D8
cairo_get_line_join|0x0000249B
cairo_get_line_width|0x00003873
cairo_get_matrix|0x000039A9
cairo_get_miter_limit|0x00001A28
cairo_get_operator|0x00003454
cairo_get_reference_count|0x00003F12
cairo_get_scaled_font|0x000027ED
cairo_get_source|0x00001C67
cairo_get_target|0x000038AF
cairo_get_tolerance|0x00003B02
cairo_get_user_data|0x000015AF
cairo_glyph_allocate|0x00003A8A
cairo_glyph_extents|0x00003AE9
cairo_glyph_free|0x00001190
cairo_glyph_path|0x00001D70
cairo_has_current_point|0x00003A26
cairo_identity_matrix|0x00002752
cairo_image_surface_create|0x000037A1
cairo_image_surface_create_for_data|0x000016E5
cairo_image_surface_create_from_png|0x000026E9
cairo_image_surface_create_from_png_stream|0x00003A49
cairo_image_surface_get_data|0x00003B84
cairo_image_surface_get_format|0x00003936
cairo_image_surface_get_height|0x000014F1
cairo_image_surface_get_stride|0x000036F7
cairo_image_surface_get_width|0x00001EB0
cairo_in_clip|0x000038FF
cairo_in_fill|0x00003229
cairo_in_stroke|0x00003AEE
cairo_line_to|0x000020F9
cairo_mask|0x000021D0
cairo_mask_surface|0x0000325B
cairo_matrix_init|0x00003A0D
cairo_matrix_init_identity|0x00002225
cairo_matrix_init_rotate|0x0000251D
cairo_matrix_init_scale|0x00001B63
cairo_matrix_init_translate|0x00001604
cairo_matrix_invert|0x0000266C
cairo_matrix_multiply|0x0000154B
cairo_matrix_rotate|0x00001EBF
cairo_matrix_scale|0x00001960
cairo_matrix_transform_distance|0x00003A17
cairo_matrix_transform_point|0x0000338C
cairo_matrix_translate|0x00002E5A
cairo_mesh_pattern_begin_patch|0x00003D64
cairo_mesh_pattern_curve_to|0x00002405
cairo_mesh_pattern_end_patch|0x00001384
cairo_mesh_pattern_get_control_point|0x000035F8
cairo_mesh_pattern_get_corner_color_rgba|0x0000119A
cairo_mesh_pattern_get_patch_count|0x0000328D
cairo_mesh_pattern_get_path|0x00004043
cairo_mesh_pattern_line_to|0x00003E72
cairo_mesh_pattern_move_to|0x00003E54
cairo_mesh_pattern_set_control_point|0x00002B49
cairo_mesh_pattern_set_corner_color_rgb|0x00003C4C
cairo_mesh_pattern_set_corner_color_rgba|0x00002CC5
cairo_move_to|0x000017DA
cairo_new_path|0x00002E37
cairo_new_sub_path|0x00002B9E
cairo_paint|0x000011BD
cairo_paint_with_alpha|0x0000233D
cairo_path_destroy|0x0000171C
cairo_path_extents|0x00002DBF
cairo_pattern_add_color_stop_rgb|0x000036C0
cairo_pattern_add_color_stop_rgba|0x00001807
cairo_pattern_create_for_surface|0x00003855
cairo_pattern_create_linear|0x00002C34
cairo_pattern_create_mesh|0x000029D2
cairo_pattern_create_radial|0x0000339B
cairo_pattern_create_raster_source|0x00001474
cairo_pattern_create_rgb|0x00003EEA
cairo_pattern_create_rgba|0x00003616
cairo_pattern_destroy|0x00002B44
cairo_pattern_get_color_stop_count|0x000025AE
cairo_pattern_get_color_stop_rgba|0x000038B9
cairo_pattern_get_dither|0x000030FD
cairo_pattern_get_extend|0x00001C53
cairo_pattern_get_filter|0x00003DE6
cairo_pattern_get_linear_points|0x00001870
cairo_pattern_get_matrix|0x000014A6
cairo_pattern_get_radial_circles|0x00001221
cairo_pattern_get_reference_count|0x00003085
cairo_pattern_get_rgba|0x00002716
cairo_pattern_get_surface|0x00003549
cairo_pattern_get_type|0x000040C5
cairo_pattern_get_user_data|0x000018BB
cairo_pattern_reference|0x000021D5
cairo_pattern_set_dither|0x00002AA9
cairo_pattern_set_extend|0x00002DE7
cairo_pattern_set_filter|0x00003422
cairo_pattern_set_matrix|0x00002946
cairo_pattern_set_user_data|0x00002CB1
cairo_pattern_status|0x00003C0B
cairo_pdf_get_versions|0x00001D3E
cairo_pdf_surface_add_outline|0x00002C07
cairo_pdf_surface_create|0x00001A91
cairo_pdf_surface_create_for_stream|0x000042A5
cairo_pdf_surface_restrict_to_version|0x00002333
cairo_pdf_surface_set_custom_metadata|0x00002E8C
cairo_pdf_surface_set_metadata|0x0000255E
cairo_pdf_surface_set_page_label|0x000042BE
cairo_pdf_surface_set_size|0x00003C83
cairo_pdf_surface_set_thumbnail_size|0x000018AC
cairo_pdf_version_to_string|0x00002BE4
cairo_pop_group|0x0000278E
cairo_pop_group_to_source|0x000023AB
cairo_ps_get_levels|0x00001DB1
cairo_ps_level_to_string|0x00001555
cairo_ps_surface_create|0x00003AC1
cairo_ps_surface_create_for_stream|0x00002F81
cairo_ps_surface_dsc_begin_page_setup|0x00003251
cairo_ps_surface_dsc_begin_setup|0x00003C9C
cairo_ps_surface_dsc_comment|0x00004156
cairo_ps_surface_get_eps|0x00003D32
cairo_ps_surface_restrict_to_level|0x000023BF
cairo_ps_surface_set_eps|0x00004034
cairo_ps_surface_set_size|0x000025FE
cairo_push_group|0x00001DDE
cairo_push_group_with_content|0x0000335A
cairo_raster_source_pattern_get_acquire|0x0000123F
cairo_raster_source_pattern_get_callback_data|0x00002CCF
cairo_raster_source_pattern_get_copy|0x000020C7
cairo_raster_source_pattern_get_finish|0x00001A87
cairo_raster_source_pattern_get_snapshot|0x00003DF5
cairo_raster_source_pattern_set_acquire|0x00001C8A
cairo_raster_source_pattern_set_callback_data|0x00002E73
cairo_raster_source_pattern_set_copy|0x0000236F
cairo_raster_source_pattern_set_finish|0x000037F1
cairo_raster_source_pattern_set_snapshot|0x000012E4
cairo_recording_surface_create|0x00003A62
cairo_recording_surface_get_extents|0x000037AB
cairo_recording_surface_ink_extents|0x0000100A
cairo_rectangle|0x00002536
cairo_rectangle_list_destroy|0x000016C2
cairo_reference|0x00002F90
cairo_region_contains_point|0x00002CC0
cairo_region_contains_rectangle|0x00003567
cairo_region_copy|0x00002829
cairo_region_create|0x00003D41
cairo_region_create_rectangle|0x00003080
cairo_region_create_rectangles|0x000036D4
cairo_region_destroy|0x000016AE
cairo_region_equal|0x00003B2A
cairo_region_get_extents|0x000014A1
cairo_region_get_rectangle|0x00002590
cairo_region_intersect|0x00002F8B
cairo_region_intersect_rectangle|0x000027E3
cairo_region_is_empty|0x00003E18
cairo_region_num_rectangles|0x000011B3
cairo_region_reference|0x000031D9
cairo_region_status|0x00001082
cairo_region_subtract|0x0000364D
cairo_region_subtract_rectangle|0x0000272A
cairo_region_translate|0x00001E06
cairo_region_union|0x00002149
cairo_region_union_rectangle|0x000010AA
cairo_region_xor|0x000037D8
cairo_region_xor_rectangle|0x00003670
cairo_rel_curve_to|0x000038C3
cairo_rel_line_to|0x00001569
cairo_rel_move_to|0x00001A32
cairo_reset_clip|0x000023A6
cairo_restore|0x000027E8
cairo_rotate|0x000030E9
cairo_save|0x00001FEB
cairo_scale|0x000037F6
cairo_scaled_font_create|0x00001B77
cairo_scaled_font_destroy|0x00003C5B
cairo_scaled_font_extents|0x00002C43
cairo_scaled_font_get_ctm|0x0000111D
cairo_scaled_font_get_font_face|0x00003A53
cairo_scaled_font_get_font_matrix|0x000012B2
cairo_scaled_font_get_font_options|0x00002BA3
cairo_scaled_font_get_reference_count|0x00003E9F
cairo_scaled_font_get_scale_matrix|0x0000240A
cairo_scaled_font_get_type|0x0000297D
cairo_scaled_font_get_user_data|0x0000185C
cairo_scaled_font_glyph_extents|0x00001302
cairo_scaled_font_reference|0x00001CE9
cairo_scaled_font_set_user_data|0x00003797
cairo_scaled_font_status|0x000015A5
cairo_scaled_font_text_extents|0x00002437
cairo_scaled_font_text_to_glyphs|0x00002040
cairo_script_create|0x00003210
cairo_script_create_for_stream|0x00001906
cairo_script_from_recording_surface|0x00003EE5
cairo_script_get_mode|0x00002347
cairo_script_set_mode|0x00002EC3
cairo_script_surface_create|0x00003E1D
cairo_script_surface_create_for_target|0x00001B31
cairo_script_write_comment|0x00002513
cairo_select_font_face|0x0000239C
cairo_set_antialias|0x00002F13
cairo_set_dash|0x000024F5
cairo_set_fill_rule|0x00001AD2
cairo_set_font_face|0x000031E8
cairo_set_font_matrix|0x00002C2F
cairo_set_font_options|0x00002694
cairo_set_font_size|0x0000218A
cairo_set_hairline|0x00003436
cairo_set_line_cap|0x000039E5
cairo_set_line_join|0x00001CB2
cairo_set_line_width|0x0000352B
cairo_set_matrix|0x000018E3
cairo_set_miter_limit|0x00003FEE
cairo_set_operator|0x00001ACD
cairo_set_scaled_font|0x00003864
cairo_set_source|0x00002626
cairo_set_source_rgb|0x0000270C
cairo_set_source_rgba|0x0000324C
cairo_set_source_surface|0x00003F62
cairo_set_tolerance|0x00002103
cairo_set_user_data|0x00002E0A
cairo_show_glyphs|0x00002F59
cairo_show_page|0x0000150F
cairo_show_text|0x00003526
cairo_show_text_glyphs|0x0000374C
cairo_status|0x0000165E
cairo_status_to_string|0x00002C5C
cairo_stroke|0x0000386E
cairo_stroke_extents|0x00003A12
cairo_stroke_preserve|0x00003D87
cairo_surface_copy_page|0x00003E22
cairo_surface_create_for_rectangle|0x00002D47
cairo_surface_create_observer|0x00001F41
cairo_surface_create_similar|0x000040DE
cairo_surface_create_similar_image|0x000034C7
cairo_surface_destroy|0x00003B6B
cairo_surface_finish|0x00003279
cairo_surface_flush|0x00001456
cairo_surface_get_content|0x00002243
cairo_surface_get_device|0x00002937
cairo_surface_get_device_offset|0x00003A03
cairo_surface_get_device_scale|0x00002AC2
cairo_surface_get_fallback_resolution|0x00003990
cairo_surface_get_font_options|0x00001041
cairo_surface_get_mime_data|0x00001091
cairo_surface_get_reference_count|0x000022CA
cairo_surface_get_type|0x0000302B
cairo_surface_get_user_data|0x00002D38
cairo_surface_has_show_text_glyphs|0x00003175
cairo_surface_map_to_image|0x000033D7
cairo_surface_mark_dirty|0x0000428C
cairo_surface_mark_dirty_rectangle|0x0000404D
cairo_surface_observer_add_fill_callback|0x00003CB0
cairo_surface_observer_add_finish_callback|0x000020AE
cairo_surface_observer_add_flush_callback|0x000014EC
cairo_surface_observer_add_glyphs_callback|0x00002180
cairo_surface_observer_add_mask_callback|0x00001C30
cairo_surface_observer_add_paint_callback|0x00001B27
cairo_surface_observer_add_stroke_callback|0x00002BAD
cairo_surface_observer_elapsed|0x000041E7
cairo_surface_observer_print|0x00004197
cairo_surface_reference|0x00001929
cairo_surface_set_device_offset|0x000010CD
cairo_surface_set_device_scale|0x00002B71
cairo_surface_set_fallback_resolution|0x0000275C
cairo_surface_set_mime_data|0x0000123A
cairo_surface_set_user_data|0x0000200E
cairo_surface_show_page|0x00002658
cairo_surface_status|0x00003EEF
cairo_surface_supports_mime_type|0x00001118
cairo_surface_unmap_image|0x00001136
cairo_surface_write_to_png|0x00003891
cairo_surface_write_to_png_stream|0x000019A6
cairo_svg_get_versions|0x00001EC4
cairo_svg_surface_create|0x00003783
cairo_svg_surface_create_for_stream|0x000011E5
cairo_svg_surface_get_document_unit|0x00003238
cairo_svg_surface_restrict_to_version|0x000024F0
cairo_svg_surface_set_document_unit|0x00002C9D
cairo_svg_version_to_string|0x00001BCC
cairo_tag_begin|0x00003198
cairo_tag_end|0x00001370
cairo_tee_surface_add|0x00002086
cairo_tee_surface_create|0x00002B7B
cairo_tee_surface_index|0x00001CD5
cairo_tee_surface_remove|0x000016F9
cairo_text_cluster_allocate|0x00001C6C
cairo_text_cluster_free|0x00003B11
cairo_text_extents|0x00001A50
cairo_text_path|0x00001465
cairo_toy_font_face_create|0x0000311B
cairo_toy_font_face_get_family|0x00003107
cairo_toy_font_face_get_slant|0x00003E09
cairo_toy_font_face_get_weight|0x00002AF9
cairo_transform|0x00001203
cairo_translate|0x00001488
cairo_user_font_face_create|0x000029EB
cairo_user_font_face_get_init_func|0x0000387D
cairo_user_font_face_get_render_color_glyph_func|0x000040CF
cairo_user_font_face_get_render_glyph_func|0x00002F63
cairo_user_font_face_get_text_to_glyphs_func|0x0000315C
cairo_user_font_face_get_unicode_to_glyph_func|0x00003F4E
cairo_user_font_face_set_init_func|0x000024A0
cairo_user_font_face_set_render_color_glyph_func|0x00001893
cairo_user_font_face_set_render_glyph_func|0x00001E33
cairo_user_font_face_set_text_to_glyphs_func|0x00003A2B
cairo_user_font_face_set_unicode_to_glyph_func|0x00002F40
cairo_user_scaled_font_get_foreground_marker|0x00001762
cairo_user_scaled_font_get_foreground_source|0x00001F6E
cairo_user_to_device|0x0000118B
cairo_user_to_device_distance|0x0000273E
cairo_version|0x00001CAD
cairo_version_string|0x0000290A
cairo_win32_font_face_create_for_hfont|0x00002BD5
cairo_win32_font_face_create_for_logfontw|0x000032B5
cairo_win32_font_face_create_for_logfontw_hfont|0x00002D97
cairo_win32_get_system_text_quality|0x000015E1
cairo_win32_printing_surface_create|0x000026B7
cairo_win32_scaled_font_done_font|0x000030B7
cairo_win32_scaled_font_get_device_to_logical|0x0000204F
cairo_win32_scaled_font_get_logical_to_device|0x00001C9E
cairo_win32_scaled_font_get_metrics_factor|0x000035C6
cairo_win32_scaled_font_select_font|0x00003DC3
cairo_win32_surface_create|0x00002266
cairo_win32_surface_create_with_ddb|0x00001500
cairo_win32_surface_create_with_dib|0x0000395E
cairo_win32_surface_create_with_format|0x00002E96
cairo_win32_surface_get_dc|0x00001F23
cairo_win32_surface_get_image|0x0000287E
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Cairo DLL creation

Post by St_W »

I see. The "D" suffix means that it's a debug build - didn't notice when building 😅, but fixing that should be easy.

The other issue is the dependency on the MSVC-runtime library. This can be configured with the build options: https://learn.microsoft.com/en-us/cpp/b ... w=msvc-170 but I need to have a look how to integrate this in the meson build.

Just for completeness, the MSVCRT can be downloaded here:
https://learn.microsoft.com/en-us/cpp/w ... -vc-redist
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Cairo DLL creation

Post by St_W »

Seems that this was easier than expected. I updated the original upload:
https://users.freebasic-portal.de/stw/f ... -1.8.0.zip
(renamed the old one to https://users.freebasic-portal.de/stw/f ... -debug.zip)

All I did was adding two additional build options:
meson setup builddir_static_x64_release --backend vs2022 -D freetype=enabled --buildtype=release -D b_vscrt=static_from_buildtype

see also https://mesonbuild.com/Builtin-options.html

Looks like it could be possible to configure static linking instead of patching the build file (as I did). Maybe I'll try out later. (Or somebody who knows Meson could tell?).
UEZ
Posts: 994
Joined: May 05, 2017 19:59
Location: Germany

Re: Cairo DLL creation

Post by UEZ »

Both versions are the same. :wink:

I need to learn this compiling stuff...
St_W
Posts: 1627
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Cairo DLL creation

Post by St_W »

UEZ wrote: Apr 12, 2024 11:45 Both versions are the same. :wink:
Are you really sure?
.. maybe some (browser) caching issue? or mixup?

new
Image
old, debug
Image
(above screenshots are from the x64 builds, but also checked the x86 ones)

Also the file size should be significantly different (release build is smaller).
UEZ wrote: Apr 12, 2024 11:45 I need to learn this compiling stuff...
In this case it's quite easy; just install Visual Studio (including C++ / Platform tools), Meson, Git and run the commands I've written in my previous posts in an appropriate VS cmd environment. That should be it.
Roland Chastain
Posts: 1008
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Cairo DLL creation

Post by Roland Chastain »

@St_W

Tested successfully the DLL. Thanks! But I had to rename it libcairo-2.dll.
Post Reply