diff --git a/app/src/main/java/protect/card_locker/LetterBitmap.java b/app/src/main/java/protect/card_locker/LetterBitmap.java index b36f98e90..3964ca0b0 100644 --- a/app/src/main/java/protect/card_locker/LetterBitmap.java +++ b/app/src/main/java/protect/card_locker/LetterBitmap.java @@ -73,9 +73,10 @@ class LetterBitmap { String firstChar = displayName.substring(0, 1).toUpperCase(); int firstCharEnd = 2; while (firstCharEnd <= displayName.length()) { - // test for the longest render-able string + // Test for the longest render-able string + // But ignore containing only a-Z0-9 to not render things like ffi as a single character String test = displayName.substring(0, firstCharEnd); - if (PaintCompat.hasGlyph(paint, test)) { + if (!isAlphabetical(test) && PaintCompat.hasGlyph(paint, test)) { firstChar = test; } firstCharEnd++; @@ -124,6 +125,10 @@ class LetterBitmap { return colors.getColor(color, Color.BLACK); } + private static boolean isAlphabetical(String string) { + return string.matches("[a-zA-Z0-9]*"); + } + /** * Determine the color which the letter tile will use if no default * color is provided.