VW 7.9.1 and Pango/Cairo on Windows Vista - a working example

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VW 7.9.1 and Pango/Cairo on Windows Vista - a working example

Stew MacLean

Hi,

 

Here’s how I got Pango/Cairo to work on windows Vista and VW 7.9.1:

 

- download the GTK bundle (gtk+-bundle_2.24.10-20120208_win32) and unzip

- take a fresh image

- load the latest basic Pango package from Store (auto loads CairoGraphics package)

- edit the LibPango and LibCairo external interface class definitions to add the path to gtk binaries directory:

      eg #(#libraryDirectories #('C:\...\gtk\gtk+-bundle_2.24.10-20120208_win32\bin'))

- and execute the code:

 

| view gc |

view := ScheduledControllers activeController view.

gc := view graphicsContext.

gc newCairoContextWhile:

                [:cr |

                cr

                        source: ColorValue red;

                        moveToX: 110 y: 20.

                (Pango.Layout text: 'Hello, World! ' , ObjectMemory versionId printString)

                        fontDescriptionString: 'Calibri, 60';

                        showOn: cr]

 

The key is to set the library directory on LibCairo, otherwise you get a load library error on libpangocairo-1.0-0.dll (from LibPango pango_cairo_font_map_get_default ) – go figure!

 

If you save the image, you’ll need to execute:

 

Smalltalk.Pango.ShapeAttribute initializeCallbacks.

 

to fix bad argument error, as it hangs onto the C callback function.

 

To isolate dependent dlls use Dependency Walker and drag the libraries referenced in LibCairo and LibPango onto the depends UI – it will list the dependent dlls.

 

That’s the first step – thanks to everyone who has helped!

 

Cheers,

 

Stewart

 

 

 

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc