It's very easy to use the executeJavascript to change the font attributes
TempCode := 'document.execCommand("fontName", false, "' + FontName + '");';
Chromium1.ExecuteJavaScript(TempCode, 'about:blank');
anyone have a clue as to how I might go about retrieving the font attributes at the cursor?
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Fontsize Fontface ?
- salvadordf
- Posts: 4572
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Fontsize Fontface ?
I've never done that but I guess you can get the computed style of the selected text or its parent element.
Perhaps these answers can help you :
https://stackoverflow.com/questions/428 ... ont-family
https://stackoverflow.com/questions/744 ... ned-in-css
Once you have the font information in JavaScript you can send it to the main browser process by registering a "JavaScript extension".
See the JSExtension demo inside the JavaScript directory and read all the comments in uJSExtension.pas to know all the details.
https://www.briskbard.com/forum/viewtop ... 4084#p4084
Perhaps these answers can help you :
https://stackoverflow.com/questions/428 ... ont-family
https://stackoverflow.com/questions/744 ... ned-in-css
Once you have the font information in JavaScript you can send it to the main browser process by registering a "JavaScript extension".
See the JSExtension demo inside the JavaScript directory and read all the comments in uJSExtension.pas to know all the details.
https://www.briskbard.com/forum/viewtop ... 4084#p4084