question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, It’s a very amazing library But I don’t know how to find the font path to add here " btn.setFontFamily() " here in my font file image how can I find his path Thanks in advance for help.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Bryanxcommented, Jul 10, 2020

Alternatively you can set the fonts individually. I didn’t know kotlin function parameter were not compatible with java.

btn.getTvText().setTypeface(...);
btn.getTvSelectedText().setTypeface(...);
0reactions
dev-abhisek30commented, Mar 9, 2022

setFontFamily() actually creates a new font asset. To use an existing font resource you can do this:

btn.applyToTexts {
  it.setTypeface(ResourcesCompat.getFont(context, R.font.stc), Typeface.BOLD)
}

I agree this may a bit clumsy/confusing. I will consider to update the api in the next minor version.

@Bryanx Do we have a update on this enhancement ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Web Fonts - W3Schools
In the @font-face rule; first define a name for the font (e.g. myFirstFont) and then point to the font file. Tip: Always use...
Read more >
How To Load and Use Custom Fonts with CSS | DigitalOcean
You can use the @font-face rule to load a custom font on a web page. The history of loading custom fonts has lead...
Read more >
How to Add a Custom Fonts to Your Website (HTML and CSS)
In this video you will learn how to add custom fonts to your website or web app. This is not about Google or...
Read more >
How to install a new font family on Windows 10 - Pureinfotech
Use these steps to install a new font family using the Microsoft Store: Open Settings on Windows 10. ... Click the Get more...
Read more >
How to use @font-face in CSS
The @font-face rule allows custom fonts to be loaded on a webpage. Once added to a stylesheet, the rule instructs the browser to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found