简体   繁体   中英

How to use Bold font in iOS for mixed languages?

I know we can use boldSystemFontOfSize , but I want to use another font such as Arial, yes, we can use [UIFont fontWithName:"Arial-Bold"...] to get English chars to Bold , the problem is, other chars such as east Asian chars are not Bold, because Arial-Bold only supports western chars and for non-western chars, it will use system default one which is not Bold. Does anyone has a solution for this?

Find a font that supports bold non-western characters. Include it in your project, and make sure you add the font to your .plist with the Fonts provided by application key. Then use fontWithFontName to load it.

EDIT

So, the question is: have you tried any other iOS-native fonts? I don't know if any of the iOS-supplied fonts have what you want.

For a list of fonts, by iOS version, check here: http://iosfonts.com/

If you want to see those on the device and see if they support your desired character sets, modify one of these projects and see if any of the fonts you like work for you:

https://github.com/ekurutepe/iOS-Font-Gallery

https://github.com/ElfSundae/iOSFontList

If you don't find a font you like, you'll need to look for a font, not included in iOS and include that in your project. There are plenty out there for free. Google "free fonts" to get started.

If you find a font you like, include it as above. Here's a link to one of many SO questions that gives the steps:

Can I embed a custom font in an iPhone application?

Hopefully this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM