chrisjenx / Calligraphy

Custom fonts in Android the easy way...
Apache License 2.0
8.59k stars 1.09k forks source link

Android P elongated P and 5 characters when using avenir_medium #465

Closed Starwind0 closed 5 years ago

Starwind0 commented 6 years ago

I have an android app using io.github.inflationx:calligraphy3:3.0.0 With the following build settings compileSdkVersion 28 buildToolsVersion "27.0.3" Testing on Google Pixel XL OS android 9

What is interesting is, if I have a small text view that needs to show the 5 character, the text is elongated in a weird way. This is for font_avenir_medium It only happens on the P devices, and it happens when the font SP is set below 25. But only for this font. If I change in to avenir_book it will work fine.

This happened all over the app when I was on Calligraphy 2, but they were resolved in 3. In that case more than the 5 was effected.

<TextView
                android:id="@+id/clockin_hour_count"
                android:text="5"
                android:textColor="@color/favor_blue"
                android:textSize="15sp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                style="@style/AppTheme.MediumFontText"
                tools:ignore="MissingPrefix"
                />

We can see here from left to right the effect. 15sp, 20sp, 25sp screenshot_20181121-155321

Do note that Cal3 seems to be missing issue submissions..

Starwind0 commented 5 years ago

As I am not expecting to find help here for a cal 3 issue, and there is nowhere to submit a cal3 report I have posted this on stack overflow. https://stackoverflow.com/questions/53489703/artifact-on-android-p-for-the-character-5-with-calligraphy-3

chrisjenx commented 5 years ago

Probably need to enable subpixel rendering. But also probably not a mobile friendly font.