To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10232
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 30 Apr 2005 20:16:36 GMT
Viewed: 
4916 times
  
Ross Crawford wrote:

Nuthin like a good ol' command line utility ;) though I wouldn't be
adverse to someone creating a nice graphical interface

Quick hack: http://web.telia.com/~u16122953/guitx2d.zip (Exe + Delphi 5
source, 270 kB)

working out which font file to use is a bit of a pain sometimes...

I googled for it (going from font name to font file) and could only find the
advice to enumerate all font files and read the info in them. Sounds like
loads of work :-(

I did it the other way around - point to a font file, and my GUI shows a
preview of the font.

Feel free to try it!
--
Anders Isaksson, Sweden
BlockCAD:  http://web.telia.com/~u16122508/proglego.htm
Gallery:   http://web.telia.com/~u16122508/gallery/index.htm


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 30 Apr 2005 21:59:07 GMT
Viewed: 
3976 times
  
In lugnet.cad.dev, Anders Isaksson wrote:
Ross Crawford wrote:

Nuthin like a good ol' command line utility ;) though I wouldn't be
adverse to someone creating a nice graphical interface

Quick hack: http://web.telia.com/~u16122953/guitx2d.zip (Exe + Delphi 5
source, 270 kB)

Wow! Thanks Anders, I will add a link from my page next time I update it!

working out which font file to use is a bit of a pain sometimes...

I googled for it (going from font name to font file) and could only find the
advice to enumerate all font files and read the info in them. Sounds like
loads of work :-(

I see what you mean. I never realised it would be so hard to get that
information, good ol' windoze. I think your way is the easiest workaround.

I did it the other way around - point to a font file, and my GUI shows a
preview of the font.

Feel free to try it!

Works great for me!

ROSCO


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 1 May 2005 17:31:20 GMT
Viewed: 
4110 times
  
working out which font file to use is a bit of a pain sometimes...

I googled for it (going from font name to font file) and could only find the
advice to enumerate all font files and read the info in them. Sounds like
loads of work :-(

I did it the other way around - point to a font file, and my GUI shows a
preview of the font.

I was trying to knock something up in VB, but came across the problem of
getting the file from the font. I couldn't find anything suitable in the
registry either.

--
Dean Earley, Dee (dean@earlsoft.co.uk)

irc:    irc://irc.blitzed.org/
web:    http://personal.earlsoft.co.uk
phone:  +44 (0)780 8369596


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 18:19:24 GMT
Viewed: 
4254 times
  
In lugnet.cad.dev, Dean Earley wrote:
  
  
   working out which font file to use is a bit of a pain sometimes...

I googled for it (going from font name to font file) and could only find the advice to enumerate all font files and read the info in them. Sounds like loads of work :-(

I did it the other way around - point to a font file, and my GUI shows a preview of the font.

I was trying to knock something up in VB, but came across the problem of getting the file from the font. I couldn’t find anything suitable in the registry either.

I’m not sure if this is what you’re talking about, but in both the GUItxt2d app and my cheesy tcl app I can’t get the font file directly from the file open dialog in XP. Instead, when I double click on a font, I get a large window with a preview of that font. In order to get the file name I have to right click on the font name, select properties and then cut and paste the filename from that dialog. What a pain indeed.

I noticed another possible problem with the GUItxt2d program. It looks like the WinExecAndWait function works on XP, but not on Win95. On 95 I get a small dialog box with the informative message error message “2”, and an OK button. Press Ok and then of course it complains that the tmp.tmp file doesn’t exist. Does anyone else out there still use 95? Probably not...

Have Fun,

Don


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 19:41:25 GMT
Viewed: 
4444 times
  
Don Heyse wrote:

I'm not sure if this is what you're talking about, but in both the
<http://web.telia.com/~u16122953/guitx2d.zip GUItxt2d app> and
<http://ldglite.sf.net/t2dgui.tcl my cheesy tcl app> I can't get
the font file directly from the file open dialog in XP.  Instead, when
I double click on a font, I get a large window with a preview of that
font.  In order to get the file name I have to right click on the font
name, select properties and then cut and paste the filename
from that dialog.  What a pain indeed.

?? I don't understand exactly what you're saying here. Are you trying to
copy the full file path to the Clipboard?

If so, don't try in the dialog, select a file instead and copy the full path
from the input field 'Font file' on the main screen of GUITx2d.

The problem we were discussing was the fact that there doesn't seem to exist
a nice way to get (programatically) the font file name, given a font name
(and attributes). The only solution found yet for this seems to be: Locate
all font files on the system, read all the info from them, and build a huge
table in memory (or database) and use this. Much too much work for a quick
hack :-)

I noticed another possible problem with the GUItxt2d program. It
looks like the WinExecAndWait function works on XP, but not on Win95.
On 95 I get a small dialog box with the informative message error
message "2", and an OK button.

Actually, this is the message ERROR_FILE_NOT_FOUND, so maybe, just maybe,
you hadn't configured the path to txt2dat.exe?

--
Anders Isaksson, Sweden
BlockCAD:  http://web.telia.com/~u16122508/proglego.htm
Gallery:   http://web.telia.com/~u16122508/gallery/index.htm


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 20:31:39 GMT
Viewed: 
4580 times
  
In lugnet.cad.dev, Anders Isaksson wrote:
Don Heyse wrote:

I'm not sure if this is what you're talking about, but in both the
<http://web.telia.com/~u16122953/guitx2d.zip GUItxt2d app> and
<http://ldglite.sf.net/t2dgui.tcl my cheesy tcl app> I can't get
the font file directly from the file open dialog in XP.  Instead, when
I double click on a font, I get a large window with a preview of that
font.  In order to get the file name I have to right click on the font
name, select properties and then cut and paste the filename
from that dialog.  What a pain indeed.

?? I don't understand exactly what you're saying here. Are you trying to
copy the full file path to the Clipboard?

No, I figured it out.  XP seems to come with a special Hidden System
desktop.ini file in the font directory with this in it.

  [.ShellClassInfo]
  UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}

It makes the standard Windows open file dialog behave in a way that
makes selecting the font filename difficult.  Instead of filenames
(*.ttf) you get the font names in the file open dialog and cannot
select them for opening.  But you *can* double click on them
and let windows show you it's font preview window.  Any program using
the standard windows file open dialog is going to run afoul of
this annoying behavior.

If so, don't try in the dialog, select a file instead and copy the full
path from the input field 'Font file' on the main screen of GUITx2d.

Yes, that works.  I can right click on the font name, select properties
and cut and paste the font file name into GUITx2d and things work.  It's
just not obvious when you're looking at the list of fonts in the file
open dialog.

The problem we were discussing was the fact that there doesn't seem to exist
a nice way to get (programatically) the font file name, given a font name
(and attributes). The only solution found yet for this seems to be: Locate
all font files on the system, read all the info from them, and build a huge
table in memory (or database) and use this. Much too much work for a quick
hack :-)

