Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
------------------------------------------------------------------------
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Thanks much. I'll take a look. But now after fiddling with different fonts, it seems that its the fonts themselves that have different placement. Bitstream Vera Sans Mono seems to be too high up. Lucida Grande looks much better:
http://bam.idmi.poly.edu/~hans/pdfonts/
Since I am on the topic, I thought I'd post about what I did to get the same size boxes on each platform. It's pretty simple actually, I just hardcoded the values, eliminating all the Tcl/Tk and Pd that tries to guess the box size based on font measurements. Basically, the Courier font that is provided on each platform is not the same font at all. They are all different heights and widths. So the way around this is to use the exact same font on each platform. That's why I choose Bitstream Vera Sans Mono. It is available under a BSD- ish license and works on all platforms. I originally thought that a mono-spaced font was necessary, but after seeing Lucida Grande, I think a proportional font works nicely.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------
All information should be free. - the hacker ethic
I agree that Lucida Grand is good. Keep up the good work on this, Pd craves beauty.
~Kyle
On 1/10/07, Hans-Christoph Steiner hans@eds.org wrote:
Thanks much. I'll take a look. But now after fiddling with different fonts, it seems that its the fonts themselves that have different placement. Bitstream Vera Sans Mono seems to be too high up. Lucida Grande looks much better:
http://bam.idmi.poly.edu/~hans/pdfonts/
Since I am on the topic, I thought I'd post about what I did to get the same size boxes on each platform. It's pretty simple actually, I just hardcoded the values, eliminating all the Tcl/Tk and Pd that tries to guess the box size based on font measurements. Basically, the Courier font that is provided on each platform is not the same font at all. They are all different heights and widths. So the way around this is to use the exact same font on each platform. That's why I choose Bitstream Vera Sans Mono. It is available under a BSD- ish license and works on all platforms. I originally thought that a mono-spaced font was necessary, but after seeing Lucida Grande, I think a proportional font works nicely.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
All information should be free. - the hacker ethic
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
It turns out that the fonts seem to vary quite a bit in their positioning... what a pain... I still think the way to handle this is to just set the boxes to pixel sizes, then let the fonts fall where they may. Too bad there isn't a free Lucida, or Inconsolata isn't done yet... I can't seem to get Tcl to use Inconsolata, maybe because its a .otf not a .ttf.
One question I have is whether Pd really needs a monospaced font. It looks quite good with Lucida Grande, which is proportional.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
It's much more trouble to adapt Pd to use variable-width fonts, but totally possible. The trouble is the code that figures out where to put line breaks fitting text into boxes and then how big to make the box around the text. Not the end of the world, I don't think.
cheers Miller
On Tue, Jan 16, 2007 at 11:45:26PM -0500, Hans-Christoph Steiner wrote:
It turns out that the fonts seem to vary quite a bit in their positioning... what a pain... I still think the way to handle this is to just set the boxes to pixel sizes, then let the fonts fall where they may. Too bad there isn't a free Lucida, or Inconsolata isn't done yet... I can't seem to get Tcl to use Inconsolata, maybe because its a .otf not a .ttf.
One question I have is whether Pd really needs a monospaced font. It looks quite good with Lucida Grande, which is proportional.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
Maybe its possible to have Tk do all the sizing, then have pd query Tk to get the sizes. That would allow for the Tk scaling, which would be very nice to have because it keeps the all the layout relationships the same, it just zooms it. That'd be much more useful that different font sizes.
.hc
On Jan 16, 2007, at 11:56 PM, Miller Puckette wrote:
It's much more trouble to adapt Pd to use variable-width fonts, but totally possible. The trouble is the code that figures out where to put line breaks fitting text into boxes and then how big to make the box around the text. Not the end of the world, I don't think.
cheers Miller
On Tue, Jan 16, 2007 at 11:45:26PM -0500, Hans-Christoph Steiner wrote:
It turns out that the fonts seem to vary quite a bit in their positioning... what a pain... I still think the way to handle this is to just set the boxes to pixel sizes, then let the fonts fall where they may. Too bad there isn't a free Lucida, or Inconsolata isn't done yet... I can't seem to get Tcl to use Inconsolata, maybe because its a .otf not a .ttf.
One question I have is whether Pd really needs a monospaced font. It looks quite good with Lucida Grande, which is proportional.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
--
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
------------------------------------------------------------------------
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
That's what Pd is supposed to be doing now (although for a fixed-pitch font...) so it would be easy enough to adapt to a variable one.
The trouble I've always had is that I was never able to find any fonts at all that had similar sizes across platforms. Pd currently fishes around for the fint that has the most nearly "ideal" size, where "ideal" is approsimately the Courier font on Linux.
cheers Miller On Wed, Jan 17, 2007 at 12:27:40AM -0500, Hans-Christoph Steiner wrote:
Maybe its possible to have Tk do all the sizing, then have pd query Tk to get the sizes. That would allow for the Tk scaling, which would be very nice to have because it keeps the all the layout relationships the same, it just zooms it. That'd be much more useful that different font sizes.
.hc
On Jan 16, 2007, at 11:56 PM, Miller Puckette wrote:
It's much more trouble to adapt Pd to use variable-width fonts, but totally possible. The trouble is the code that figures out where to put line breaks fitting text into boxes and then how big to make the box around the text. Not the end of the world, I don't think.
cheers Miller
On Tue, Jan 16, 2007 at 11:45:26PM -0500, Hans-Christoph Steiner wrote:
It turns out that the fonts seem to vary quite a bit in their positioning... what a pain... I still think the way to handle this is to just set the boxes to pixel sizes, then let the fonts fall where they may. Too bad there isn't a free Lucida, or Inconsolata isn't done yet... I can't seem to get Tcl to use Inconsolata, maybe because its a .otf not a .ttf.
One question I have is whether Pd really needs a monospaced font. It looks quite good with Lucida Grande, which is proportional.
.hc
On Jan 8, 2007, at 2:49 PM, Miller Puckette wrote:
In g_rtext.c:
sys_vgui("pdtk_text_new .x%lx.c %s %f %f {%.*s} %d %s\n", canvas, x->x_tag, dispx + LMARGIN, dispy + TMARGIN, outchars, tempbuf, sys_hostfontsize(font), (glist_isselected(x->x_glist, &x->x_glist->gl_gobj)? "blue" : "black"));
places the text, and the border gets drawn in the text_drawborder() function. I couldn't spot anything platform-dependent in the code, although I've noticed that drawing comes out differently on Mac compared to other platforms - create a slider, for instance and look at the bar. I believe Pd corrects for that when drawing inlets/outlet on objects, but I don't think there's anywhere else.
cheers Miller
On Mon, Jan 08, 2007 at 01:20:49PM -0500, Hans-Christoph Steiner wrote:
Can anyone point me to where the text is placed on the canvas in relation to the object and message boxes? It seems to vary depending on platform and I'd like to troubleshoot it.
.hc
--
As we enjoy great advantages from inventions of others, we should be glad of an opportunity to serve others by any invention of ours; and this we should do freely and generously. - Benjamin Franklin
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
One question I have is whether Pd really needs a monospaced font. It looks quite good with Lucida Grande, which is proportional.
I really prefer a monospaced default font even from an aesthetic point of view.
[t b b] | | [timer]
just looks cooler in monospace, plus I already have two [bang( t-shirts.
It wouldn't have to be Courier, though. A non-proportional font would be nice to have available as an alternative for comments, like in Cyclone's [Comment] object.
Ciao