Font weights
"Erik Ronström (as erik dot ronstrom at doremir dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Although not documented, this works on Mac:
(capi:contain
(make-instance 'capi:column-layout
:description (loop for weight in '(:normal :semibold :bold) collect
(make-instance 'capi:push-button :text "Text on a button"
:font (gp:make-font-description
:family "American Typewriter"
:size 14
:weight weight)))))
Using numbers (100–900) for weights also works well.
However, on Windows I haven’t found any way to specify other font weights than normal or bold using the :weight parameter.
In some cases you can specify the full name of the font as :family, for instance, (gp:make-font-description :family "Segoe UI Semibold" :size 14 :weight nil) gives me the semibold version of Segoe UI. However, asking for ”Segoe UI Bold” doesn’t work on my Swedish system as it appears as ”Segoe UI Fet” (”fet” is ”bold” in Swedish). So this way is clearly not portable.
(As a workaround, I could list all fonts and checking their weights in capi-internals, but that feels sketchy at best)
Is there any good way to access various font weights from LispWorks on Windows?
Erik
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html