简体   繁体   English

动态文字中带有遮罩的动态文本中的粗体和常规字体在Flash中(使用AS3)

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

I have this text "my text is <b>bold</b> and regular". 我有这样的文字“我的文字是<b>粗体</ b>并且是常规字体”。

I want "<b>bold</b>" to be... well, let's say... bold ! 我希望“ <b>粗体</ b>”成为...好吧,让我们说...粗体!

I have a mask layer under which there is a text field. 我有一个遮罩层,下面有一个文本字段。

The text field shows htmlText, and i must embed chars. 文本字段显示htmlText,我必须嵌入字符。 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. 因此,导入2种用户字体(一种粗体和一种常规)的解决方案不起作用。

I'm thinking this is impossible to do with Flash... Maybe I wrong, am I ? 我认为这与Flash无关...也许我错了,是吗?

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. 无论是否屏蔽TextField,都会发生这种情况。

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. 在您的FLA中创建另一个TextField(我想象是台下),使用相同的字体,相同的大小,但将字体设置为粗体。 Embed characters in that TextField too. 也将字符嵌入该TextField中。

Then, the bold characters in your first TextField will display as bold. 然后,第一个TextField中的粗体字符将显示为粗体。

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). 还有其他方法可以实现此目的,特别是如果您不使用Flash IDE编译swfs(例如,如果通过FDT,FlexBuilder,FlashBuilder或FlashDevelop使用MXML)。 If you do, then you should lookup how to embed fonts using [Embed] metadata. 如果这样做,则应该查找如何使用[Embed]元数据嵌入字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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