Using more than one font in a grid

Hi


I have set default drawing to true and have manually taken over the drawing of some columns in my grid.  I am attempting to set some columns to Webdings and leave the rest as either Segoe UI, or if they are the fixed rows and columns to Segoe UI Light. Swapping Segoe UI to Segoe UI Light works OK, but swapping to Webdings fails for some reason. Am I missing something here or is what I'm trying to do not possible?

Bruce.

procedure TfmTabView.GridGetCellColor(Sender: TObject; ARow, ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
  if (ARow<4) or (ACol<6) then
    AFont.Name:='Segoe UI Light'
  else
  begin
    case ACol of
      29..31: AFont.Name:='Webdings';
      else AFont.Name:='Segoe UI';
    end;
  end;
end;

I have retested this and cannot reproduce a problem.


Test setup: default TAdvStringGrid and TLabel on the form with the code:

procedure TForm4.AdvStringGrid1GetCellColor(Sender: TObject; ARow,
  ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
  if (acol = 2) and (arow = 2) then
    AFont.Name := 'WebDings'
  else
    AFont.Name := 'Segoe UI';
end;

procedure TForm4.FormCreate(Sender: TObject);
begin
  advstringgrid1.LinearFill;
  advstringgrid1.Cells[2,2] := 'test';

  label1.Font.Name := 'WebDings';
  label1.Caption:= 'test';
end;

and the text on the label as well as the text in cell 2,2 look exactly the same with WebDings font used.

Bruno


Thanks for the demo.

It works fine here too. 

The grid I'm having problems with is from an old application that I wrote in Delphi 6 or 7, and although I replaced the old grid with a new one I just wonder if there's something not in 'synch' somehow.

Bruce.


Bruno

Found my problem.

I went into text view of the form and compared it to a new grid and found the problem. The Font Charset property had somehow become set to ANSI_CHARSET rather than DEFAULT_CHARSET.

Bruce.