From: "Wayne Sherman" Newsgroups: borland.public.delphi.graphics References: <3AF930FD.D44C78B8@NOSPAM.ibpc.fr> Subject: Re: Vectorial fonts ? Date: Wed, 9 May 2001 23:34:07 -0700 Lines: 81 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 63.25.196.166 Message-ID: <3afa3662$1_1@dnews> X-Trace: dnews 989476450 63.25.196.166 (9 May 2001 23:34:10 -0700) Path: dnews Xref: dnews borland.public.delphi.graphics:38754 > Does anyone have code to display, manipulate and perhaps > generate vectorial fonts (stroke or "wire" fonts, not > truetype) How about using any Truetype font as a vector path? HOWTO: How to Use Paths to Create Text Effects http://support.microsoft.com/support/kb/articles/Q128/0/91.asp Here is some code I downloaded from somewhere (I can't find a name to give proper credit) that demonstrates using Path commands: procedure TForm1.btnConvertClick(Sender: TObject); procedure ClearBitmap; begin with imgPreview.Picture.Bitmap do begin Canvas.Brush.Style := bsSolid; Canvas.Brush.Color := clWhite; Canvas.FillRect(Rect(0,0,Width,Height)); end; end; procedure Convert; var Canvas : TCanvas; DC : hDC; aPoints : Array of TPoint; // dynamic array of TPoint structures aTypes : Array of Byte; // dynamic array of bytes iNumPoints : integer; // number of points in path rOut : TRect; // clipping rectangle for DrawText() begin // get handle to target canvas Canvas := imgPreview.Picture.Bitmap.Canvas; // draw text transparently Canvas.Brush.Style := bsClear; // assign Font Canvas.Font := Label2.Font; // build Clipping rectangle rOut := Rect(0,0,imgPreview.Width,imgPreview.height); // Get DC DC := Canvas.Handle; // Start path BeginPath(DC); // draw text DrawText(DC, pchar(edText.Text), length(edText.Text), rOut, DT_LEFT or DT_WORDBREAK); // end path EndPath(DC); // retrieve number of points in path iNumPoints := GetPath(DC,aPoints,aTypes,0); // resize arrays appropriately SetLength(aPoints,iNumPoints); SetLength(aTypes,iNumPoints); // retrieve path data (vectors) iNumPoints := GetPath(DC,aPoints[0],aTypes[0],iNumPoints); // draw the path. You could scale, etc this or store it. PolyDraw(DC,aPoints[0],aTypes[0],iNumPoints); end; // procedure Convert begin // resize bitmap for output display imgPreview.Picture.Bitmap.Width := imgPreview.Width; imgPreview.Picture.Bitmap.Height := imgPreview.Height; ClearBitmap; Convert; end; If you want, I can send you the whole project, it is a simple project just to demonstrate the technique. Regards, Wayne