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 / 10205
     
   
Subject: 
txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 15 Apr 2005 04:23:26 GMT
Highlighted: 
(details)
Viewed: 
3205 times
  

Hi all,

I’ve just uploaded the first beta version of txt2dat, a command-line program to create LDraw files from text. It has been developed using cygwin and mingw on Windows XP, and has not been fully tested in any other environments.

You can download it here. If you wanna give it a go, and let me know if you can get it to work, please feel free.

It’s VERY beta, so don’t expect miracles!

ROSCO

   
         
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 17 Apr 2005 03:19:03 GMT
Viewed: 
3414 times
  

In lugnet.cad.dev, Ross Crawford wrote:
   Hi all,

I’ve just uploaded the first beta version of txt2dat, a command-line program to create LDraw files from text. It has been developed using cygwin and mingw on Windows XP, and has not been fully tested in any other environments.

You can download it here. If you wanna give it a go, and let me know if you can get it to work, please feel free.

It’s VERY beta, so don’t expect miracles!

Okay, I admit it: at first I thought “text to LDraw? Big deal--I write all my LDraw partsfiles as text files.” But then I clicked on the link and figured it out.

Wow, this utility is a great idea! I just downloaded it and will give feedback as soon as I’ve had a chance to mess around with it.

Dave!

    
          
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 17 Apr 2005 23:51:57 GMT
Viewed: 
3501 times
  

In lugnet.cad.dev, Dave Schuler wrote:
   In lugnet.cad.dev, Ross Crawford wrote:
   Hi all,

I’ve just uploaded the first beta version of txt2dat, a command-line program to create LDraw files from text. It has been developed using cygwin and mingw on Windows XP, and has not been fully tested in any other environments.

You can download it here. If you wanna give it a go, and let me know if you can get it to work, please feel free.

It’s VERY beta, so don’t expect miracles!

Okay, I admit it: at first I thought “text to LDraw? Big deal--I write all my LDraw partsfiles as text files.” But then I clicked on the link and figured it out.

Wow, this utility is a great idea! I just downloaded it and will give feedback as soon as I’ve had a chance to mess around with it.

Thanks Dave! Any feedback is much appreciated. I’ve just uploaded a new version, so you might wanna grab that.

ROSCO

   
         
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 17 Apr 2005 23:49:55 GMT
Viewed: 
3313 times
  

In lugnet.cad.dev, Ross Crawford wrote:
   Hi all,

I’ve just uploaded the first beta version of txt2dat, a command-line program to create LDraw files from text. It has been developed using cygwin and mingw on Windows XP, and has not been fully tested in any other environments.

You can download it here. If you wanna give it a go, and let me know if you can get it to work, please feel free.

I’ve uploaded version 0.1.3, with a couple of bug fixes, and source code.

Enjoy!

ROSCO

   
         
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 18 Apr 2005 13:32:07 GMT
Viewed: 
3648 times
  

In lugnet.cad.dev, Ross Crawford wrote:
Hi all,

I've just uploaded the first beta version of txt2dat, a command-line
program to create LDraw files from text. It has been developed using
cygwin and mingw on Windows XP, and has not been fully tested in any
other environments.

You can download it
<http://www.br-eng.info/about/lego/LDraw/txt2dat/index.htm here>.
If you wanna give it a go, and let me know if you can get it to work,
please feel free.

Wow, that's cool!  LDRAW stuff sent to stdout.  I finally get to
try ldglite with a pipe from a real program, and it all seems to
work.

  txt2dat -s hello -c 4 -p 72 c:\windows\fonts\ariel.ttf | ldglite -i1
-MFhello.png --

Thanks.  That was fun,

Don

    
          
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 29 Apr 2005 02:18:57 GMT
Viewed: 
4867 times
  

In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Ross Crawford wrote:
Hi all,

I've just uploaded the first beta version of txt2dat, a command-line
program to create LDraw files from text. It has been developed using
cygwin and mingw on Windows XP, and has not been fully tested in any
other environments.

You can download it
<http://www.br-eng.info/about/lego/LDraw/txt2dat/index.htm here>.
If you wanna give it a go, and let me know if you can get it to work,
please feel free.

