[Lazarus] Examples of CairoCanvas usage

Juha Manninen juha.manninen62 at gmail.com
Mon Feb 9 18:45:17 CET 2015


Strange.
I am testing on Windows, Gtk+ for Windows runtime environment is installed.
My project depends on cairocanvas_pkg.lpk

When I run the test below without the TextOut line, it works and file
"abcdef.pdf" indeed contains an ellipse.
With the TextOut line it throws a SIGFPE. I cannot step into the
method even with all debug info enabled.
In Assembler debug window I can see it happened in
_cairo_win32_font_face_scaled_font_create.

Ideas? How to solve it? Could it be some missing DLL? It did not
complain about DLLs.
Am I doing something very stupid? It is possible because I have
limited experience with graphics and canvas methods.

Juha

---
uses ... ,
  CairoCanvas;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  PdfCanvas: TCairoPdfCanvas;
begin
  PdfCanvas := TCairoPdfCanvas.Create;
  try
    PdfCanvas.OutputFileName := 'abcdef.pdf';
    PdfCanvas.Ellipse(20, 20, 50, 70);
    PdfCanvas.TextOut(50, 100, 'abcdef');
  finally
    PdfCanvas.Free;
  end;
end;
---




More information about the Lazarus mailing list