mirror of https://github.com/M66B/FairEmail.git
Revert "Consider monospace font as plain text"
This reverts commit a9009f73e9
.
This commit is contained in:
parent
a9009f73e9
commit
e49154f90c
|
@ -894,12 +894,6 @@ public class HtmlHelper {
|
||||||
if (!text_font)
|
if (!text_font)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(value)) {
|
|
||||||
List<String> faces = StyleHelper.getTypeFaces(value);
|
|
||||||
if (faces.contains("monospace"))
|
|
||||||
element.attr("x-plain", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
|
||||||
sb.append(key).append(":").append(value).append(";");
|
sb.append(key).append(":").append(value).append(";");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1816,17 +1816,6 @@ public class StyleHelper {
|
||||||
return new CustomTypefaceSpan(family, getTypeface(family, context));
|
return new CustomTypefaceSpan(family, getTypeface(family, context));
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<String> getTypeFaces(String family) {
|
|
||||||
List<String> faces = new ArrayList<>();
|
|
||||||
for (String face : family.split(","))
|
|
||||||
faces.add(face
|
|
||||||
.trim()
|
|
||||||
.toLowerCase(Locale.ROOT)
|
|
||||||
.replace("'", "")
|
|
||||||
.replace("\"", ""));
|
|
||||||
return faces;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Typeface getTypeface(String family, Context context) {
|
static Typeface getTypeface(String family, Context context) {
|
||||||
if (TextUtils.isEmpty(family))
|
if (TextUtils.isEmpty(family))
|
||||||
return Typeface.DEFAULT;
|
return Typeface.DEFAULT;
|
||||||
|
@ -1835,8 +1824,15 @@ public class StyleHelper {
|
||||||
boolean bundled_fonts = prefs.getBoolean("bundled_fonts", true);
|
boolean bundled_fonts = prefs.getBoolean("bundled_fonts", true);
|
||||||
boolean narrow_fonts = prefs.getBoolean("narrow_fonts", false);
|
boolean narrow_fonts = prefs.getBoolean("narrow_fonts", false);
|
||||||
|
|
||||||
|
List<String> faces = new ArrayList<>();
|
||||||
|
for (String face : family.split(","))
|
||||||
|
faces.add(face
|
||||||
|
.trim()
|
||||||
|
.toLowerCase(Locale.ROOT)
|
||||||
|
.replace("'", "")
|
||||||
|
.replace("\"", ""));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<String> faces = getTypeFaces(family);
|
|
||||||
|
|
||||||
if (faces.contains("fairemail"))
|
if (faces.contains("fairemail"))
|
||||||
return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy);
|
return ResourcesCompat.getFont(context.getApplicationContext(), R.font.fantasy);
|
||||||
|
|
Loading…
Reference in New Issue