: : : I want to make a character map program using delphi 6 or 7, but I can't find the component display the letter especially the unicode letter from a installed system font like Arial or Webdings
: : :
: : That's quite easy to do. For this you need a form with a button, a stringgrid and a label. The code below will fill the stringgrid with the characters #0 to #CellCount. So a 16 by 16 grid shows all first 256 characters. With the OnSelectCell() event you can get the character code into the label as shown below.
: :
: : procedure TForm1.Button1Click(Sender: TObject);
: : var
: : i: integer;
: : begin
: : with StringGrid1 do
: : for i := 0 to RowCount*ColCount-1 do // loop through maximum number of cells
: : Cells[i mod ColCount, i div ColCount] := WideChar(i);
: : // Get the character based on its index
: : end;
: :
: : procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
: : ARow: Integer; var CanSelect: Boolean);
: : begin
: : Label1.Caption := IntToStr(ARow*StringGrid1.ColCount+ACol);
: : end;
: :
: :
: Well, the code is good, but how I know the number of character a font can take, cause there are font that can have more than 5000 character since unicode character take 32 bit(65525).
:
I couldn't find any function or property which returns the number of characters in a font. I suggest that you let the user decide how many characters are shown.