[PD-dev] pd.tk [fonts]

Thomas Musil musil at iem.kug.ac.at
Wed Sep 4 20:06:44 CEST 2002


Hi Andre

replace "-font [format -*-courier-----%d-* $font]" by "-font $fontname".

############ pdtk_text_new -- create a new text object #2###########
 proc pdtk_text_new {canvasname myname x y text font color} {
     if {$font < 8} {set fontname [format -*-pufo-----%d-* $font]}
     if {$font >= 8} {set fontname [format -*-courier-----%d-* $font]}
     $canvasname create text $x $y \
      -font [format $fontname $font] \
      -tags $myname -text $text -fill $color  -anchor nw
 #    pd [concat $myname size [$canvasname bbox $myname] \;]
}


but maybe, you don't see a difference with a smaller font then 8.

good luck

Thomas Musil


> Andre Schmidt wrote:
> 
> hi devs,
> 
> i couldnt let my fingers from it :) so i'm working on the fonts again..
> but i got a problem. can i use a specific font for a specific size ?
> ex. i wanted to use my font (pufo) only for size 7.. i found this on pd.tk but it doesn't seem
> to work so like i wanted/thought... (sorry i'm working @ TAE style)[TAE = trial and error]
> 
> ############ pdtk_text_new -- create a new text object #2###########
> proc pdtk_text_new {canvasname myname x y text font color} {
>     if {$font < 8} {set fontname [format -*-pufo-----%d-* $font]}
>     if {$font >= 8} {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] \;]
> }
> 
> as i read it with my very limited coding skills it would be if size smaller than 8 use my
> font, right?!
> well, the if(s) where marked unused so could be that they are not compatible with the rest of
> the code...
> but if this feature (specific fonts for specific sizes) is not supported in the code it's not
> a must. i just wanted it for my test...
> 
> cheers
> -andre




More information about the Pd-dev mailing list