Re: Rotated text




On Nov 18, 4:30 pm, "Tom de Neef" <tden...@xxxxxxxx> wrote:
Currently I use the procedure below to output text at an angle on a canvas.
Several source on the internet approach it in this way. But I must say: the
quality of the result is pretty poor. Are there better ways to do this ?
Thank you,
Tom

procedure AngleTextOut(ACanvas: TCanvas; Angle, X, Y: Integer; Str: string);
var
  LogRec: TLogFont;
  OldFontHandle,NewFontHandle: hFont;
begin
  GetObject(ACanvas.Font.Handle, SizeOf(LogRec), Addr(LogRec));
  LogRec.lfEscapement := Angle*10;
  NewFontHandle := CreateFontIndirect(LogRec);
  OldFontHandle := SelectObject(ACanvas.Handle, NewFontHandle);
  ACanvas.TextOut(X, Y, Str);
  NewFontHandle := SelectObject(ACanvas.Handle, OldFontHandle);
  DeleteObject(NewFontHandle);
end;

In what way is the "quality poor" ?

I use a similar code with good quality faces but the origin of narrow
characters seems misplaced. I start with an existing font in AFont, and
a canvas ACanvas.

var
LogFont : TLogFont;

FontAngleD := FontAngleR * DegPerRad; // in deg
{make a font of this angle}
with LogFont do begin
FillChar(LogFont, sizeof(TLogFont), 0); {clear memory}
lfHeight := AFont.Height;
lfEscapement := trunc(FontAngleD * 10);
lfOrientation := lfEscapement; // should be same
lfWeight := FW_BOLD;
lfOutPrecision := OUT_TT_PRECIS;
lfFaceName := 'Arial';
ACanvas.Font.Handle := CreateFontIndirect(LogFont);
end; {with LogFont}

Alan Lloyd

.



Relevant Pages

  • Re: Rotated text
    ... quality of the result is pretty poor. ... a canvas ACanvas. ... LogFont: TLogFont; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Never seen anything like this from Federer
    ... When you consider the quality of his opponent too, ... He's very much a poor ... A kind of huge Federer anti-bias in a package of Sampras over-praise. ...
    (rec.sport.tennis)
  • Re: OT: Merc ML series quality
    ... external evidence of the supposedly poor build quality. ... Had I seen such things on just one car, ... Fact is, the ML is not really a Merc, it's built for them in the States ... Anyway the poor build quality caused a big ruckus between ...
    (uk.rec.cars.maintenance)
  • Re: i get it now
    ... >the experience i lack is knowledge of quality equipment, ... LIke you I'm also a poor man, ... record your guitar with your ... then either consult the notes or call the engineer ...
    (rec.audio.pro)
  • Re: Bad quality in Live and Recorded TV...
    ... very poor SD PQ is the upscaling of the less than .4 mega pixels per frame ... NVIDIA 7300 GS video cards. ... So if you are seeing quality less than off-the-air analog SD, ... NVIDIA is supposed to be bringing out a new PureVideo dual tuner card ...
    (microsoft.public.windows.mediacenter)