Wow, that's cool!  LDRAW stuff sent to stdout.  I finally get to
try ldglite with a pipe from a real program, and it all seems to
work.

  txt2dat -s hello -c 4 -p 72 c:\windows\fonts\ariel.ttf | ldglite -i1
-MFhello.png --

Thanks.  That was fun,

Nuthin like a good ol' command line utility ;) though I wouldn't be adverse to
someone creating a nice graphical interface - working out which font file to use
is a bit of a pain sometimes...

ROSCO

    
          
      
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 29 Apr 2005 12:55:04 GMT
Viewed: 
3962 times
  

In lugnet.cad.dev, Ross Crawford wrote:
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Ross Crawford wrote:
Hi all,

I've just uploaded the first beta version of txt2dat, a command-line
program to create LDraw files from text. It has been developed using
cygwin and mingw on Windows XP, and has not been fully tested in any
other environments.

You can download it
<http://www.br-eng.info/about/lego/LDraw/txt2dat/index.htm here>.
If you wanna give it a go, and let me know if you can get it to work,
please feel free.

Wow, that's cool!  LDRAW stuff sent to stdout.  I finally get to
try ldglite with a pipe from a real program, and it all seems to
work.

  txt2dat -s hello -c 4 -p 72 c:\windows\fonts\ariel.ttf | ldglite -i1
-MFhello.png --

Thanks.  That was fun,

Nuthin like a good ol' command line utility ;) though I wouldn't be
adverse to someone creating a nice graphical interface - working out
which font file to use is a bit of a pain sometimes...

Yeah, I was gonna suggest you convert the "font" from the ldraw
lettered tiles into a cheesy builtin internal font, which would be
used by default.  Then add a -f before the font if you can find a
better one somewhere.  That way you could make something without
searching around for fonts.

But for a really cheesy GUI you could probably write a 10 line tcl
script that opens a file browser and lets you select a font file
then run something like the command line above, except skip the
-MFhello.png and let ldglite open a small window with the txt2dat
output in it.

  txt2dat -s AbCdEfG -c4 -p72 ariel.ttf | ldglite -v0 -- >NULL

Now where did I put that little tcl script for lpub...

Have funk,

Don

     
           
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 29 Apr 2005 14:57:03 GMT
Viewed: 
4199 times
  

In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Ross Crawford wrote:
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Ross Crawford wrote:
Hi all,


<snip>


But for a really cheesy GUI you could probably write a 10 line tcl
script that opens a file browser and lets you select a font file
then run something like the command line above, except skip the
-MFhello.png and let ldglite open a small window with the txt2dat
output in it.

  txt2dat -s AbCdEfG -c4 -p72 ariel.ttf | ldglite -v0 -- >NULL

Now where did I put that little tcl script for lpub...

ahhh..... ummm.... LSynth?

LPub has its own built in cheezy little GUI!


Have funk,

Don

K

      
            
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 29 Apr 2005 15:48:01 GMT
Viewed: 
4570 times
  

In lugnet.cad.dev, Kevin L. Clague wrote:
In lugnet.cad.dev, Don Heyse wrote:
But for a really cheesy GUI you could probably write a 10 line tcl
script that opens a file browser and lets you select a font file
then run something like the command line above, except skip the
-MFhello.png and let ldglite open a small window with the txt2dat
output in it.

  txt2dat -s AbCdEfG -c4 -p72 ariel.ttf | ldglite -v0 -- >NULL

Now where did I put that little tcl script for lpub...

ahhh..... ummm.... LSynth?

LPub has its own built in cheezy little GUI!

Err... yeah, lsynth.  That's why I couldn't find it.  So now
that I found it it looks a bit more than 10 lines.  Oops.

Anyhow, substitute txt2dat for lsynth, make a few little
additions and ya get a cheesy GUI for txt2dat that sorta works.

Enjoy,

Don


#!/bin/sh
#-*-tcl-*-
# the next line restarts using wish \
exec wish "$0" -- ${1+"$@"}

#
# Tk GUI for txt2dat
#

