Debug: system font map

pull/194/merge
M66B 3 years ago
parent de75a177bc
commit e564adf4d8

@ -38,7 +38,6 @@ import android.os.Environment;
import android.provider.Settings;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
@ -83,6 +82,7 @@ import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import javax.net.ssl.SSLSocket;
@ -176,6 +176,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvCursorWindow;
private Button btnGC;
private Button btnCharsets;
private Button btnFontMap;
private Button btnCiphers;
private Button btnFiles;
private TextView tvPermissions;
@ -327,6 +328,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvCursorWindow = view.findViewById(R.id.tvCursorWindow);
btnGC = view.findViewById(R.id.btnGC);
btnCharsets = view.findViewById(R.id.btnCharsets);
btnFontMap = view.findViewById(R.id.btnFontMap);
btnCiphers = view.findViewById(R.id.btnCiphers);
btnFiles = view.findViewById(R.id.btnFiles);
tvPermissions = view.findViewById(R.id.tvPermissions);
@ -1118,6 +1120,36 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
btnFontMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SpannableStringBuilder ssb = new SpannableStringBuilderEx();
try {
Typeface typeface = Typeface.create(Typeface.DEFAULT, Typeface.NORMAL);
Field f = Typeface.class.getDeclaredField("sSystemFontMap");
f.setAccessible(true);
Map<String, Typeface> sSystemFontMap = (Map<String, Typeface>) f.get(typeface);
for (String key : sSystemFontMap.keySet())
ssb.append(key).append("\n");
} catch (Throwable ex) {
ssb.append(ex.toString());
}
new AlertDialog.Builder(getContext())
.setIcon(R.drawable.twotone_info_24)
.setTitle(R.string.title_advanced_font_map)
.setMessage(ssb)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Do nothing
}
})
.show();
}
});
btnCiphers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -1387,6 +1387,16 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnGC" />
<Button
android:id="@+id/btnFontMap"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_font_map"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCharsets" />
<Button
android:id="@+id/btnCiphers"
style="?android:attr/buttonStyleSmall"
@ -1395,7 +1405,7 @@
android:layout_marginTop="12dp"
android:text="@string/title_advanced_ciphers"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnCharsets" />
app:layout_constraintTop_toBottomOf="@id/btnFontMap" />
<Button
android:id="@+id/btnFiles"

@ -722,6 +722,7 @@
<string name="title_advanced_android_id" translatable="false">Android ID: %1$s</string>
<string name="title_advanced_gc" translatable="false">GC</string>
<string name="title_advanced_charsets" translatable="false">Charsets</string>
<string name="title_advanced_font_map" translatable="false">Font map</string>
<string name="title_advanced_ciphers" translatable="false">Ciphers</string>
<string name="title_advanced_files" translatable="false">Files &gt;%1$s</string>

Loading…
Cancel
Save