Version 0 of fontmap

Updated 2015-12-07 16:52:00 by arw

arw (Dec 2015): here is an example of a fontmap when exporting the canvas content to a postscript

package require Tk

canvas .c
pack .c -fill both -expand TRUE

set txt "Lorem ipsum dolor sit amet..."
.c create text 50 40 -text $txt -anchor w -font "*-Helvetica-Medium-R-Normal-*-12-*" 
.c create text 50 80 -text $txt -anchor w -font "*-Times-Bold-R-Normal-*-14-*" 
.c create text 50 120 -text $txt -anchor w -font "*-Courier-Normal-R-Normal-*-16-*"

set fm(*-Helvetica-Medium-R-Normal-*-12-*) [list Helvetica 12]
set fm(*-Times-Bold-R-Normal-*-14-*) [list Times 12]
set fm(*-Courier-Normal-R-Normal-*-16-*) [list Courier 12]

.c postscript -file test.ps -fontmap fm

However, I don't know how to get the X-font names for an arbitrary font created with font create, for example,

package require Tk
set tt [toplevel .1]

pack [canvas .1.c] -fill both -expand TRUE

set dv [font create -family {DejaVu Sans}]

.1.c create text 100 50 -text "Hello World" -font $dv