Added default compose font

This commit is contained in:
M66B
2020-07-24 10:15:13 +02:00
parent ce641d5cec
commit ac97b50b4a
5 changed files with 65 additions and 3 deletions

View File

@@ -547,6 +547,8 @@ public class MessageHelper {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean autolist = prefs.getBoolean("autolist", true);
boolean format_flowed = prefs.getBoolean("format_flowed", false);
boolean monospaced = prefs.getBoolean("monospaced", false);
String compose_font = prefs.getString("compose_font", monospaced ? "monospace" : "sans-serif");
// Build html body
Document document = JsoupEx.parse(message.getFile(context));
@@ -557,6 +559,12 @@ public class MessageHelper {
HtmlHelper.convertLists(document);
if (send) {
for (Element child : document.body().children())
if (TextUtils.isEmpty(child.attr("fairemail"))) {
String style = HtmlHelper.mergeStyles(
"font-family:" + compose_font, child.attr("style"));
child.attr("style", style);
}
document.select("div[fairemail=signature]").removeAttr("fairemail");
document.select("div[fairemail=reference]").removeAttr("fairemail");
}