Git Product home page Git Product logo

cl-freetype2's People

Contributors

3b avatar juanjosegarciaripoll avatar noelbenz avatar odddity avatar rpav avatar wahjava avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cl-freetype2's Issues

MacOS / homebrew include path change needed?

In order to get cl-freetype2 to work with my MacOS setup, I had to do the following. I would think that far more MacOS users have homebrew installed than MacPorts these days, BICBW.

diff --git i/src/ffi/grovel/grovel-freetype2.lisp w/src/ffi/grovel/grovel-freetype2.lisp
index a3aaa3d..84037ad 100644
--- i/src/ffi/grovel/grovel-freetype2.lisp
+++ w/src/ffi/grovel/grovel-freetype2.lisp
@@ -1,6 +1,8 @@
(in-package :freetype2-types)

(cc-flags #+darwin "-I/opt/local/include/freetype2"

  •      #+darwin "-I/usr/local/Cellar/freetype/2.9.1/include/freetype2/"
    
  •      #+darwin "-I/usr/local/Cellar/freetype/2.9.1/include/freetype2/freetype"
         #+freebsd "-I/usr/local/include/freetype2"
         #+(and windows x86-64) "-I/mingw64/include/freetype2"
         #+(and windows x86-64) "-Ic:/msys64/mingw64/include/freetype2"
    

CFFI 0.11

Compiling with CFFI 0.11 results in many warnings about deprecated bare references to structs. While this:

sed -i "s/',foreign-type-name/'(:struct ,foreign-type-name)/g" src/ffi/cffi-cwrap.lisp

will correct the majority of the warnings, fixing the remainder has me stumped. They seem to be caused by foreign structure types, as defined by define-foreign-type, being used.

Freetype2 is not working with sb-ext:save-lisp-and-die

Freetype is holding pointers to native memory and because of that compiled image is not working.

The fix is to make sure this form is being evaluated after the program started and not during the compile or load time.

Currently it is possible to workaround this by adding this in the toplevel form which is passed to save-lisp-and-die

Problematic form:

(setf freetype2:*library* (freetype2:make-freetype))

the other problem is loading the shared library (use-foreign-library) which also should happen at runtime

MAKE-VECTOR fails due to incorrect struct name

When creating a vector using MAKE-VECTOR, the following error is returned:

Unknown CFFI type (:STRUCT FREETYPE2-TYPES:FT-VECTOR)
   [Condition of type CFFI::UNDEFINED-FOREIGN-TYPE-ERROR]

The reason for this is a typo in that function. The following:

  (let ((vector (make-collected-foreign 'ft-vector
                                        '(:struct ft-vector))))

Should be replaced by:

  (let ((vector (make-collected-foreign 'ft-vector
                                        '(:struct foreign-ft-vector))))

Implementing custom load-render function

Hi,

I'm trying to implement a cache for the load-render in order to improve rendering speed. The full implementation is here:
https://github.com/dbjergaard/clx-ft2-renderer/blob/master/render.lisp

If your inclined to try to run the code, check it out to ${HOME}/quicklisp/local-projects/ and quickload it, then run (clx-freetype2-renderer:render-test), the code will fail with:

:NONE fell through ECASE expression.
Wanted one of (:LCD-V :LCD :GRAY :MONO).
   [Condition of type SB-KERNEL:CASE-FAILURE]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {1003EB0083}>)

Backtrace:
  0: (SB-KERNEL:CASE-FAILURE ECASE :NONE (:LCD-V :LCD :GRAY :MONO))
  1: (FREETYPE2:BITMAP-TO-ARRAY #<FREETYPE2-TYPES:FT-BITMAP {#X7FFFF0009978}>)
  2: (CLX-FREETYPE2-RENDERER::STRING-TO-ARRAY #<FREETYPE2-TYPES:FT-FACE "DejaVu Sans Oblique" {#x7FFFF000D520}> "⚡" :LEFT-RIGHT 11 19)

My load-render function looks like:

(defun load-render (face char vertical-p)
  (ft2:load-char face char (if vertical-p '(:vertical-layout) '(:default)))
  (let ((char-list (cache-char face char vertical-p *ft2-face-cache*)))
    (when char-list
      (values (aref char-list 0)
          (aref char-list 1)
          (aref char-list 2)
          (aref char-list 3)))))

cache-char is a wrapper of default-load-render that first checks if the char has been cached in *ft2-face-cache*

Could you give me any hints on how to correctly implement this method?

Mac OSX

Hi,

Small issue with the incorrect cc-flags for OSX. I have a patch if you would like it

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.