Skip to content

lispbuilder-sdl-ttf-cffi::ttf-size-text doesn't have nice lisp wrapper #38

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Desire to figure out the extent of piece of text rendered with a font.
2. Search the docs religiously which don't mention it and then the code itself. 
3. Discover that CFFI implements a call to TTF_SizeText(), but noone uses it.

What is the expected output? What do you see instead?

I see no output, because the lowlevel CFFI wrapper isn't exported and doesn't 
have
a nice lisp wrapper.

What version of the product are you using? On what operating system?

I'm using lispbuilder-20120520-svn from quicklisp as of a little bit ago with
SBCL 1.0.57 on an Ubuntu 10.04 LTS x86 machine.

Please provide any additional information below.

Here is a starting point for a wrapper function:

(defun text-size (font str)
  (let ((fp-width (cffi:foreign-alloc :int))
        (fp-height (cffi:foreign-alloc :int)))

    (lispbuilder-sdl-ttf-cffi::ttf-size-text
     (sdl:fp font) str fp-width fp-height)

    (values (cffi:mem-ref fp-height :int) (cffi:mem-ref fp-width :int))))


Thank you and have a nice day!

Original issue reported on code.google.com by [email protected] on 5 Dec 2012 at 5:55

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions