Commit 9fae1676 authored by Miller Puckette's avatar Miller Puckette
Browse files

font patch from HC

parent e84da8a6
......@@ -438,7 +438,7 @@ void iemgui_label_font(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *a
else
{
f = 0;
strcpy(iemgui->x_font, "courier");
strcpy(iemgui->x_font, sys_font);
}
iemgui->x_fsf.x_font_style = f;
f = (int)atom_getintarg(1, ac, av);
......@@ -446,8 +446,9 @@ void iemgui_label_font(void *x, t_iemgui *iemgui, t_symbol *s, int ac, t_atom *a
f = 4;
iemgui->x_fontsize = f;
if(glist_isvisible(iemgui->x_glist))
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold}\n",
glist_getcanvas(iemgui->x_glist), x, iemgui->x_font, iemgui->x_fontsize);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s}\n",
glist_getcanvas(iemgui->x_glist), x, iemgui->x_font,
iemgui->x_fontsize, sys_fontweight);
}
void iemgui_size(void *x, t_iemgui *iemgui)
......@@ -622,7 +623,7 @@ int iemgui_dialog(t_iemgui *iemgui, t_symbol **srl, int argc, t_atom *argv)
else
{
f = 0;
strcpy(iemgui->x_font, "courier");
strcpy(iemgui->x_font, sys_font);
}
iemgui->x_fsf.x_font_style = f;
if(fs < 4)
......
......@@ -144,7 +144,7 @@ typedef struct _iemgui
int x_w;
int x_ldx;
int x_ldy;
char x_font[16];
char x_font[MAXPDSTRING]; /* font names can be long! */
t_iem_fstyle_flags x_fsf;
int x_fontsize;
t_iem_init_symargs x_isa;
......
......@@ -55,11 +55,12 @@ void bng_draw_new(t_bng *x, t_glist *glist)
xpos + x->x_gui.x_w-1, ypos + x->x_gui.x_h-1,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx,
ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas, xpos,
......@@ -115,8 +116,8 @@ void bng_draw_config(t_bng* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxBASE -fill #%6.6x\n", canvas, x, x->x_gui.x_bcol);
......@@ -237,7 +238,7 @@ static void bng_properties(t_gobj *z, t_glist *owner)
t_symbol *srl[3];
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s BANG \
sprintf(buf, "pdtk_iemgui_dialog %%s |bang| \
----------dimensions(pix):----------- %d %d size: 0 0 empty \
--------flash-time(ms)(ms):--------- %d intrrpt: %d hold: %d \
%d empty empty %d %d empty %d \
......@@ -481,7 +482,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
......
......@@ -741,9 +741,9 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
{
i -= sys_fontheight(glist_getfont(x));
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor nw\
-font -*-courier-bold--normal--%d-* -tags %s\n",
(long)glist_getcanvas(x), x1, i, arrayname->s_name,
sys_hostfontsize(glist_getfont(x)), tag);
-font {{%s} %d %s} -tags %s\n",
(long)glist_getcanvas(x), x1, i, arrayname->s_name, sys_font,
sys_hostfontsize(glist_getfont(x)), sys_fontweight, tag);
}
/* draw ticks on horizontal borders. If lperb field is
......@@ -823,21 +823,22 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
/* draw x labels */
for (i = 0; i < x->gl_nxlabels; i++)
sys_vgui(".x%lx.c create text\
%d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n",
%d %d -text {%s} -font {{%s} %d %s} -tags %s\n",
glist_getcanvas(x),
(int)glist_xtopixels(x, atof(x->gl_xlabel[i]->s_name)),
(int)glist_ytopixels(x, x->gl_xlabely), x->gl_xlabel[i]->s_name,
glist_getfont(x), tag);
(int)glist_ytopixels(x, x->gl_xlabely),
x->gl_xlabel[i]->s_name, sys_font,
glist_getfont(x), sys_fontweight, tag);
/* draw y labels */
for (i = 0; i < x->gl_nylabels; i++)
sys_vgui(".x%lx.c create text\
%d %d -text {%s} -font -*-courier-bold--normal--%d-* -tags %s\n",
%d %d -text {%s} -font {{%s} %d %s} -tags %s\n",
glist_getcanvas(x),
(int)glist_xtopixels(x, x->gl_ylabelx),
(int)glist_ytopixels(x, atof(x->gl_ylabel[i]->s_name)),
x->gl_ylabel[i]->s_name,
glist_getfont(x), tag);
x->gl_ylabel[i]->s_name, sys_font,
glist_getfont(x), sys_fontweight, tag);
/* draw contents of graph as glist */
for (g = x->gl_list; g; g = g->g_next)
......
......@@ -73,10 +73,10 @@ void hradio_draw_new(t_hradio *x, t_glist *glist)
x->x_drawn = x->x_on;
}
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xx11b+x->x_gui.x_ldx, yy11+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
......@@ -141,8 +141,8 @@ void hradio_draw_config(t_hradio* x, t_glist* glist)
t_canvas *canvas=glist_getcanvas(glist);
int n=x->x_number, i;
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
for(i=0; i<n; i++)
......@@ -264,7 +264,7 @@ static void hradio_properties(t_gobj *z, t_glist *owner)
iemgui_properties(&x->x_gui, srl);
if (pd_class(&x->x_gui.x_obj.ob_pd) == hradio_old_class)
hchange = x->x_change;
sprintf(buf, "pdtk_iemgui_dialog %%s hradio \
sprintf(buf, "pdtk_iemgui_dialog %%s |hradio| \
----------dimensions(pix):----------- %d %d size: 0 0 empty \
empty 0.0 empty 0.0 empty %d \
%d new-only new&old %d %d number: %d \
......@@ -589,7 +589,7 @@ static void *hradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if(num < 1)
num = 1;
if(num > IEM_RADIO_MAX)
......
......@@ -76,11 +76,12 @@ static void hslider_draw_new(t_hslider *x, t_glist *glist)
canvas, r, ypos+1, r,
ypos + x->x_gui.x_h, x->x_gui.x_fcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx,
ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas, xpos-3, ypos + x->x_gui.x_h-1,
......@@ -136,8 +137,8 @@ static void hslider_draw_config(t_hslider* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxKNOB -fill #%6.6x\n", canvas, x, x->x_gui.x_fcol);
......@@ -285,7 +286,7 @@ static void hslider_properties(t_gobj *z, t_glist *owner)
t_symbol *srl[3];
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s HSLIDER \
sprintf(buf, "pdtk_iemgui_dialog %%s |hsl| \
--------dimensions(pix)(pix):-------- %d %d width: %d %d height: \
-----------output-range:----------- %g left: %g right: %g \
%d lin log %d %d empty %d \
......@@ -586,7 +587,7 @@ static void *hslider_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if(x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
......
......@@ -44,10 +44,11 @@ void my_canvas_draw_new(t_my_canvas *x, t_glist *glist)
xpos + x->x_gui.x_w, ypos + x->x_gui.x_h,
x->x_gui.x_bcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
}
void my_canvas_draw_move(t_my_canvas *x, t_glist *glist)
......@@ -84,8 +85,9 @@ void my_canvas_draw_config(t_my_canvas* x, t_glist* glist)
x->x_gui.x_bcol, x->x_gui.x_bcol);
sys_vgui(".x%lx.c itemconfigure %lxBASE -outline #%6.6x\n", canvas, x,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_bcol);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
}
......@@ -152,7 +154,7 @@ static void my_canvas_properties(t_gobj *z, t_glist *owner)
t_symbol *srl[3];
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s MY_CANVAS \
sprintf(buf, "pdtk_iemgui_dialog %%s |cnv| \
------selectable_dimensions(pix):------ %d %d size: 0.0 0.0 empty \
------visible_rectangle(pix)(pix):------ %d width: %d height: %d \
%d empty empty %d %d empty %d \
......@@ -331,7 +333,7 @@ static void *my_canvas_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
......
......@@ -195,15 +195,17 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
xpos, ypos + x->x_gui.x_h,
x->x_gui.x_fcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
my_numbox_ftoa(x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxNUMBER\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxNUMBER\n",
canvas, xpos+half+2, ypos+half+d,
x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_fcol, x);
x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas,
......@@ -269,12 +271,12 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxNUMBER -font {%s %d bold} -fill #%6.6x \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxNUMBER -font {{%s} %d %s} -fill #%6.6x \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_fcol);
sys_vgui(".x%lx.c itemconfigure %lxBASE1 -fill #%6.6x\n", canvas,
x, x->x_gui.x_bcol);
......@@ -451,7 +453,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner)
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
sprintf(buf, "pdtk_iemgui_dialog %%s NUMBERBOX \
sprintf(buf, "pdtk_iemgui_dialog %%s |nbx| \
-------dimensions(digits)(pix):------- %d %d width: %d %d height: \
-----------output-range:----------- %g min: %g max: %d \
%d lin log %d %d log-height: %d \
......@@ -806,7 +808,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if (x->x_gui.x_fsf.x_rcv_able)
pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
......
......@@ -15,10 +15,16 @@
#include "g_canvas.h"
#include "t_tk.h"
#define LMARGIN 1
#define RMARGIN 1
#define LMARGIN 2
#define RMARGIN 2
/* for some reason, it draws text 1 pixel lower on Mac OS X (& linux too?) */
#ifndef MSW
#define TMARGIN 2
#define BMARGIN 2
#else
#define TMARGIN 3
#define BMARGIN 1
#endif
#define SEND_FIRST 1
#define SEND_UPDATE 2
......
......@@ -2136,8 +2136,8 @@ static void drawnumber_vis(t_gobj *z, t_glist *glist,
drawnumber_sprintf(x, buf, &at);
sys_vgui(".x%lx.c create text %d %d -anchor nw -fill %s -text {%s}",
glist_getcanvas(glist), xloc, yloc, colorstring, buf);
sys_vgui(" -font -*-courier-bold--normal--%d-*",
sys_hostfontsize(glist_getfont(glist)));
sys_vgui(" -font {{%s} %d %s}", sys_font,
sys_hostfontsize(glist_getfont(glist)), sys_fontweight);
sys_vgui(" -tags drawnumber%lx\n", data);
}
else sys_vgui(".x%lx.c delete drawnumber%lx\n", glist_getcanvas(glist), data);
......
This diff is collapsed.
......@@ -61,11 +61,12 @@ void toggle_draw_new(t_toggle *x, t_glist *glist)
canvas, xx+w+1, yy + x->x_gui.x_h-w-1, xx + x->x_gui.x_w-w, yy+w, w,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xx+x->x_gui.x_ldx,
yy+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas, xx, yy + x->x_gui.x_h-1, xx + IOWIDTH, yy + x->x_gui.x_h, x, 0);
......@@ -120,8 +121,8 @@ void toggle_draw_config(t_toggle* x, t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxBASE -fill #%6.6x\n", canvas, x,
......@@ -225,7 +226,7 @@ static void toggle_properties(t_gobj *z, t_glist *owner)
t_symbol *srl[3];
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s TOGGLE \
sprintf(buf, "pdtk_iemgui_dialog %%s |tgl| \
----------dimensions(pix):----------- %d %d size: 0 0 empty \
-----------non-zero-value:----------- %g value: 0.0 empty %g \
-1 lin log %d %d empty %d \
......@@ -407,7 +408,7 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
x->x_nonzero = (nonzero!=0.0)?nonzero:1.0;
if(x->x_gui.x_isa.x_loadinit)
x->x_on = (on!=0.0)?nonzero:0.0;
......
......@@ -75,10 +75,10 @@ void vradio_draw_new(t_vradio *x, t_glist *glist)
x->x_drawn = x->x_on;
}
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xx11+x->x_gui.x_ldx, yy11b+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
......@@ -141,8 +141,8 @@ void vradio_draw_config(t_vradio* x, t_glist* glist)
t_canvas *canvas=glist_getcanvas(glist);
int n=x->x_number, i;
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
for(i=0; i<n; i++)
......@@ -265,7 +265,7 @@ static void vradio_properties(t_gobj *z, t_glist *owner)
iemgui_properties(&x->x_gui, srl);
if(pd_class(&x->x_gui.x_obj.ob_pd) == vradio_old_class)
hchange = x->x_change;
sprintf(buf, "pdtk_iemgui_dialog %%s vradio \
sprintf(buf, "pdtk_iemgui_dialog %%s |vradio| \
----------dimensions(pix):----------- %d %d size: 0 0 empty \
empty 0.0 empty 0.0 empty %d \
%d new-only new&old %d %d number: %d \
......@@ -590,7 +590,7 @@ static void *vradio_donew(t_symbol *s, int argc, t_atom *argv, int old)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if(num < 1)
num = 1;
if(num > IEM_RADIO_MAX)
......
......@@ -59,10 +59,11 @@ static void vslider_draw_new(t_vslider *x, t_glist *glist)
canvas, xpos+1, r,
xpos + x->x_gui.x_w, r, x->x_gui.x_fcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas,
......@@ -122,8 +123,8 @@ static void vslider_draw_config(t_vslider* x,t_glist* glist)
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
sys_vgui(".x%lx.c itemconfigure %lxKNOB -fill #%6.6x\n", canvas,
......@@ -277,7 +278,7 @@ static void vslider_properties(t_gobj *z, t_glist *owner)
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s VSLIDER \
sprintf(buf, "pdtk_iemgui_dialog %%s |vsl| \
--------dimensions(pix)(pix):-------- %d %d width: %d %d height: \
-----------output-range:----------- %g bottom: %g top: %d \
%d lin log %d %d empty %d \
......@@ -562,7 +563,7 @@ static void *vslider_new(t_symbol *s, int argc, t_atom *argv)
if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica");
else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv);
x->x_gui.x_ldx = ldx;
x->x_gui.x_ldy = ldy;
......
......@@ -116,17 +116,19 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
canvas, quad1, yyy, quad3, yyy, x->x_led_size, iemgui_color_hex[led_col], x, i);
if(((i+2)&3) && (x->x_scale))
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_lcol, x, i);
-font {{%s} %d %s} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i],
x->x_gui.x_font, x->x_gui.x_fontsize,
sys_fontweight, x->x_gui.x_lcol, x, i);
}
if(x->x_scale)
{
i=IEM_VU_STEPS+1;
yyy = k4 + k1*(k2-i);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
-font {{%s} %d %s} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font,
x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x, i);
}
sys_vgui(".x%lx.c create rectangle %d %d %d %d -fill #%6.6x -outline #%6.6x -tags %lxRCOVER\n",
......@@ -136,10 +138,11 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
canvas, mid, ypos+10,
mid, ypos+10, x->x_led_size, x->x_gui.x_bcol, x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxLABEL\n",
-font {{%s} %d %s} -fill #%6.6x -tags %lxLABEL\n",
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, x->x_gui.x_lcol, x);
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
{
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
......@@ -274,19 +277,21 @@ static void vu_draw_config(t_vu* x, t_glist* glist)
sys_vgui(".x%lx.c itemconfigure %lxRLED%d -width %d\n", canvas, x, i,
x->x_led_size);
if(((i+2)&3) && (x->x_scale))
sys_vgui(".x%lx.c itemconfigure %lxSCALE%d -text {%s} -font {%s %d bold} -fill #%6.6x\n",
canvas, x, i, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxSCALE%d -text {%s} -font {{%s} %d %s} -fill #%6.6x\n",
canvas, x, i, iemgui_vu_scale_str[i], x->x_gui.x_font,
x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol);
}
if(x->x_scale)
{
i=IEM_VU_STEPS+1;
sys_vgui(".x%lx.c itemconfigure %lxSCALE%d -text {%s} -font {%s %d bold} -fill #%6.6x\n",
canvas, x, i, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxSCALE%d -text {%s} -font {{%s} %d %s} -fill #%6.6x\n",
canvas, x, i, iemgui_vu_scale_str[i], x->x_gui.x_font,
x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol);
}
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {%s %d bold} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize,
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} %d %s} -fill #%6.6x -text {%s} \n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_fsf.x_selected?IEM_GUI_COLOR_SELECTED:x->x_gui.x_lcol,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"");
......@@ -476,16 +481,18 @@ static void vu_scale(t_vu *x, t_floatarg fscale)
yyy = k4 + k1*(k2-i);
if((i+2)&3)
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_lcol, x, i);
-font {{%s} %d %s} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i],
x->x_gui.x_font, x->x_gui.x_fontsize,
sys_fontweight, x->x_gui.x_lcol, x, i);
}
i=IEM_VU_STEPS+1;
yyy = k4 + k1*(k2-i);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {%s %d bold} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i], x->x_gui.x_font, x->x_gui.x_fontsize,
x->x_gui.x_lcol, x, i);
-font {{%s} %d %s} -fill #%6.6x -tags %lxSCALE%d\n",
canvas, end, yyy+k3, iemgui_vu_scale_str[i],
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
sys_fontweight, x->x_gui.x_lcol, x, i);
}
}
}
......@@ -497,7 +504,7 @@ static void vu_properties(t_gobj *z, t_glist *owner)
t_symbol *srl[3];
iemgui_properties(&x->x_gui, srl);
sprintf(buf, "pdtk_iemgui_dialog %%s VU-METER \
sprintf(buf, "pdtk_iemgui_dialog %%s |vu| \
--------dimensions(pix)(pix):-------- %d %d width: %d %d height: \
empty 0.0 empty 0.0 empty %d \
%d no_scale scale %d %d empty %d \
......@@ -627,7 +634,7 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv)
t_vu *x = (t_vu *)pd_new(vu_class);
int bflcol[]={-66577, -1, -1};
int w=IEM_GUI_DEFAULTSIZE, h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE;
int ldx=-1, ldy=-8, f=0, fs=8, scale=1;
int ldx=-1, ldy=-8, f=0, fs=10, scale=1;
int ftbreak=IEM_BNG_DEFAULTBREAKFLASHTIME, fthold=IEM_BNG_DEFAULTHOLDFLASHTIME;
char str[144];
......@@ -667,7 +674,7 @@ static void *vu_new(t_symbol *s, int argc, t_atom *argv)
else if(x->x_gui.x_fsf.x_font_style == 2)
strcpy(x->x_gui.x_font, "times");
else { x->x_gui.x_fsf.x_font_style = 0;
strcpy(x->x_gui.x_font, "courier"); }
strcpy(x->x_gui.x_font, sys_font); }
if(x->x_gui.x_fsf.x_rcv_able)