Lisp HUG Maillist Archive

gp:find-best-font - does not eat :wild attributes?

Im calling gp:find-best-font in functions which might be handed
font-descriptions containing :wild attributes.

  (gp:find-best-font (capi:convert-to-screen) (gp:make-font-description))

is ok, but

  (gp:find-best-font (capi:convert-to-screen) (gp:make-font-description :family :wild))

or any other :wild attribute in the font-desc breaks inside a ffi-call.
Seems lw wants to pass :wild as second arg to
pango-font-description-set-family, which i presume will never work.

Is the call to gp:find-best-font with :wild attributes expected to work?

Cheers,

-anders

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: gp:find-best-font - does not eat :wild attributes?

What platform are you on? Linux, I would guess since you mention Pango (?)

Using :wild for family seems to work on both Windows and Mac OS X.


As a side note, on Windows, I've noticed kind of opposite problem: gp:find-matching-fonts doesn't return all matching fonts unless you explicitly provide :wild as an argument for :weight:

CL-USER 7 > (gp:find-matching-fonts (capi:convert-to-screen) (gp:make-font-description :family "Arial"))
(#S(GRAPHICS-PORTS:FONT :FONT-DESCRIPTION #S(GRAPHICS-PORTS:FONT-DESCRIPTION :ATTRIBUTES (:FAMILY "Arial" :WEIGHT :NORMAL :SLANT :ROMAN :SIZE :ANY :UNDERLINE NIL :STRIKEOUT NIL :WIDTH :ANY :CHARSET :ANSI :PITCH :VARIABLE :W-FAMILY :SWISS :DEVICEP NIL :TYPE :TRUETYPE)) :DEVICE-FONT NIL))

CL-USER 8 > (gp:find-matching-fonts (capi:convert-to-screen) (gp:make-font-description :family "Arial" :weight :wild))
(#S(GRAPHICS-PORTS:FONT :FONT-DESCRIPTION #S(GRAPHICS-PORTS:FONT-DESCRIPTION :ATTRIBUTES (:FAMILY "Arial" :WEIGHT :BOLD :SLANT :ROMAN :SIZE :ANY :UNDERLINE NIL :STRIKEOUT NIL :WIDTH :ANY :CHARSET :ANSI :PITCH :VARIABLE :W-FAMILY :SWISS :DEVICEP NIL :TYPE :TRUETYPE)) :DEVICE-FONT NIL) #S(GRAPHICS-PORTS:FONT :FONT-DESCRIPTION #S(GRAPHICS-PORTS:FONT-DESCRIPTION :ATTRIBUTES (:FAMILY "Arial" :WEIGHT :NORMAL :SLANT :ROMAN :SIZE :ANY :UNDERLINE NIL :STRIKEOUT NIL :WIDTH :ANY :CHARSET :ANSI :PITCH :VARIABLE :W-FAMILY :SWISS :DEVICEP NIL :TYPE :TRUETYPE)) :DEVICE-FONT NIL))

Same goes for :slant.

Erik



2 jan 2014 kl. 20:17 skrev anders.vinjar@bek.no:

> 
> Im calling gp:find-best-font in functions which might be handed
> font-descriptions containing :wild attributes.
> 
> (gp:find-best-font (capi:convert-to-screen) (gp:make-font-description))
> 
> is ok, but
> 
> (gp:find-best-font (capi:convert-to-screen) (gp:make-font-description :family :wild))
> 
> or any other :wild attribute in the font-desc breaks inside a ffi-call.
> Seems lw wants to pass :wild as second arg to
> pango-font-description-set-family, which i presume will never work.
> 
> Is the call to gp:find-best-font with :wild attributes expected to work?
> 
> Cheers,
> 
> -anders
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: gp:find-best-font - does not eat :wild attributes?

    E> What platform are you on? Linux, I would guess since you mention
    E> Pango (?)

Linux, yes.

    E> Using :wild for family seems to work on both Windows and Mac OS
    E> X.

I guess its a bug in a ffi-call in lwgtk then, or perhaps somewhere
before that.  The error which is signalled is:

  :WILD is not a string, for foreign type ":EF-MB-STRING"

The break comes from ff LWGTK:PANGO-FONT-DESCRIPTION-SET-FAMILY being
called with :wild as an argument, where it needs to pass a pointer it
seems.

Ive sent a bug-form to support, lets see what they have to say about it.

-anders

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:34 UTC