# wm withdraw .
wm title . "txt2dat - Create LDraw files from text"

set rootdir $env(SystemRoot)
set fontdir $rootdir/fonts
set stickertext " "
set fontfile ""
set outfile ""
set color "\-c 4"
set pointsize "\-p 72"

set types {
    {{Font Files}       {.ttf}        }
    {{All Files}        *             }
}


proc BrowseIF {} {
    global fontfile fontdir types
    set fontfile [tk_getOpenFile -initialdir $fontdir -filetypes $types
-defaultextension ttf -initialfile arial.ttf]
    if {$fontfile != ""} {
set fontdir $fontfile
    }
}

proc BrowseOF {} {
    global outfile fontdir
    set outfile [tk_getSaveFile -initialdir $outfile]
}

proc Synthesize {} {
    global stickertext fontfile fontdir outfile color pointsize log
    if {$outfile != ""} {
      if [catch {set n [exec txt2dat "\-s" $stickertext $fontfile > $outfile]}
input] {
        $log insert end $input\n
      } else {
        $log insert end OK $n\n
      }
    } else {
      if [catch {set n [exec txt2dat "\-s" $stickertext $fontfile]} input] {
        $log insert end $input\n
      } else {
        $log insert end OK $n\n
      }
    }
}

frame .f -borderwidth 10
pack .f -side top

frame .f.row6
pack .f.row6 -side top -anchor w
label .f.row6.li -text "Sticker Text"
pack .f.row6.li -side left

frame .f.row7
pack .f.row7 -side top -fill y
entry .f.row7.inf -width 60 -relief sunken -textvariable stickertext
pack .f.row7.inf -side left

frame .f.row0
pack .f.row0 -side top -anchor w
label .f.row0.li -text "Font File"
pack .f.row0.li -side left

frame .f.row1
pack .f.row1 -side top -fill y
entry .f.row1.inf -width 60 -relief sunken -textvariable fontfile
button .f.row1.browseFontFile -text "Browse" -command {BrowseIF}
pack .f.row1.inf .f.row1.browseFontFile -side left

frame .f.row2
pack .f.row2 -side top -anchor w
label .f.row2.lo -text "Output File"
pack .f.row2.lo -side left

frame .f.row3
pack .f.row3 -side top -fill y
entry .f.row3.of -width 60 -relief sunken -textvariable outfile
button .f.row3.browseOutFile -text "Browse" -command {BrowseOF}
pack .f.row3.of .f.row3.browseOutFile -side left

frame .f.row4 -borderwidth 10
pack .f.row4 -side top -fill y
button .f.row4.synthesize -text "Process" -command {Synthesize}
pack .f.row4.synthesize -side top

frame .f.row5
pack .f.row5 -side top -fill y
set log [text .f.row5.log -width 80 -height 20 \
    -borderwidth 2 -relief raised -setgrid true \
    -yscrollcommand {.f.row5.scroll set}]
scrollbar .f.row5.scroll -command {.f.row5.log yview}
pack .f.row5.scroll -side right -fill both -expand true
pack .f.row5.log -side top -fill both -expand true

$log insert end "Welcome to txt2dat, a text sticker generator for LDRAW."
$log insert end \n
$log insert end \n

     
           
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 29 Apr 2005 23:14:15 GMT
Viewed: 
4033 times
  

In lugnet.cad.dev, Don Heyse wrote:

Yeah, I was gonna suggest you convert the "font" from the ldraw
lettered tiles into a cheesy builtin internal font, which would be
used by default.  Then add a -f before the font if you can find a
better one somewhere.  That way you could make something without
searching around for fonts.

All we need to generate the cheesy LEGO font file is an output-truetype module
for autotrace, and a ready supply of lettered tiles ;)

ROSCO

      
            
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 30 Apr 2005 02:34:04 GMT
Viewed: 
4054 times
  

In lugnet.cad.dev, Ross Crawford wrote:
In lugnet.cad.dev, Don Heyse wrote:

Yeah, I was gonna suggest you convert the "font" from the ldraw
lettered tiles into a cheesy builtin internal font, which would be
used by default.  Then add a -f before the font if you can find a
better one somewhere.  That way you could make something without
searching around for fonts.

