Support default font for bold/italic style?
See original GitHub issueI don’t know if this feature has been implemented or not. I just recently applying OpenSans-Regular.ttf
as global default, then all bold TextView turned to normal (non-bold style). I wish there is a built-in and clean way to provide default bold font file (e.g. OpenSans-Bold.ttf
) when used by TextView
, perhaps by checking it in TextView#getTypeface().isBold()
.
I think this feature will come in handy because it will eliminate the need to apply custom style one by one to all bold/italic texts.
Thanks
Issue Analytics
- State:
- Created 9 years ago
- Comments:20 (7 by maintainers)
Top Results From Across the Web
font-style - CSS: Cascading Style Sheets - MDN Web Docs
The font-style CSS property sets whether a font should be styled with a normal, italic, or oblique face from its font-family.
Read more >Add bold, italic, underline, and strikethrough to text in Pages ...
The Style controls in the Format sidebar with callouts to the Bold, Italic, Underline. Click one or more format buttons in the Font...
Read more >Fonts and Formatting for Visual Studio - Microsoft Learn
By default, the environment font is tied to a system font that appears as 9 pt Segoe UI in current versions of Windows....
Read more >How To Style Text Elements with Font, Size, and Color in CSS
Save styles.css , then open up index.html in your browser. You will find a new font in place of the browser default font...
Read more >Font families and font styles - JpGraph
Font family name Type Comment
FF_FONT0 Bitmap A very small font
FF_FONT1 Bitmap A medium sized font
FF_FONT2 Bitmap The largest bit mapped font
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@akhyrul Yes I have been researching how to do this. I expect this will be a 2.x feature.
For example you would define:
Which would scope to something like:
Which would inherently lookup
OpenSans-Bold
if it can’t find it then apply fake bold etc.This would also be applicable to strings
<string>Hello <b>World</b></string>
which would try to find the correct bold version instead of applying fake bold.This is what you’re thinking right?
@OneManMobile rather than manual search-and-replace, currently I’m using this cleaner temporary workaround by using styles:
So I can use it in any layouts like this:
I purposely put
<item name="android:textStyle">bold</item>
to make sure preview in Android Studio shows correct bold style.Hopefully there will be a cleaner way in 2.x 👍
Thanks