Giter Club home page Giter Club logo

cl-pango's People

Contributors

bradwbeer avatar warweasle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

samuel-hunter

cl-pango's Issues

branch problem

When I clone your CL-pango git repository, I don't by default
see the master branch. Instead, I get gh-pages.

This may also affect what web surfers see. I don't think the
master branch README files shows up, for instance.

bob

Windows 10: cannot register existing type 'PangoLayout'

Platform: Windows 10 Pro 20H2 64-bit

Library: mingw64/mingw-w64-x86_64-pango 1.50.3-1

installed via MSYS2: pacman -S mingw-w64-x86_64-pango

Sample code to reproduce:

(ql:quickload 'cl-pango)

;; the code below is for `cl-pango:g_object_unref`
(cffi:define-foreign-library :libgobject
  (cffi-features:windows "libgobject-2.0-0.dll"))
(cffi:load-foreign-library :libgobject)

(let* ((cairo-surface (cairo:create-image-surface :argb32 240 80))
       (cairo-context (cairo:create-context cairo-surface))
       (pango-layout (cl-pango:pango_cairo_create_layout
                      (slot-value cairo-context 'cairo:pointer))))

  ;; (cl-pango:pango_layout_set_text pango-layout "Hello, Pango Markup" -1)

  (cl-pango:pango_layout_set_markup pango-layout "Hello, Pango Markup" -1)
  
  (cairo:set-source-rgb 0 1 1 cairo-context)
  (cairo:move-to 10 50 cairo-context)
  (cl-pango:pango_cairo_show_layout (slot-value cairo-context 'cairo:pointer) pango-layout)

  (cl-pango:g_object_unref pango-layout)

  (cairo:destroy cairo-context)
  (cairo:surface-write-to-png cairo-surface "hello-pango.png")
  (cairo:destroy cairo-surface))


(quit)

The code above will run successfully under recent macOS and Linux, but on Windows 10, it will generate the following output:

$ sbcl --load hello-pango.lisp
This is SBCL 2.2.0, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
To load "cl-pango":
  Load 1 ASDF system:
    cl-pango
; Loading "cl-pango"
........

(process:2720): GLib-GObject-WARNING **: 09:15:43.571: cannot register existing type 'PangoLayout'

(process:2720): GLib-CRITICAL **: 09:15:43.571: g_once_init_leave: assertion 'result != 0' failed

(process:2720): Pango-CRITICAL **: 09:15:43.571: pango_layout_set_markup_with_accel: assertion 'PANGO_IS_LAYOUT (layout)' failed

Here is the generated image (seems to be blank):

hello-pango

But in the mean time, the C equivalent code works fine:

/*
 * compile:
 * gcc -o hello-pango-markup hello-pango-markup.c $(pkg-config --cflags --libs pangocairo)
 */

#include <pango/pangocairo.h>
PangoLayout *layout;
PangoFontDescription *font_description;

int main (int argc, char *argv[])
{
  cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
  cairo_t *cr = cairo_create (surface);

  layout = pango_cairo_create_layout (cr);
  pango_layout_set_markup (layout, "Hello, world", -1);

  cairo_set_source_rgb (cr, 0.0, 1.0, 1.0);
  cairo_move_to (cr, 10.0, 50.0);
  pango_cairo_show_layout (cr, layout);

  g_object_unref (layout);

  cairo_destroy (cr);
  cairo_surface_write_to_png (surface, "hello-pango.png");
  cairo_surface_destroy (surface);
  return 0;
}

So I suppose there might be something wired between Lisp and Pango C interface, maybe it's GObject related.

--

I know this may not have anything related to the cl-pango library, but I really can't find any clue to this problem, so I post this here and hope for any suggestions.

Thank you for your creation, cl-pango is very easy to use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.