[PD] DejaVu Font: Shipping & using on W32

Lucas Cordiviola lucarda27 at hotmail.com
Tue Feb 14 12:35:12 CET 2017


Ok, cool.


I add the previous code links here for us to remember:


https://msdn.microsoft.com/en-us/library/windows/desktop/ms533820(v=vs.85).aspx


http://code.activestate.com/lists/tcl-core/8158/#sthash.qJEhQALT.dpuf<http://code.activestate.com/lists/tcl-core/8158/#sthash.qJEhQALT.dpuf>



Mensaje telepatico asistido por maquinas.


________________________________
From: Dan Wilcox <danomatika at gmail.com>
Sent: Monday, February 13, 2017 8:48 PM
To: Lucas Cordiviola
Cc: Miller Puckette; Pd-List
Subject: Re: DejaVu Font: Shipping & using on W32

Cool, good to know that in theory it works. I also found a related solution which uses a different extension do the same thing: http://wiki.tcl.tk/22262

However, I’d say that requiring a tcl/tk extension may not be the best overall solution since historically Pd has avoided requiring anything beyond the base tcl/tk.

A possible best approach is take the example C code for the forum post and make a *tiny* custom extension that is built only on Windows and loaded by the tk gui in order to load the private font. I don’t think we can simply add the font loading code to the core itself since it’s a separate process from the gui.

In any case, this is something I can look into after I put together a triple boot machine to test some things on different platforms, including the vanilla autotools build on win.

On Feb 13, 2017, at 10:43 AM, Lucas Cordiviola <lucarda27 at hotmail.com<mailto:lucarda27 at hotmail.com>> wrote:

Following Dan`s suggestion to ship & use a font without installing it, I came to a very straight-forward method for w32.

Tested & working.

It uses a Tcl Windows API extension. (600KB)

twapi web:
http://twapi.sourceforge.net/v4.1/installation.html


twapi package:
https://sourceforge.net/projects/twapi/files/Current%20Releases/Tcl%20Windows%20API/twapi-4.1.27/


added lines on "pd-gui.tcl" @line 24:

# adding dejavu fonts on mswindows
package require twapi
twapi::AddFontResourceEx DejaVuSansMono.ttf
twapi::AddFontResourceEx DejaVuSansMono-Bold.ttf

0000000

Don't know how to exclude this "package require" for the other OSs.
The .ttf were placed on pd/bin for simplicity.

--------
Dan Wilcox
@danomatika<http://twitter.com/danomatika>
danomatika.com<http://danomatika.com>
robotcowboy.com<http://robotcowboy.com>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170214/72dd33c2/attachment.html>


More information about the Pd-list mailing list