Mega Code Archive

 
Categories / Delphi / Examples
 

Solving The Cant assign a TFont to TFont error

Title: Solving The "Can't assign a TFont to TFont" error Question: How to solve the "Can't assign a TFont to TFont" error. Answer: In this you have to edit graphics.pas found in \source\vcl. First find the code below procedure TCanvas.SetFont(Value: TFont); begin FFont.Assign(Value); end; and add a try..except statement like so procedure TCanvas.SetFont(Value: TFont); begin try FFont.Assign(Value); except on Exception do; end; end; then recompile. Remember to backup the original graphics.pas