| |

VerySource

 Forgot password?
 Register
Search
View: 724|Reply: 1

Problem with rotated fonts

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-9 08:30:02
| Show all posts |Read mode
var
LogFont: TLogFont; // I'm not familiar with this class? ?
theFont: TFont;
begin
with Form1.Canvas do
begin
Font.Name: = 'Songti';
Font.Size: = 18;
Font.Color: = clYellow;
theFont: = TFont.Create;
theFont.Assign (Font);
GetObject (theFont.Handle, Sizeof (LogFont), @LogFont); // gettobject is not
LogFont.lfEscapement: = 450; // 45 degrees ?? // load file object?
LogFont.lfOrientation: = 450; // 45 degrees ??
theFont.Handle: = CreateFontIndirect (LogFont); // ???
Font.Assign (theFont);
theFont.Free;
TextOut (X, Y, 'Hello!');
end;
end;
This piece of code can achieve font rotation in many places I don't understand
Please guide
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-7 09:00:01
| Show all posts
TLogFont = LOGFONT structure in WIN32 SDK

See the explanation in the SDK for yourself
typedef struct tagLOGFONT {// lf
   LONG lfHeight;
   LONG lfWidth;
   LONG lfEscapement;
   LONG lfOrientation;
   LONG lfWeight;
   BYTE lfItalic;
   BYTE lfUnderline;
   BYTE lfStrikeOut;
   BYTE lfCharSet;
   BYTE lfOutPrecision;
   BYTE lfClipPrecision;
   BYTE lfQuality;
   BYTE lfPitchAndFamily;
   TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT;

Fonts are graphical objects in Windows, where GetObject is the LOGFONT structure used to return system fonts


lfEscapement
lfOrientation
The explanation is already in the SDK
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list