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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...