开发者

Bold and regular font in dynamic text under a mask In Flash with AS3

开发者 https://www.devze.com 2022-12-20 15:33 出处:网络
I have this text \"my text is <b>bold</b> and regular\". I want \"<b>bold</b>\" to be... well, let\'s say... bold !

I have this text "my text is <b>bold</b> and regular".

I want "<b>bold</b>" to be... well, let's say... bold !

I have a m开发者_如何学编程ask layer under which there is a text field.

The text field shows htmlText, and i must embed chars. If not embedded, it doesn't display because of the mask. So the solution of importing 2 user fonts ( one bold and one regular) does not work.

I'm thinking this is impossible to do with Flash... Maybe I wrong, am I ?

Thank you !


The problem is that when you embed the characters, it only embeds normal-weight font characters. The Mask is a red-herring; this will happen whether you mask the TextField or not.

You can solve the problem however! Create another TextField in your FLA (off-stage, I imagine) with the same font at the same size, but set the font to bold. Embed characters in that TextField too.

Then, the bold characters in your first TextField will display as bold.

There are other ways to achieve this, especially if you don't use the Flash IDE to compile your swfs (if you use MXML through FDT, FlexBuilder, FlashBuilder or FlashDevelop for example). If you do, then you should lookup how to embed fonts using [Embed] metadata.

0

精彩评论

暂无评论...
验证码 换一张
取 消