Yeah, it'd be nice if windows made it easy for programs to do this
instead of forcing it's bizarre shell extension on unsuspecting users.

I noticed another possible problem with the GUItxt2d program. It
looks like the WinExecAndWait function works on XP, but not on Win95.
On 95 I get a small dialog box with the informative message error
message "2", and an OK button.

Actually, this is the message ERROR_FILE_NOT_FOUND, so maybe, just maybe,
you hadn't configured the path to txt2dat.exe?

I'm pretty sure that was the first thing I thought of, so I went to
Settings tab and tried both an absolute path and a relative path.
I think both came up green, but had the problem.  I try it again when
I get a chance though.

Don


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 21:14:05 GMT
Viewed: 
4708 times
  
Don Heyse wrote:

No, I figured it out.  XP seems to come with a special Hidden System
desktop.ini file in the font directory with this in it.

[.ShellClassInfo]
UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}

It makes the standard Windows open file dialog behave in a way that
makes selecting the font filename difficult.  Instead of filenames
(*.ttf) you get the font names in the file open dialog and cannot
select them for opening.  But you *can* double click on them
and let windows show you it's font preview window.  Any program using
the standard windows file open dialog is going to run afoul of
this annoying behavior.

?? I have WinXP, SP2 and don't see this. But I have set Explorer to not hide
anything and show all extensions. I haven't done anything special to the
Fonts directory (as I remember), and it shows just like any other.

Yes, that works.  I can right click on the font name, select properties
and cut and paste the font file name into GUITx2d and things work.

I have a nice little Shell extension 'Copy path to Clipboard' that is shown
in the right-click menu. This one works both in Explorer and the Open
dialogs. Let me know if you want a copy (I wrote it myself). I also have
'Run DOS here' which is a fast way to open a console window at the right
place when you're looking at a directory.

It's just not obvious when you're looking at the list of fonts in the
file open dialog.

I can understand that!

On 95 I get a small dialog box with the informative message error
message "2", and an OK button.

Actually, this is the message ERROR_FILE_NOT_FOUND, so maybe, just
maybe, you hadn't configured the path to txt2dat.exe?

I'm pretty sure that was the first thing I thought of, so I went to
Settings tab and tried both an absolute path and a relative path.
I think both came up green, but had the problem.  I try it again when
I get a chance though.

I don't suppose you have access to Delphi and could run the program in the
debugger for me? I don't have W95 anymore.

--
Anders Isaksson, Sweden
BlockCAD:  http://web.telia.com/~u16122508/proglego.htm
Gallery:   http://web.telia.com/~u16122508/gallery/index.htm


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 23:37:15 GMT
Viewed: 
4538 times
  
The problem we were discussing was the fact that there doesn't seem to exist
a nice way to get (programatically) the font file name, given a font name
(and attributes). The only solution found yet for this seems to be: Locate
all font files on the system, read all the info from them, and build a huge
table in memory (or database) and use this. Much too much work for a quick
hack :-)

Or...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
This brought to my attention that not all the files listed are "single
font" files (look for ttc files).

Is there any reason that txt2dat can't handle font face names?

--
Dean Earley, Dee (dean@earlsoft.co.uk)

