It seems that many parts of Pd use fonts: Gem, PDP/PiDiP, pixelTANGO, etc. It would be handy to have a centralized system for specifying where the fonts are located.
What about adding a fontpath var to Pd-core, like "path" and "helppath"?
.hc
________________________________________________________________________ ____
"Computer science is no more related to the computer than astronomy is related to the telescope." -Edsger Dykstra
On Apr 3, 2006, at 7:36 PM, Hans-Christoph Steiner wrote:
It seems that many parts of Pd use fonts: Gem, PDP/PiDiP, pixelTANGO, etc. It would be handy to have a centralized system for specifying where the fonts are located.
What about adding a fontpath var to Pd-core, like "path" and "helppath"?
...a fontpath would be good, but it'd also be nice if it just found them within the normal "path" setup: IOhannes has done something similar in Gem for finding programs/shaders, so I'll put this on the "to-do-0.91" for gem's font-handling...
jamie
Hi James,
This sounds really interesting, where can I get more info on what Johannes's has done?
Clearly it makes sense for pT to use the same font-handling setup as Gem.
though I'm not convinced by the fonts living in the extra/ path, since this is what I've been doing in pT and it only makes sense if Gem is distributed with fonts, pT still has only two, the ones that are distributed with Gem... Much more logical to allow Gem (or an abstraction) to deal with fonts on the system...
.b.
james tittle wrote:
On Apr 3, 2006, at 7:36 PM, Hans-Christoph Steiner wrote:
It seems that many parts of Pd use fonts: Gem, PDP/PiDiP, pixelTANGO, etc. It would be handy to have a centralized system for specifying where the fonts are located.
What about adding a fontpath var to Pd-core, like "path" and "helppath"?
...a fontpath would be good, but it'd also be nice if it just found them within the normal "path" setup: IOhannes has done something similar in Gem for finding programs/shaders, so I'll put this on the "to-do-0.91" for gem's font-handling...
jamie
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
hey ben,
On Apr 4, 2006, at 12:08 PM, B. Bogart wrote:
This sounds really interesting, where can I get more info on what Johannes's has done?
...hmm, it's in Manips/vertex_program.cpp, specifically:
void vertex_program :: openMess(t_symbol *filename) { char buf2[MAXPDSTRING]; char *bufptr=NULL;
if(NULL==filename || NULL==filename->s_name || &s_==filename || 0==*filename->s_name)return;
// Clean up any open files closeMess();
int fd=-1; if ((fd=open_via_path(canvas_getdir(getCanvas())->s_name, filename-
s_name, "",
buf2, &bufptr, MAXPDSTRING, 1))>=0){ close(fd); sprintf(m_buf, "%s/%s", buf2, bufptr); } else canvas_makefilename(getCanvas(), filename->s_name, m_buf, MAXPDSTRING);
FILE *file = fopen(m_buf,"r"); if(file) { fseek(file,0,SEEK_END); int size = ftell(file); m_programString = new char[size + 1]; memset(m_programString,0,size + 1); fseek(file,0,SEEK_SET); fread(m_programString,1,size,file); fclose(file); } else { m_programString = new char[strlen(m_buf) + 1]; strcpy(m_programString,m_buf); } m_size=strlen(m_programString); m_programType=queryProgramtype(m_programString); if(m_programType==GEM_PROGRAM_none){ m_programID = 0; char *s = m_programString; while(*s && *s != '\n') s++; *s = '\0'; post("[%s]: unknown program header "%s" or error open "%s" file\n", m_objectname->s_name, m_programString,filename->s_name);
delete m_programString; m_programString=NULL; m_size=0; return; }
post("[%s]: Loaded file: %s\n", m_objectname->s_name, m_buf); }
...I think the part to focus on here would be "open_via_path()"...
Clearly it makes sense for pT to use the same font-handling setup as Gem.
though I'm not convinced by the fonts living in the extra/ path, since this is what I've been doing in pT and it only makes sense if Gem is distributed with fonts, pT still has only two, the ones that are distributed with Gem... Much more logical to allow Gem (or an abstraction) to deal with fonts on the system...
...the only fonts that are distributed with Gem are the ones in the examples/data folder, and the help files are setup to reference them there...but it makes more sense to have the normal pd paths looked in when search for a font: perhaps we should add the system fonts to (ie. /Library/Fonts, /System/Library/Fonts, ~/Library/Fonts )?
jamie
james tittle wrote:
On Apr 3, 2006, at 7:36 PM, Hans-Christoph Steiner wrote:
It seems that many parts of Pd use fonts: Gem, PDP/PiDiP, pixelTANGO, etc. It would be handy to have a centralized system for specifying where the fonts are located.
What about adding a fontpath var to Pd-core, like "path" and "helppath"?
...a fontpath would be good, but it'd also be nice if it just found them within the normal "path" setup: IOhannes has done something similar in Gem for finding programs/shaders, so I'll put this on the "to-do-0.91" for gem's font-handling...
jamie
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
B. Bogart wrote:
Hi James,
This sounds really interesting, where can I get more info on what Johannes's has done?
well, don't expect too much. the main thing jamie talks about is, that Gem searches for fonts (and other things like shaders, images,...) within pd's search path. this allows you to just use "font courier.ttf" without having to remember the full path at paching time, by simply adding some system-specific search path to pd (like %WINDOWS%\Fonts\ or whereever they are)
this is clearly a good thing. however, it doesn't really help you if you want to have a list of "all fonts installed on the system" (e.g. in a popup) so that the user can select one of them.
so i think another good thing to have would a [file/find] object that searches for a given filename-pattern in pd's search path.
a combination of these 2 things would (imho) be perfect, as it would allow us to create a list of all (conveniently) available fonts (or whatever) and allow us to access them via the objects.
mfg.asdr. IOhannes
On Apr 4, 2006, at 4:03 PM, IOhannes m zmoelnig wrote:
B. Bogart wrote:
Hi James,
This sounds really interesting, where can I get more info on what Johannes's has done?
well, don't expect too much. the main thing jamie talks about is, that Gem searches for fonts (and other things like shaders, images,...) within pd's search path. this allows you to just use "font courier.ttf" without having to remember the full path at paching time, by simply adding some system-specific search path to pd (like %WINDOWS%\Fonts\ or whereever they are)
this is clearly a good thing. however, it doesn't really help you if you want to have a list of "all fonts installed on the system" (e.g. in a popup) so that the user can select one of them.
so i think another good thing to have would a [file/find] object that searches for a given filename-pattern in pd's search path.
a combination of these 2 things would (imho) be perfect, as it would allow us to create a list of all (conveniently) available fonts (or whatever) and allow us to access them via the objects.
Anyone know a way to get the FontPath from X11 besides parsing it from XF86Config-4? How about getting the font path in Mac OS X? It seems that it would be nice to have Pd just append the OS font path to the pd path on boot, if we are going to use the pd path for fonts.
AFAIK, Windows stores all installed fonts into %SystemRoot%\Fonts.
.hc
________________________________________________________________________ ____
News is what people want to keep hidden and everything else is publicity.
- Bill Moyers
On Apr 6, 2006, at 1:55 AM, Hans-Christoph Steiner wrote:
On Apr 4, 2006, at 4:03 PM, IOhannes m zmoelnig wrote:
B. Bogart wrote:
Hi James,
This sounds really interesting, where can I get more info on what Johannes's has done?
well, don't expect too much. the main thing jamie talks about is, that Gem searches for fonts (and other things like shaders, images,...) within pd's search path. this allows you to just use "font courier.ttf" without having to remember the full path at paching time, by simply adding some system-specific search path to pd (like %WINDOWS%\Fonts\ or whereever they are)
this is clearly a good thing. however, it doesn't really help you if you want to have a list of "all fonts installed on the system" (e.g. in a popup) so that the user can select one of them.
so i think another good thing to have would a [file/find] object that searches for a given filename-pattern in pd's search path.
a combination of these 2 things would (imho) be perfect, as it would allow us to create a list of all (conveniently) available fonts (or whatever) and allow us to access them via the objects.
Anyone know a way to get the FontPath from X11 besides parsing it from XF86Config-4? How about getting the font path in Mac OS X? It seems that it would be nice to have Pd just append the OS font path to the pd path on boot, if we are going to use the pd path for fonts.
AFAIK, Windows stores all installed fonts into %SystemRoot%\Fonts.
.hc
FYI: I added these paths to the script which generates the Pd- extended pdsettings files:
GNULINUX_FONTPATH="/usr/X11R6/lib/X11/fonts /usr/X11R6/lib/X11/fonts/ TTF /usr/lib/X11/fonts /usr/share/fonts/truetype" MACOSX_FONTPATH="/System/Library/Fonts /Library/Fonts /usr/X11R6/lib/ X11/fonts/TTF /System/Library/Frameworks/JavaVM.framework/Versions/ 1.3.1/Home/lib/fonts /sw/lib/X11/fonts/msttf /sw/lib/X11/fonts/intl/ TrueType /sw/lib/X11/fonts/applettf" WINDOWS_FONTPATH="%SystemRoot%/Fonts"
Future versions of Pd-extended will include these in the path if you install the pdsettings file.
.hc
________________________________________________________________________ ____
On Apr 6, 2006, at 2:28 AM, Hans-Christoph Steiner wrote:
MACOSX_FONTPATH="/System/Library/Fonts /Library/Fonts /usr/X11R6/ lib/X11/fonts/TTF /System/Library/Frameworks/JavaVM.framework/ Versions/1.3.1/Home/lib/fonts /sw/lib/X11/fonts/msttf /sw/lib/X11/ fonts/intl/TrueType /sw/lib/X11/fonts/applettf"
...how about adding "~/Library/Fonts", too?
jamie
On Apr 6, 2006, at 8:47 AM, james tittle wrote:
On Apr 6, 2006, at 2:28 AM, Hans-Christoph Steiner wrote:
MACOSX_FONTPATH="/System/Library/Fonts /Library/Fonts /usr/X11R6/ lib/X11/fonts/TTF /System/Library/Frameworks/JavaVM.framework/ Versions/1.3.1/Home/lib/fonts /sw/lib/X11/fonts/msttf /sw/lib/X11/ fonts/intl/TrueType /sw/lib/X11/fonts/applettf"
...how about adding "~/Library/Fonts", too?
I don't think that the pdsettings system knows how to interpret the "~", that's why I didn't add it.
.hc
________________________________________________________________________ ____
"The arc of history bends towards justice." - Dr. Martin Luther King, Jr.