All we need to generate the cheesy LEGO font file is an output-truetype
module for autotrace,

That's not too hard to find.

  http://www.xs4all.nl/~hanwen/mftrace/

Looks like a wrapper for autotrace and some other stuff.

and a ready supply of lettered tiles ;)

Yeah, you got me there.  I think I've got a couple a numbers from
the harry potter house sets, and that's about it.

Yer more likely to get the whole alphabet by assmembling it in MLCad
from the ldraw tiles.  Then you can always dump a large bitmap to feed
to mftrace.  Just pretend you scanned in the real tiles...

Don

      
            
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 30 Apr 2005 07:58:57 GMT
Viewed: 
4059 times
  

In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Ross Crawford wrote:
In lugnet.cad.dev, Don Heyse wrote:

Yeah, I was gonna suggest you convert the "font" from the ldraw
lettered tiles into a cheesy builtin internal font, which would be
used by default.  Then add a -f before the font if you can find a
better one somewhere.  That way you could make something without
searching around for fonts.

All we need to generate the cheesy LEGO font file is an output-truetype
module for autotrace,

That's not too hard to find.

  http://www.xs4all.nl/~hanwen/mftrace/

Looks like a wrapper for autotrace and some other stuff.

and a ready supply of lettered tiles ;)

Yeah, you got me there.  I think I've got a couple a numbers from
the harry potter house sets, and that's about it.

Yer more likely to get the whole alphabet by assmembling it in MLCad
from the ldraw tiles.  Then you can always dump a large bitmap to feed
to mftrace.  Just pretend you scanned in the real tiles...

Actually, looking at the brick 1x1s with letters in LDraw, it should be possible
to generate glyphs straight from the DAT files. Then it's just a matter of
packaging them up nicely in a font file, saves having to convert it to a bitmap
& back.

Notice I said "possible" not "easy"...

ROSCO

     
           
      
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 9 May 2005 04:24:16 GMT
Viewed: 
3821 times
  

In lugnet.cad.dev, Don Heyse wrote:

Yeah, I was gonna suggest you convert the "font" from the ldraw
lettered tiles into a cheesy builtin internal font, which would be
used by default.  Then add a -f before the font if you can find a
better one somewhere.  That way you could make something without
searching around for fonts.

Your wish is my command... well almost.

http://www.br-eng.info/words/?p=7

ROSCO

     
           
      
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 9 May 2005 14:25:05 GMT
Viewed: 
4022 times
  

In lugnet.cad.dev, Ross Crawford wrote:
   In lugnet.cad.dev, Don Heyse wrote:
  
Yeah, I was gonna suggest you convert the “font” from the ldraw lettered tiles into a cheesy builtin internal font, which would be used by default. Then add a -f before the font if you can find a better one somewhere. That way you could make something without searching around for fonts.

Your wish is my command... well almost.

http://www.br-eng.info/words/?p=7

Very nice! That font looks better than I remember. How’d you coerce it into TrueType format?

Always one to push my luck, I do have two little quibbles. I liked the way version 1.4 printed the usage info when running txt2dat with no args. Now it prints a weird error message.

Also, the internal default font does not seem to contain the space character, despite what it says on the website and in the readme.txt file. Instead I get this.

Warning: No font specified - Using internal default.

Warning: Char 32 has no glyph in font - ignoring...

Maybe I’m using the wrong character for space?

Oh, and by the way, I managed to build 1.4 on Redhat 9. Here’s a snapshot of it running in the cheesy tcl gui. You’ll have to pretend not to see the XP Window decorations. The redhat box was headless, so I displayed it via the Cygwin X server. The only trouble I had building (other than figuring out where to put Triangle and Freetype) was with $MATH. It gets defined to -lm but it’s never used by the linker. I had to add it by hand to the linker options.

Have fun,

Don

     
           
       
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 9 May 2005 23:04:49 GMT
Viewed: 
4003 times
  

In lugnet.cad.dev, Don Heyse wrote:
   In lugnet.cad.dev, Ross Crawford wrote:
   In lugnet.cad.dev, Don Heyse wrote:
  
