Skip to content

Commit

Permalink
chore(developer): remove commented code
Browse files Browse the repository at this point in the history
From TODO item in #9948.
  • Loading branch information
mcdurdin committed Dec 6, 2023
1 parent 4c7b799 commit 4f83c9c
Showing 1 changed file with 1 addition and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,85 +135,8 @@ procedure TxmlLdmlProjectFileUI.SetDebug(const Value: Boolean);
end;

function TxmlLdmlProjectFileUI.TestKeymanWeb(FSilent: Boolean): Boolean; // I4409
(*var
FCompiledName: string;
editor: TfrmTikeEditor;
wizard: TfrmEditor;
i: TKeyboardFont;
j: TKeyboardFont;
Found: Boolean;
function IsStandardFont(const FontName: string): Boolean; // I4448
const
StandardFontNames: array[0..9] of string = (
'Arial', 'Calibri', 'Consolas', 'Courier New', 'Lucida Console', 'Lucida Sans Unicode', 'Segoe UI', 'Tahoma', 'Times New Roman', 'Verdana'
);
begin
Result := AnsiIndexText(FontName, StandardFontNames) >= 0;
end;
procedure RegisterFont(const fontname: string);
var
strm: TMemoryStream;
begin
if (fontname <> '') and not IsStandardFont(fontname) then
begin
strm := TMemoryStream.Create;
try
if TFontLoadUtil.LoadFontData(fontname, strm) and
TServerDebugAPI.Running then
TServerDebugAPI.RegisterFont(strm, fontname);
finally
strm.Free;
end;
end;
end;
begin
editor := frmKeymanDeveloper.FindEditorByFileName(ProjectFile.FileName); // I4021
if not Assigned(editor) or not (editor is TfrmKeymanWizard) then
Exit(False);
wizard := editor as TfrmKeymanWizard;
if ProjectFile.Targets * KMWKeymanTargets = [] then
Exit(False);
FCompiledName := ProjectFile.JSTargetFilename;
if FCompiledName = '' then
Exit(False);
if not TestKeyboardState(FCompiledName, FSilent) then
Exit(False);
// We register all fonts that are used by the layout,
// but just once for each reference!
for i := kfontChar to kfontTouchLayoutDesktop do
begin
Found := False;
for j := kfontChar to TKeyboardFont(Ord(i)-1) do
if Wizard.FontInfo[j].Name = Wizard.FontInfo[i].Name then
begin
Found := True;
Break;
end;
if not Found then
RegisterFont(Wizard.FontInfo[i].Name);
end;
if TServerUI.VerifyServerRunning then
begin
TServerDebugAPI.RegisterKeyboard(
FCompiledName,
ProjectFile.FileVersion,
// We only need to specify the char + osk fonts here
// as the others are referenced in the touch layout definition directly
Wizard.FontInfo[kfontChar].Name,
Wizard.FontInfo[kfontOSK].Name
);
wizard.NotifyStartedWebDebug; // I4021
end;
*)
begin
// TODO (18.0): when we have web support for ldml keyboards
Result := True;
end;

Expand Down

0 comments on commit 4f83c9c

Please sign in to comment.