Jump to content

default font(size) for TUniDBHTMLMemo


kkelchev

Recommended Posts

On 8/29/2020 at 9:15 PM, kkelchev said:

How to change default font size for TUniDBHTMLMemo

Hi,

Something like this, try:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniHTMLMemo1 do
    JSInterface.JSAddListener('initialize', 'function(editor){'+
                              '  const bodyArea = editor.getEditorBody();'+
                              '  bodyArea.style["font-size"] = "20px";'+
                              '}'
    );
end;

 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
On 9/2/2020 at 11:38 AM, Sherzod said:

Hi,

Something like this, try:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniHTMLMemo1 do
    JSInterface.JSAddListener('initialize', 'function(editor){'+
                              '  const bodyArea = editor.getEditorBody();'+
                              '  bodyArea.style["font-size"] = "20px";'+
                              '}'
    );
end;

 

How to setting initial font-color with theme aria?
setting with white is no effect.

  var oHtmlMemo:= AControl;
  oHtmlMemo.JSInterface.JsAddListener(
  'initialize', 'function(editor){'+
  '  const bodyArea = editor.getEditorBody();'+
  '  bodyArea.style["font-size"] = "'+IntToStr(FormLinkOptions.FontSize+6)+'px";'+
  '  bodyArea.style["fontFamily"] = "'+FormLinkOptions.FontName+'";'+
  '  bodyArea.style["font-color"] = "white";'+
  '}');
image.png.690cf32baeac6e83400850b8a5224a99.png

Link to comment
Share on other sites

2 hours ago, newsanti said:

How to setting initial font-color with theme aria?
setting with white is no effect.

  with UniHTMLMemo1 do
    JSInterface.JSAddListener('initialize', 'function(editor){'+
                              '  const bodyArea = editor.getEditorBody();'+
                              '  bodyArea.style["font-size"] = "20px";'+
                              '  doc = Ext.get(editor.getEditorBody());'+
                              '  doc.setStyle("color", "white");'+
                              '}'
    );

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...