Yeah, I was gonna suggest you convert the “font” from the ldraw lettered tiles into a cheesy builtin internal font, which would be used by default. Then add a -f before the font if you can find a better one somewhere. That way you could make something without searching around for fonts.

Your wish is my command... well almost.

http://www.br-eng.info/words/?p=7

Very nice! That font looks better than I remember. How’d you coerce it into TrueType format?

Well I worked out the scale factor, and imported the DATs into an Access db (some had to have some stuff inlined first) then manually went through the polygons working out all the verteces and entered them directly using Font Creator.

   Always one to push my luck, I do have two little quibbles. I liked the way version 1.4 printed the usage info when running txt2dat with no args. Now it prints a weird error message.

Ahhhhh. That’s because before it knew there was an error if no font was specified. Now it just assumes the internal font, then complains because you didn’t enter any characters to convert. I’ll fix that.

   Also, the internal default font does not seem to contain the space character, despite what it says on the website and in the readme.txt file. Instead I get this.

Warning: No font specified - Using internal default.

Warning: Char 32 has no glyph in font - ignoring...

Maybe I’m using the wrong character for space?

Uh oh. That second bug that I “fixed” in this version, I didn’t test with space. The space char (which has no associated glyph) has to still be mapped as a valid char by freetype - I will try to figure out how to fix it.

   Oh, and by the way, I managed to build 1.4 on Redhat 9. Here’s a snapshot of it running in the cheesy tcl gui. You’ll have to pretend not to see the XP Window decorations. The redhat box was headless, so I displayed it via the Cygwin X server. The only trouble I had building (other than figuring out where to put Triangle and Freetype) was with $MATH. It gets defined to -lm but it’s never used by the linker. I had to add it by hand to the linker options.

The Makefile was basically butchered from the Freetype demos, because of the weird way Freetype does it’s platform independence. I will add $MATH to the link options.

ROSCO

     
           
      
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 10 May 2005 02:02:30 GMT
Viewed: 
4410 times
  

In lugnet.cad.dev, Don Heyse wrote:
   In lugnet.cad.dev, Ross Crawford wrote:
   In lugnet.cad.dev, Don Heyse wrote:
  
Yeah, I was gonna suggest you convert the “font” from the ldraw lettered tiles into a cheesy builtin internal font, which would be used by default. Then add a -f before the font if you can find a better one somewhere. That way you could make something without searching around for fonts.

Your wish is my command... well almost.

http://www.br-eng.info/words/?p=7

OK I think I’ve fixed all THOSE bugs, now just time to find some more...

You can find it here.

ROSCO

PS: Does anyone want the brick.ttf font? It’s not really very useful because of the limited characters, but if anyone wants it, I’ll make a separate download page for it.

    
          
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 30 Apr 2005 20:16:36 GMT
Viewed: 
4914 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: 
3973 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: 
4107 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: 
4252 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: 
4441 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: 
4578 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: 
4705 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: 
Wed, 4 May 2005 02:01:25 GMT
Viewed: 
4662 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: 
4699 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: 
5540 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

    
          
     
Subject: 
Re: txt2dat - Create LDraw files from text
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 3 May 2005 23:37:15 GMT
Viewed: 
4536 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: 
4551 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: 
Fri, 29 Apr 2005 02:16:49 GMT
Viewed: 
3151 times
  

In lugnet.cad.dev, Ross Crawford wrote:
   Hi all,

I’ve just uploaded the first beta version of txt2dat, a command-line program to create LDraw files from text. It has been developed using cygwin and mingw on Windows XP, and has not been fully tested in any other environments.

You can download it here. If you wanna give it a go, and let me know if you can get it to work, please feel free.

Version 0.1.4 now available at the same page. Changes in v0.1.4 are:
  1. Use “LDraw inverse colour” for lines.
  2. Fixed non-ansi definition of add_char() and add_string().
  3. Implemented better algorithm for choosing the number of segments in splines.
  4. Added -r option for spline resolution.
  5. Some minor efficiency enhancements.
  6. Updated FSF address.
Enjoy!

ROSCO

 

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