mikepenz / Android-Iconics

Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
https://mikepenz.dev
Apache License 2.0
5.16k stars 619 forks source link

Some icons are incorrectly rendered with `IconicsTextView` + XML #592

Open smelfungus opened 3 years ago

smelfungus commented 3 years ago

About this issue

Some icons are incorrectly rendered with IconicsTextView + XML.

Sample code:

<com.mikepenz.iconics.view.IconicsTextView
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:text="@string/title_statistics_chart_success"
  android:textAppearance="?attr/textAppearanceBody2" />
<string name="title_statistics_chart_success">{gmd-trending-up} Success</string>

Details

Fonts:

mikepenz commented 3 years ago

Are they correctly rendered if using as IconicsDrawable?

smelfungus commented 3 years ago

@mikepenz I just checked this, yes: image

mikepenz commented 3 years ago

Could it be that the font was not initialised, or maybe android API level related?

smelfungus commented 3 years ago

@mikepenz, let me create a reproducible sample and share it asap.

smelfungus commented 3 years ago

@mikepenz It seems like the appcompat dependency is causing this issue, it is working with: androidx.appcompat:appcompat:1.3.1 But starts breaking with: androidx.appcompat:appcompat:1.4.0-alpha01+ Sample: https://github.com/dummyco/android-iconics-gh-592

mikepenz commented 3 years ago

That's super interesting :/ will have to take a closer look, not sure why that would be.

mikepenz commented 3 years ago

Maybe it's time to deprecate all text based forms, and only retain the IconicsDrawable

mikepenz commented 2 years ago
Screenshot 2021-07-30 at 09 11 13

I have the feeling something in here overwrites our spannable

mikepenz commented 2 years ago

You will have to add app:emojiCompatEnabled="false" to the xml (using their setter to disable it programmatically from the view seems to not work.

mikepenz commented 2 years ago

Tried to find a way around, but have not found any solution beside disabling support for it via xml

smelfungus commented 2 years ago

That's wonderful! Thank you for taking a look 👍🏻

nonproto commented 2 years ago

Just to note this also occurs on compose previews

Jibonahmed115 commented 1 year ago

Are they correctly rendered if using as IconicsDrawable?