M micro Well-Known Member Licensed User Longtime User Dec 23, 2020 #1 Hi to all how can i set default font and font size in Htmleditor component after loading the layout? I tried with ThRuST JHtmleditor but not work. B4X: jHTMLeditor.RequestFocus(HTMLEditor1) jHTMLeditor.SetFontStyle(HTMLEditor1, "Arial", "Black", "10px", "") I always find the font "Segoe UI" and size 12px Thanks and Happy Christmas to the whole community
Hi to all how can i set default font and font size in Htmleditor component after loading the layout? I tried with ThRuST JHtmleditor but not work. B4X: jHTMLeditor.RequestFocus(HTMLEditor1) jHTMLeditor.SetFontStyle(HTMLEditor1, "Arial", "Black", "10px", "") I always find the font "Segoe UI" and size 12px Thanks and Happy Christmas to the whole community
stevel05 Expert Licensed User Longtime User Dec 23, 2020 #2 It does in fact work, but you have to set some text at the same time, otherwise there is nothing to set the style on. B4X: jHTMLeditor.SetFontStyle(HTMLEditor1,"Arial","Blue","15px","Initial Text") Upvote 0
It does in fact work, but you have to set some text at the same time, otherwise there is nothing to set the style on. B4X: jHTMLeditor.SetFontStyle(HTMLEditor1,"Arial","Blue","15px","Initial Text")
M micro Well-Known Member Licensed User Longtime User Dec 24, 2020 #3 stevel05 said: It does in fact work, but you have to set some text at the same time, otherwise there is nothing to set the style on. Click to expand... Yes you are right stevel05 I would like to change the font and size from the combobox after loading the layout Thanks Upvote 0
stevel05 said: It does in fact work, but you have to set some text at the same time, otherwise there is nothing to set the style on. Click to expand... Yes you are right stevel05 I would like to change the font and size from the combobox after loading the layout Thanks
Erel B4X founder Staff member Licensed User Longtime User Dec 24, 2020 #4 This seems to work: Code: Dim jo As JavaObject = HTMLEditor1 Dim WebView As WebView = jo.RunMethod("lookup", Array("WebView")) jo = WebView jo.RunMethodJO("getEngine", Null).RunMethod("setUserStyleSheetLocation", Array("data:,body { font: 12pt Arial; }")) Based on: https://stackoverflow.com/questions/17970225/change-default-font-of-javafx-webview Upvote 0
This seems to work: Code: Dim jo As JavaObject = HTMLEditor1 Dim WebView As WebView = jo.RunMethod("lookup", Array("WebView")) jo = WebView jo.RunMethodJO("getEngine", Null).RunMethod("setUserStyleSheetLocation", Array("data:,body { font: 12pt Arial; }")) Based on: https://stackoverflow.com/questions/17970225/change-default-font-of-javafx-webview
M micro Well-Known Member Licensed User Longtime User Dec 24, 2020 #5 Erel said: This seems to work: Code: Dim jo As JavaObject = HTMLEditor1 Dim WebView As WebView = jo.RunMethod("lookup", Array("WebView")) jo = WebView jo.RunMethodJO("getEngine", Null).RunMethod("setUserStyleSheetLocation", Array("data:,body { font: 12pt Arial; }")) Based on: https://stackoverflow.com/questions/17970225/change-default-font-of-javafx-webview Click to expand... Thanks Erel How can I reduce the leading? (space between the two lines when you press Enter) Upvote 0
Erel said: This seems to work: Code: Dim jo As JavaObject = HTMLEditor1 Dim WebView As WebView = jo.RunMethod("lookup", Array("WebView")) jo = WebView jo.RunMethodJO("getEngine", Null).RunMethod("setUserStyleSheetLocation", Array("data:,body { font: 12pt Arial; }")) Based on: https://stackoverflow.com/questions/17970225/change-default-font-of-javafx-webview Click to expand... Thanks Erel How can I reduce the leading? (space between the two lines when you press Enter)
Erel B4X founder Staff member Licensed User Longtime User Dec 24, 2020 #6 Please start a new thread for a new question. Upvote 0