Search results for 'True Type Font Detection'. 1 post(s) found.
Given a font's name (such as Arial,Verdana, Times New Roman, etc), function returns a boolean value indicating whether the font is or isn't a True Type font.
function IsTrueTypeFont(FontName : string):boolean;
const
PITCH_MASK: byte = $0F;
var
TxMet: TTextMetric;
TempCanvas : TCanvas;
PitchTest : byte;
begin
TempCanvas:=TCanvas.Create;
TempCanvas.Handle:=CreateCompatibleDC(0) ;
TempCanvas.Font.Name:=FontName;
GetTextMetrics(TempCanvas.Handle, TxMet) ;
PitchTest:=TxMet.tmPitchAndFamily and PITCH_MASK;
Result:=(PitchTest and TMPF_TRUETYPE) <> 0;
TempCanvas.free;
end;
const
PITCH_MASK: byte = $0F;
var
TxMet: TTextMetric;
TempCanvas : TCanvas;
PitchTest : byte;
begin
TempCanvas:=TCanvas.Create;
TempCanvas.Handle:=CreateCompatibleDC(0) ;
TempCanvas.Font.Name:=FontName;
GetTextMetrics(TempCanvas.Handle, TxMet) ;
PitchTest:=TxMet.tmPitchAndFamily and PITCH_MASK;
Result:=(PitchTest and TMPF_TRUETYPE) <> 0;
TempCanvas.free;
end;
Another posts included in "Delphi"
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
| How to send char as message to another application (0) | 2007/09/25 |
| How to track a user's idle time (0) | 2007/09/25 |
| How to remove your application from TaskBar (0) | 2007/09/25 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
| How to install an INF file using Delphi ? (0) | 2007/09/20 |
| How to determine the output of a console application ? (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:44
moneyideas
-
Subject different money making ideas
2010/01/29 09:01
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas

Prev

Rss Feed