Use font mapper for monospace font

master
M66B 7 months ago
parent 1a1f7b0280
commit dabeedd842

@ -101,7 +101,7 @@ public class ActivitySignature extends ActivityBase {
style_bar = findViewById(R.id.style_bar);
bottom_navigation = findViewById(R.id.bottom_navigation);
etText.setTypeface(monospaced ? Typeface.MONOSPACE : Typeface.DEFAULT);
etText.setTypeface(monospaced ? StyleHelper.getTypeface("monospace", this) : Typeface.DEFAULT);
etText.setSelectionListener(new EditTextCompose.ISelection() {
@Override
@ -234,7 +234,7 @@ public class ActivitySignature extends ActivityBase {
@Override
protected void onResume() {
super.onResume();
etText.setTypeface(etText.isRaw() ? Typeface.MONOSPACE : Typeface.DEFAULT);
etText.setTypeface(etText.isRaw() ? StyleHelper.getTypeface("monospace", this) : Typeface.DEFAULT);
}
@Override
@ -431,7 +431,7 @@ public class ActivitySignature extends ActivityBase {
tvHtmlRemark.setVisibility(raw ? View.VISIBLE : View.GONE);
etText.setRaw(raw);
etText.setTypeface(raw ? Typeface.MONOSPACE : Typeface.DEFAULT);
etText.setTypeface(raw ? StyleHelper.getTypeface("monospace", this) : Typeface.DEFAULT);
load(html);
if (raw)

@ -6907,6 +6907,7 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
final boolean plain_only = prefs.getBoolean("plain_only", false);
final Typeface monospace = StyleHelper.getTypeface("monospace", getContext());
db.message().liveMessage(data.draft.id).observe(getViewLifecycleOwner(), new Observer<EntityMessage>() {
@Override
@ -6967,10 +6968,10 @@ public class FragmentCompose extends FragmentBase {
if (compose_monospaced) {
if (draft.isPlainOnly())
etBody.setTypeface(Typeface.MONOSPACE);
etBody.setTypeface(monospace);
else {
Typeface tf = etBody.getTypeface();
if (tf == Typeface.MONOSPACE)
if (tf == monospace)
etBody.setTypeface(StyleHelper.getTypeface(compose_font, etBody.getContext()));
}
}

Loading…
Cancel
Save