Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add an attribute to disable Calligraphy on a TextView? #152

Open
squeeish opened this issue Mar 29, 2015 · 20 comments
Open

Comments

@squeeish
Copy link

I'm required to have custom fonts app-wide while using https://github.com/JoanZapata/android-iconify.

However, android-iconify does not work with Calligraphy.

Is there a workaround? Can I do something like this?

<IconTextView
    android:text="{fa-heart}"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:disable_calligraphy="true"
    />
@chrisjenx
Copy link
Owner

Thats a good idea. What would be prefered a attribute or a ignoreClass(Class<?> clazz) in the builder?

@squeeish
Copy link
Author

Right now an attribute will be great because it would fit my needs perfectly. Let me see if I can contribute by looking at the code.

@squeeish
Copy link
Author

squeeish commented Apr 9, 2015

Well in the interim I've found that using Iconify.addIcons(yourTextView) works for me. Leaving this here for future reference.

Meanwhile I'll submit a pull request soon for the new attribute.

@rothschild86
Copy link

How would this play out with menuitems, which don't give access to the underlying TextViews? Or are you somehow building out menus using IconTextViews?

@chrisjenx
Copy link
Owner

I don't think the menu items get any font applied as they are pragmatically
created by Android.

On Mon, 22 Jun 2015 21:14 rothschild86 [email protected] wrote:

How would this play out with menuitems, which don't give access to the
underlying TextViews? Or are you somehow building out menus using
IconTextViews?


Reply to this email directly or view it on GitHub
#152 (comment)
.

@rothschild86
Copy link

@chrisjenx do you have caligraphy and android-iconify running together in you project?

@chrisjenx
Copy link
Owner

No, never used iconify.

On Mon, 22 Jun 2015 21:18 rothschild86 [email protected] wrote:

@chrisjenx https://github.com/chrisjenx do you have caligraphy and
android-iconify running together in you project?


Reply to this email directly or view it on GitHub
#152 (comment)
.

Malinskiy added a commit to Malinskiy/Calligraphy that referenced this issue Jul 13, 2015
@Malinskiy
Copy link

@chrisjenx thanks for a great library

Just faced the same issue and in my opinion it should be an ignoreClass since you don't want to write attribute in every single place where you use iconify in a layout. Created #189

@kashban
Copy link

kashban commented Jul 13, 2015

Why not both options? An attribute and an ignoreClass in the builder? Either can be helpful.

@chrisjenx
Copy link
Owner

OK, seen as more than one person wants this I'll add it as a feature
request.

On Mon, 13 Jul 2015 13:38 kashban [email protected] wrote:

Why not both options? An attribute and an ignoreClass in the builder?
Either can be helpful.


Reply to this email directly or view it on GitHub
#152 (comment)
.

@Malinskiy
Copy link

@kashban on the other hand maybe there is some scenario where this could be of use. Initially I only fixed this for Iconify. Pushed additional changes to pull request with calligraphyIgnore attribute

@ghost
Copy link

ghost commented Sep 11, 2015

@rothschild86 I think until this gets implemented, another way to get both library to work well together would be to update your iconify library to use the v2 that has been released recently. Its author says it now works with Calligraphy. You can have a look at the new features here: http://blog.joanzapata.com/iconify-just-got-a-lot-better/

@chrisjenx
Copy link
Owner

Cool nice work. Just remember, there are spans used in certain places
(Action Bar) still. Apart from that looks like a nice overhaul.

On Fri, 11 Sep 2015 09:32 k3v1n4ud3 [email protected] wrote:

@rothschild86 https://github.com/rothschild86 I think until this gets
implemented, another way to get both library to work well together would be
to update your iconify library to use the v2 that has been released
recently. Its author says it now works with Calligraphy. You can have a
look at the new features here:
http://blog.joanzapata.com/iconify-just-got-a-lot-better/


Reply to this email directly or view it on GitHub
#152 (comment)
.

@rothschild86
Copy link

@k3v1n4ud3 right on! switched to iconics, which also plays nicely with caligraphy.

@kevinvanmierlo
Copy link

I'd still wish to see a disable option. I'm currently using a default font on the default textAppearance. But my font doesn't look good with numbers, so I'd like to disable it for a specific price TextView.
Is this still on the roadmap?

@njwandroid
Copy link

Pinging on this one since it's been 6 months... - Is this still a consideration

@chrisjenx
Copy link
Owner

No. If it doesn't do it anyway, I'll change it so that fontPath="@null" would set the font to system default.

@njwandroid
Copy link

njwandroid commented Dec 20, 2016

@chrisjenx Good idea; I actually had just tried that and it didn't work, so if you end up doing that please let me know. (PS sorry for duplicate issues)... I'll do that though, I'll just ship the fonts myself for now...

<style name="MyNotoSerifHeader">
    <item name="android:textSize">30sp</item>
    <item name="android:textColor">@color/text_black</item>
    <item name="android:fontFamily">serif</item> <!-- Noto serif, introduced in lollipop -->
    <item name="fontPath">@null</item>
</style>

@chrisjenx
Copy link
Owner

chrisjenx commented Dec 20, 2016 via email

@oriolmanya
Copy link

oriolmanya commented Jun 20, 2017

Hi! Great and useful library, thanks!

I'm trying -as others as I can see in this thread- to disable default callygraphy font on specific Textfields to show the system serif default font.

My Activity has lots of Textfield & fragments using the default callygraphy font, so it's not a good idea to remove that.

I've tried with this fontPath="@null" (Without @ as well) parameter on the Textfield but it doesn't work for me. There is another workaround or way to achieve that?

Here is the code:
`

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical|left"
                        android:paddingLeft="20dp"
                        android:text="@string/filter_title_vip"
                        fontPath="@null"
                        android:fontFamily="sans-serif"
                        android:textColor="@color/text_color_dark_blue"
                        android:textSize="15sp"
                        android:letterSpacing="0.06"
                        android:textAllCaps="true"
                        />`

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants