delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/13/17:16:16

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: TTF2PCX
Date: Thu, 13 Mar 1997 19:27:51 +0000
Organization: None
Distribution: world
Message-ID: <IraxNBA3UFKzEw3C@talula.demon.co.uk>
References: <19970312 DOT 171952 DOT 7519 DOT 29 DOT fwec AT juno DOT com>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 47
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mark T Logan writes:
>I just downloaded ttf2pcx, so I could convert true type fonts to
>pcx files suitable for allegro.  Much to my dismay, I found that
>it is a win 95 program.  I don't have win 95 :-(
>
>What is involved in porting the program to dos using DJGPP?  

That would be a _lot_ of work. The utility doesn't know anything about
the TTF format: it just uses Windows GDI functions to draw a bunch of
characters onto a memory device and then grab a copy of the resulting
bitmap into a PCX file. Without access to Windows routines like
"CreateFont" and "TextOut", you'd have to do all the TrueType rendering
yourself, which is an extremely complex task. If you really want to try
it, I have a vague recollection that povray contains some code for
reading TTF files, which would be worth investigating...

>I'm hoping that most of the implementation code was kept 
>seperate from the windows code.  I looked at the code but I 

There's really very little code of any sort in it: it only took me about
two hours to write. And I'm sorry, but it is all very ugly and mixed up
(I hate writing Windows programs, so my prime objective was to get it
working and go on to something else as quickly as possible :-)

Most of it is just UI code for selecting the font and output file. The
interesting bits are the save_pcx(), SaveChars(), and OnExport()
functions in ttf2pcxdlg.cpp, and the CCharacter class (in character.h
and character.cpp).

>One more question.  Does win 95 use essentially the same API
>as win 3.1?  If it does, it may be easier for me to port the program
>to win 3.1 using TC++ 3.? for windows.  (This is my schools compiler,

The API is very similar, and I don't think I used any of the features
that are specfic to Win95. The trouble with using a Borland compiler
would be the absence of the MFC class libraries, which I used quite
heavily. It would probably be very easy to recompile it with a 16 bit
version of Visual C++, but rather more work to port to Borland.
Unfortunately I don't have access to any 16 bit Windows compilers, so I
can't help you with this myself, but I'd be happy to answer whatever
questions you have if you feel like attempting it yourself...


/*
 *  Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
 *  Beauty is a French phonetic corruption of a short cloth neck ornament.
 */

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019