从右往左输入已经实现,创建字体得用CreateFontIndirect函数。
如下面创建旋转字体:希望对你有所帮助
function CreateRotatedFont(Font: TFont; Angle: Integer): HFont;
var
LogFont: TLogFont;
begin
FillChar(LogFont, SizeOf(LogFont), 0);
with LogFont do begin
lfHeight := Font.Height;
lfWidth := 0;
lfEscapement := Angle * 10;
lfOrientation := 0;
if fsBold in Font.Style then lfWeight := FW_BOLD
else lfWeight := FW_NORMAL;
lfItalic := Ord(fsItalic in Font.Style);
lfUnderline := Ord(fsUnderline in Font.Style);
lfStrikeOut := Byte(fsStrikeOut in Font.Style);
{$IFDEF VER93}
lfCharSet := Byte(Font.Charset);
{$ELSE}
lfCharSet := DEFAULT_CHARSET;
{$ENDIF}
StrPCopy(lfFaceName, Font.Name);
lfQuality := DEFAULT_QUALITY;
lfOutPrecision := OUT_DEFAULT_PRECIS;
lfClipPrecision := CLIP_DEFAULT_PRECIS;
case Font.Pitch of
fpVariable: lfPitchAndFamily := VARIABLE_PITCH;
fpFixed: lfPitchAndFamily := FIXED_PITCH;
else lfPitchAndFamily := DEFAULT_PITCH;
end;
end;
Result := CreateFontIndirect(LogFont);
end;
如下面创建旋转字体:希望对你有所帮助
function CreateRotatedFont(Font: TFont; Angle: Integer): HFont;
var
LogFont: TLogFont;
begin
FillChar(LogFont, SizeOf(LogFont), 0);
with LogFont do begin
lfHeight := Font.Height;
lfWidth := 0;
lfEscapement := Angle * 10;
lfOrientation := 0;
if fsBold in Font.Style then lfWeight := FW_BOLD
else lfWeight := FW_NORMAL;
lfItalic := Ord(fsItalic in Font.Style);
lfUnderline := Ord(fsUnderline in Font.Style);
lfStrikeOut := Byte(fsStrikeOut in Font.Style);
{$IFDEF VER93}
lfCharSet := Byte(Font.Charset);
{$ELSE}
lfCharSet := DEFAULT_CHARSET;
{$ENDIF}
StrPCopy(lfFaceName, Font.Name);
lfQuality := DEFAULT_QUALITY;
lfOutPrecision := OUT_DEFAULT_PRECIS;
lfClipPrecision := CLIP_DEFAULT_PRECIS;
case Font.Pitch of
fpVariable: lfPitchAndFamily := VARIABLE_PITCH;
fpFixed: lfPitchAndFamily := FIXED_PITCH;
else lfPitchAndFamily := DEFAULT_PITCH;
end;
end;
Result := CreateFontIndirect(LogFont);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货