Comments (7)
//only required if you add a custom or generic font on your own
Iconics.init(getApplicationContext());
//register custom fonts like this (or also provide a font definition file)
Iconics.registerFont(new Cniao5Font());
I'm registered
第一个TextView xml android:text="{ion-help-buoy}"
from android-iconics.
@zhuzhuxiang could you please provide more information?
How does the specified font look like? did you define the 3 character key as zhu
?
Do you either register the font when you set up Iconics
or have an initializer like the provided fonts?
Initializer:
https://github.com/mikepenz/Android-Iconics/blob/develop/meteocons-typeface-library/src/main/java/com/mikepenz/iconics/typeface/library/meteoconcs/Initializer.kt#L8-L17
https://github.com/mikepenz/Android-Iconics/blob/develop/meteocons-typeface-library/src/main/AndroidManifest.xml#L28-L30
from android-iconics.
Drawable drawable_custom = new IconicsDrawable(this) .icon(Cniao5Font.Icon.zhu__denglong) .color(Color.GREEN) .sizeDp(150); ((ImageView) this.findViewById(R.id.image_custom)).setImageDrawable(drawable_custom); √ <TextView android:layout_width="50dp" android:layout_height="50dp" android:text="自定义字体{zhu_denglong}" /> ×
from android-iconics.
You duplicated the initial message. Please see my answer above :)
from android-iconics.
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="{ion-help-buoy}" />
<ImageView
android:id="@+id/image_view"
android:layout_width="50dp"
android:layout_height="50dp" />
<TextView
android:layout_width="50dp"
android:layout_height="50dp"
android:text="{zhu_denglong}" />
<ImageView
android:id="@+id/image_custom"
android:layout_width="50dp"
android:layout_height="50dp" />
Drawable drawable = new IconicsDrawable(this)
.icon(Ionicons.Icon.ion_android_add_circle)
.color(Color.RED)
.sizeDp(100);
((ImageView) this.findViewById(R.id.image_view)).setImageDrawable(drawable);
Drawable drawable_custom = new IconicsDrawable(this)
.icon(Cniao5Font.Icon.zhu__denglong)
.color(Color.GREEN)
.sizeDp(100);
((ImageView) this.findViewById(R.id.image_custom)).setImageDrawable(drawable_custom);
The two imageviews and the first textview can be displayed. The second textview uses a custom font. I want to display icons in the form of {} like the first textview. I don't know what to do
zhu Defined. Ionicons class for custom font rewriting
@Override
public String getMappingPrefix() {
return "zhu";
}
public enum Icon implements IIcon {
zhu_gu('\ue60a'),
zhu__chahu('\ue60b'),
zhu__xianglu('\ue60c'),
zhu__denglong('\ue60d'),
zhu__fudao('\ue60e');
from android-iconics.
The Icon
class enum should only have a single _
for the names.
See one off the icons provided from the library here:
https://github.com/mikepenz/Android-Iconics/blob/develop/meteocons-typeface-library/src/main/java/com/mikepenz/iconics/typeface/library/meteoconcs/Meteoconcs.kt
I also see you use Java. Only the latest version of the library is fully supported which is targeted for Kotlin.
from android-iconics.
thanks for this topic! registering my custom font in Application class was the thing that I forgot:
Iconics.init(getApplicationContext());
Iconics.registerFont( MaterialDesignIcon.INSTANCE );
from android-iconics.
Related Issues (20)
- Question regarding FloatingActionButtons coloring. HOT 2
- Update playstore App HOT 1
- Some icons are incorrectly rendered with `IconicsTextView` + XML HOT 13
- Update Community Material to latest version HOT 7
- Shadows with Compose HOT 1
- Disabling AppStartup silently breaks the library HOT 3
- com.mikepenz.iconics.view.IconicsImageView won't show image HOT 2
- Update Phosphor icon set to latest version HOT 1
- Custom Font library import error: Expecting member declaration HOT 2
- Update Google Material icons HOT 11
- How to make icons take on highlighted color of MaterialDrawerItem in XML? HOT 3
- Upgrade from 3.x to 5.x HOT 2
- java.lang.ClassNotFoundException: Didn't find class "com.mikepenz.iconics.typeface.IconicsInitializer" HOT 4
- Wrong icon name: faw-android
- Compose equivalent of IconicsTextView HOT 1
- Can I get source code for the iconpack creator tool? HOT 4
- Interface IIcon is unstable. HOT 12
- faw_bluetooth is missing
- Compose Image is ignoring `size` modifier HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-iconics.