irc:    irc://irc.blitzed.org/
web:    http://personal.earlsoft.co.uk
phone:  +44 (0)780 8369596


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 4 May 2005 00:27:00 GMT
Viewed: 
4553 times
  
In lugnet.cad.dev, Dean Earley wrote:

Is there any reason that txt2dat can't handle font face names?

Well, apart from the difficulty of converting a Windows face name to a filename
as identified here, I always intended it to be relatively easy to port to other
platforms. And the most non-platform specific way I could think to do that was
to require the full path to the actual font file.

I would rather concentrate on the guts of it, and let others produce nice front
ends (like quitx2d) for their platform of choice.

BTW anyone that feels like porting to other platforms please feel free...

ROSCO


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 4 May 2005 02:01:25 GMT
Viewed: 
4665 times
  
In lugnet.cad.dev, Anders Isaksson wrote:
Don Heyse wrote:

No, I figured it out.  XP seems to come with a special Hidden System
desktop.ini file in the font directory with this in it.

[.ShellClassInfo]
UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}

It makes the standard Windows open file dialog behave in a way that
makes selecting the font filename difficult.  Instead of filenames
(*.ttf) you get the font names in the file open dialog and cannot
select them for opening.  But you *can* double click on them
and let windows show you it's font preview window.  Any program using
the standard windows file open dialog is going to run afoul of
this annoying behavior.

?? I have WinXP, SP2 and don't see this. But I have set Explorer to not hide
anything and show all extensions. I haven't done anything special to the
Fonts directory (as I remember), and it shows just like any other.

That's odd.  I always set explorer that way myself, but I have the
same desktop.ini file and the same behavior in the fonts directory
on both XP and 95.

Apparently you can modify all sorts of folder behavior with these
magic options in desktop.ini files.  Search for desktop.ini in google.
Or you can create a desktop.ini file with those two lines, put it in
your windows fonts directory, and you'll see what I mean when you use
a standard file open dialog.

On 95 I get a small dialog box with the informative message error
message "2", and an OK button.

Actually, this is the message ERROR_FILE_NOT_FOUND, so maybe, just
maybe, you hadn't configured the path to txt2dat.exe?

I'm pretty sure that was the first thing I thought of, so I went to
Settings tab and tried both an absolute path and a relative path.
I think both came up green, but had the problem.  I try it again when
I get a chance though.

I tried it again and it's just like I thought.

I don't suppose you have access to Delphi and could run the program in the
debugger for me? I don't have W95 anymore.

No, is Delphi available for free somewhere?

Don


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 5 May 2005 05:56:28 GMT
Viewed: 
4702 times
  
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Anders Isaksson wrote:
Don Heyse wrote:
?? I don't understand exactly what you're saying here. Are you trying to
copy the full file path to the Clipboard?

No, I figured it out.  XP seems to come with a special Hidden System
desktop.ini file in the font directory with this in it.

  [.ShellClassInfo]
  UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}

It makes the standard Windows open file dialog behave in a way that
makes selecting the font filename difficult.  Instead of filenames
(*.ttf) you get the font names in the file open dialog and cannot
select them for opening.  But you *can* double click on them
and let windows show you it's font preview window.  Any program using
the standard windows file open dialog is going to run afoul of
this annoying behavior.

If you make a program that accepts drag and drop, you can drag the font file
onto the program, and it will get the full path.  I don't know what's up with
Anders' system either.  Mine behaves just like yours.

Oh, and the UICLSID in the desktop.ini file is the class ID of a registered COM
object (presumably of a specific type).  So anyone who knows how can create
their own "special" folders, and then create code to make Explorer do bizarre
things when an appropriate desktop.ini file is in the folder.

--Travis


Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 5 May 2005 12:49:05 GMT
Viewed: 
5542 times
  
In lugnet.cad.dev, Travis Cobbs wrote:
In lugnet.cad.dev, Don Heyse wrote:
No, I figured it out.  XP seems to come with a special Hidden System
desktop.ini file in the font directory with this in it.

  [.ShellClassInfo]
  UICLSID={BD84B380-8CA2-1069-AB1D-08000948F534}

It makes the standard Windows open file dialog behave in a way that
makes selecting the font filename difficult.  Instead of filenames
(*.ttf) you get the font names in the file open dialog and cannot
select them for opening.  But you *can* double click on them
and let windows show you it's font preview window.  Any program using
the standard windows file open dialog is going to run afoul of
this annoying behavior.

If you make a program that accepts drag and drop, you can drag the font
file onto the program, and it will get the full path.  I don't know
what's up with Anders' system either.  Mine behaves just like yours.

Maybe it's a language thing.  I've seen hints that some of the desktop.ini
bits behave differently when you're set up for a different language.
Or perhaps the OEMs package Windows differently for other countries and
skip the desktop.ini file in the font directory.

I don't think the drag and drop workaround is any less confusing than
going to the properties sheet to grab the name.  I just can't believe
that MS would design this hack so that it breaks the normal operation
of their file open dialog.  Well, actually, I'm really not surprised...

Have Fun,

Don


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR