mirror of https://github.com/M66B/FairEmail.git
Compose Dyslexia
This commit is contained in:
parent
616d18cfdf
commit
94568410a8
|
@ -867,7 +867,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
});
|
||||
|
||||
etBody.setTypeface(Typeface.create(compose_font, Typeface.NORMAL));
|
||||
etBody.setTypeface(StyleHelper.getTypeface(compose_font, getContext()));
|
||||
tvReference.setTypeface(monospaced ? Typeface.MONOSPACE : Typeface.DEFAULT);
|
||||
|
||||
tvReference.setMovementMethod(new ArrowKeyMovementMethod() {
|
||||
|
|
|
@ -769,12 +769,22 @@ public class StyleHelper {
|
|||
String face = family.toLowerCase(Locale.ROOT);
|
||||
if ("fairemail".equals(face)) {
|
||||
Typeface typeface = ResourcesCompat.getFont(context, R.font.fantasy);
|
||||
return new CustomTypefaceSpan(face, typeface);
|
||||
return new CustomTypefaceSpan(family, typeface);
|
||||
} else if (face.contains("comic sans")) {
|
||||
Typeface typeface = ResourcesCompat.getFont(context, R.font.opendyslexic);
|
||||
return new CustomTypefaceSpan(face, typeface);
|
||||
return new CustomTypefaceSpan(family, typeface);
|
||||
} else
|
||||
return new TypefaceSpan(face);
|
||||
return new TypefaceSpan(family);
|
||||
}
|
||||
|
||||
static Typeface getTypeface(String family, Context context) {
|
||||
String face = family.toLowerCase(Locale.ROOT);
|
||||
if ("fairemail".equals(face))
|
||||
return ResourcesCompat.getFont(context, R.font.fantasy);
|
||||
else if (face.contains("comic sans"))
|
||||
return ResourcesCompat.getFont(context, R.font.opendyslexic);
|
||||
else
|
||||
return Typeface.create(family, Typeface.NORMAL);
|
||||
}
|
||||
|
||||
//TextUtils.dumpSpans(text, new LogPrinter(android.util.Log.INFO, "FairEmail"), "afterTextChanged ");
|
||||
|
|
Loading…
Reference in New Issue