Topic: Adding fonts
Hi everyone,
Can any one tell how we can add fonts of other language like Arabic, Persian or Urdu in MVD? Is it possible?
My Visual Database → General → Adding fonts
Hi everyone,
Can any one tell how we can add fonts of other language like Arabic, Persian or Urdu in MVD? Is it possible?
Hello unforgettable
A proven MVD script:
procedure Form1_OnShow (Sender: string; Action: string);
begin
Form1.GridEmployees.Font := LoadFont;
end;
procedure Form1_Button5_OnClick (Sender: string; var Cancel: boolean);
var FontDialog: TFontDialog;
begin
FontDialog := TFontDialog.Create(Form1);
FontDialog.Font := Form1.GridEmployees.Font;
if FontDialog.Execute then
begin
Form1.GridEmployees.Font:= FontDialog.Font;
Form1.GridEmployees.dbUpdate;
SaveFont(Form1.GridEmployees.Font);
end;
end;
procedure SaveFont(Font: TFont);
var reg: TRegistry;
begin
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('software\YourProjectName', true) then
begin
Reg.WriteString('Font.Name', Font.Name);
Reg.WriteInteger('Font.Size', Font.Size);
Reg.WriteBool('Font.Style.fsBold', fsBold in [Font.Style]);
Reg.WriteBool('Font.Style.fsItalic', fsItalic in [Font.Style]);
Reg.WriteBool('Font.Style.fsUnderline', fsUnderline in [Font.Style]);
Reg.WriteBool('Font.Style.fsStrikeOut', fsStrikeOut in [Font.Style]);
reg.CloseKey;
end;
reg.Free;
end;
function LoadFont: TFont;
var reg: TRegistry;
begin
result := TFont.Create;
reg := TRegistry.Create;
reg.Access := KEY_ALL_ACCESS;
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('software\YourProjectName', true) then
begin
if reg.ValueExists('Font.Name') then result.Name := Reg.ReadString('Font.Name');
if reg.ValueExists('Font.Size') then result.Size := Reg.ReadInteger('Font.Size');
if reg.ValueExists('Font.Style.fsBold') then
if Reg.ReadBool('Font.Style.fsBold') then result.Style := result.Style + fsBold;
if reg.ValueExists('Font.Style.fsItalic') then
if Reg.ReadBool('Font.Style.fsItalic') then result.Style := result.Style + fsItalic;
if reg.ValueExists('Font.Style.fsUnderline') then
if Reg.ReadBool('Font.Style.fsUnderline') then result.Style := result.Style + fsUnderline;
if reg.ValueExists('Font.Style.fsStrikeOut') then
if Reg.ReadBool('Font.Style.fsStrikeOut') then result.Style := result.Style + fsStrikeOut;
reg.CloseKey;
end;
reg.Free;
end;
JB
which procedure I adopt? and which is the best?
My Visual Database → General → Adding fonts
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi