MaterialNumberPicker icon indicating copy to clipboard operation
MaterialNumberPicker copied to clipboard

crashing when custom font is set

Open githubashutoshsoni opened this issue 5 years ago • 3 comments

maybe I'm doing this totally wrong. But I have a custom font and I need to set it. I tried passing just the string of the font. which i have in res/font/montessara_light_black as "montessara_light_black" in the setFont. It just crashed. Can you show how to do that?

githubashutoshsoni avatar Nov 15 '19 06:11 githubashutoshsoni

Indeed this supports fonts from asset folder. Using fonts from font folder was not possible when this library was created. This should be changed in order to support this

StephenVinouze avatar Dec 30 '19 20:12 StephenVinouze

I prepared a PR to support this way to load the fonts: https://github.com/StephenVinouze/MaterialNumberPicker/pull/21

With this method, we could add our own typeface object instead of use only the fontName from the assets folder

Example: materialNumberPicker.setFontName(ResourcesCompat.getFont(this, R.font.app_font))

fperez-rsc avatar Jun 19 '20 12:06 fperez-rsc

Cool! :D

AlejandroHCruz avatar Oct 20 '20 10:10 AlejandroHCruz