Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24238
Modified Files: Tag: devel_0_38 s_inter.c s_main.c u_main.tk Log Message: oops ... added -typeface option again
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.3 retrieving revision 1.5.4.4 diff -C2 -d -r1.5.4.3 -r1.5.4.4 *** s_inter.c 11 Nov 2004 22:30:42 -0000 1.5.4.3 --- s_inter.c 12 Nov 2004 08:21:20 -0000 1.5.4.4 *************** *** 88,91 **** --- 88,92 ---- extern char pd_version[]; extern int sys_guisetportnumber; + extern char sys_font[]; /* tb: typeface */
static int sys_nfdpoll; *************** *** 1213,1217 **** #endif sys_get_audio_apis(buf); ! sys_vgui("pdtk_pd_startup {%s} %s\n", pd_version, buf); } return (0); --- 1214,1219 ---- #endif sys_get_audio_apis(buf); ! sys_vgui("pdtk_pd_startup {%s} %s {%s}\n", pd_version, buf, ! sys_font); } return (0);
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -C2 -d -r1.7.4.3 -r1.7.4.4 *** s_main.c 11 Nov 2004 22:30:42 -0000 1.7.4.3 --- s_main.c 12 Nov 2004 08:21:20 -0000 1.7.4.4 *************** *** 75,78 **** --- 75,79 ---- int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
+ char sys_font[] = "courier"; /* tb: font name */ static int sys_main_srate; static int sys_main_dacblocksize = DEFDACBLKSIZE; *************** *** 406,409 **** --- 407,411 ---- "-lib <file> -- load object library(s)\n", "-font <n> -- specify default font size in points\n", + "-typeface <name> -- specify default font (default: courier)\n", "-verbose -- extra printout on startup and when searching for files\n", "-version -- don't run Pd; just print out which version it is \n", *************** *** 774,777 **** --- 776,787 ---- argv += 2; } + /* tb: font name { */ + else if (!strcmp(*argv, "-typeface") && argc > 1) + { + strcpy(sys_font,*(argv+1)); + argc -= 2; + argv += 2; + } + /* } tb */ else if (!strcmp(*argv, "-verbose")) {
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.4.4.4 retrieving revision 1.4.4.5 diff -C2 -d -r1.4.4.4 -r1.4.4.5 *** u_main.tk 11 Nov 2004 22:30:42 -0000 1.4.4.4 --- u_main.tk 12 Nov 2004 08:21:20 -0000 1.4.4.5 *************** *** 316,322 **** global pd_guidir global pd_myversion set name [format ".help%d" $doc_number] toplevel $name ! text $name.text -relief raised -bd 2 -font -*-courier-bold--normal--12-* \ -yscrollcommand "$name.scroll set" -background white scrollbar $name.scroll -command "$name.text yview" --- 316,323 ---- global pd_guidir global pd_myversion + global pd_font3 set name [format ".help%d" $doc_number] toplevel $name ! text $name.text -relief raised -bd 2 -font $pd_font3 \ -yscrollcommand "$name.scroll set" -background white scrollbar $name.scroll -command "$name.text yview" *************** *** 2687,2691 ****
proc pdtk_data_dialog {name stuff} { ! toplevel $name wm title $name {Atom} --- 2688,2692 ----
proc pdtk_data_dialog {name stuff} { ! global pd_font3 toplevel $name wm title $name {Atom} *************** *** 2702,2706 ****
text $name.text -relief raised -bd 2 -height 40 -width 60 \ ! -yscrollcommand "$name.scroll set" -font -*-courier-bold--normal--12-* scrollbar $name.scroll -command "$name.text yview" pack $name.scroll -side right -fill y --- 2703,2707 ----
text $name.text -relief raised -bd 2 -height 40 -width 60 \ ! -yscrollcommand "$name.scroll set" -font pd_font3 scrollbar $name.scroll -command "$name.text yview" pack $name.scroll -side right -fill y *************** *** 2727,2732 **** # if {$font < 13} {set fontname [format -*-courier-bold----%d-* $font]} # if {$font >= 13} {set fontname [format -*-courier-----%d-* $font]} $canvasname create text $x $y \ ! -font [format -*-courier-bold--normal--%d-* $font] \ -tags $myname -text $text -fill $color -anchor nw # pd [concat $myname size [$canvasname bbox $myname] ;] --- 2728,2745 ---- # if {$font < 13} {set fontname [format -*-courier-bold----%d-* $font]} # if {$font >= 13} {set fontname [format -*-courier-----%d-* $font]} + + global pd_font1 pd_font2 pd_font3 pd_font4 pd_font5 pd_font6 pd_font7 + switch -- $font { + 8 { set typeface $pd_font1 } + 10 { set typeface $pd_font2 } + 12 { set typeface $pd_font3 } + 14 { set typeface $pd_font4 } + 16 { set typeface $pd_font5 } + 24 { set typeface $pd_font6 } + 36 { set typeface $pd_font7 } + } + $canvasname create text $x $y \ ! -font $typeface \ -tags $myname -text $text -fill $color -anchor nw # pd [concat $myname size [$canvasname bbox $myname] ;] *************** *** 2759,2787 **** # font sizes 8, 10, 12, 14, 16, and 24.
! proc pdtk_pd_startup {version apilist} { global pd_myversion pd_apilist set pd_myversion $version set pd_apilist $apilist
! set width1 [font measure -*-courier-bold--normal--8-* x] ! set height1 [lindex [font metrics -*-courier-bold--normal--8-*] 5] ! ! set width2 [font measure -*-courier-bold--normal--10-* x] ! set height2 [lindex [font metrics -*-courier-bold--normal--10-*] 5] ! ! set width3 [font measure -*-courier-bold--normal--12-* x] ! set height3 [lindex [font metrics -*-courier-bold--normal--12-*] 5] ! ! set width4 [font measure -*-courier-bold--normal--14-* x] ! set height4 [lindex [font metrics -*-courier-bold--normal--14-*] 5] ! ! set width5 [font measure -*-courier-bold--normal--16-* x] ! set height5 [lindex [font metrics -*-courier-bold--normal--16-*] 5] ! ! set width6 [font measure -*-courier-bold--normal--24-* x] ! set height6 [lindex [font metrics -*-courier-bold--normal--24-*] 5]
! set width7 [font measure -*-courier-bold--normal--36-* x] ! set height7 [lindex [font metrics -*-courier-bold--normal--36-*] 5]
set tclpatch [info patchlevel] --- 2772,2805 ---- # font sizes 8, 10, 12, 14, 16, and 24.
! # tb: user defined typefaces ! proc pdtk_pd_startup {version apilist fontname} { ! puts stderr [concat $version $apilist $fontname] global pd_myversion pd_apilist set pd_myversion $version set pd_apilist $apilist + global pd_font1 pd_font2 pd_font3 pd_font4 pd_font5 pd_font6 pd_font7
! set pd_font1 [format -*-%s-bold--normal--8-* $fontname] ! set pd_font2 [format -*-%s-bold--normal--10-* $fontname] ! set pd_font3 [format -*-%s-bold--normal--12-* $fontname] ! set pd_font4 [format -*-%s-bold--normal--14-* $fontname] ! set pd_font5 [format -*-%s-bold--normal--16-* $fontname] ! set pd_font6 [format -*-%s-bold--normal--24-* $fontname] ! set pd_font7 [format -*-%s-bold--normal--36-* $fontname]
! set width1 [font measure $pd_font1 x] ! set height1 [lindex [font metrics $pd_font1] 5] ! set width2 [font measure $pd_font2 x] ! set height2 [lindex [font metrics $pd_font2] 5] ! set width3 [font measure $pd_font3 x] ! set height3 [lindex [font metrics $pd_font3] 5] ! set width4 [font measure $pd_font4 x] ! set height4 [lindex [font metrics $pd_font4] 5] ! set width5 [font measure $pd_font5 x] ! set height5 [lindex [font metrics $pd_font5] 5] ! set width6 [font measure $pd_font6 x] ! set height6 [lindex [font metrics $pd_font6] 5] ! set width7 [font measure $pd_font7 x] ! set height7 [lindex [font metrics $pd_font7] 5]
set tclpatch [info patchlevel] *************** *** 2867,2871 ****
proc pdtk_pd_texteditor {stuff} { ! global edit_number set name [format ".text%d" $edit_number] set edit_number [expr $edit_number + 1] --- 2885,2889 ----
proc pdtk_pd_texteditor {stuff} { ! global edit_number pd_font3 set name [format ".text%d" $edit_number] set edit_number [expr $edit_number + 1] *************** *** 2884,2888 ****
text $name.text -relief raised -bd 2 -height 12 -width 60 \ ! -yscrollcommand "$name.scroll set" -font -*-courier-bold--normal--12-* scrollbar $name.scroll -command "$name.text yview" pack $name.scroll -side right -fill y --- 2902,2906 ----
text $name.text -relief raised -bd 2 -height 12 -width 60 \ ! -yscrollcommand "$name.scroll set" -font $pd_font3 scrollbar $name.scroll -command "$name.text yview" pack $name.scroll -side right -fill y