I have embedded my font using the embed meta tag, along which the entire range of Unicode characters... here is my CustomTextField class:
[Embed(source='../assets/fonts/Arial.ttf',fontName='CustomFont',fontWeight='regular',
unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF',
mimeType='application/x-font-truetype'
)]
public static var MY_FONT:Class;
[Embed(source='../assets/fonts/Arial Bold.ttf',fontName='CustomFont',fontWeight='bold',
unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF',
mimeType='application/x-font-truetype'
开发者_JS百科 )]
public static var MY_FONT_BOLD:Class;
public static const DEFAULT_FONT:String = "CustomFont";
public static const DEFAULT_TEXT_COLOUR:int = 0x000000;
public static const DEFAULT_TEXT_SIZE:int = 14;
private var _tf:TextFormat = new TextFormat(DEFAULT_FONT, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_COLOUR);
public function CustomTextField():void
{
Font.registerFont(CustomTextField.MY_FONT);
Font.registerFont(CustomTextField.MY_FONT_BOLD);
_tf.size = 16;
antiAliasType = AntiAliasType.ADVANCED;
sharpness = 0;
defaultTextFormat = _tf;
autoSize = TextFieldAutoSize.LEFT;
embedFonts = true;
}
public override function set htmlText(value:String):void
{
super.htmlText = value;
setTextFormat(_tf);
}
For some reason, using <li>
tags intends the text perfectly, but I am not seeing any bullet points. The font is just standard Arial, so it isn't a case of the font missing the bullet character.
Does anyone have any idea as to why Flex is not showing the bullet point characters?
I think the BULLET character is U+2022... try including that in your unicodeRange.
I had the same problem and I put a range of "U+2019-U+2022" and it solved my problem.
Thanks!
精彩评论