[ https://issues.apache.org/jira/browse/FLEX-33561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13659151#comment-13659151 ]
Justin Mclean commented on FLEX-33561: -------------------------------------- Issue is that the font is not embedded and it's using the Time Roman font metrics to calculate the position of the underline. FTE doesn't natively support underlines but draws then on top of the text. >From inside createTextLinesFromTextBlock method in FTETextField. // FTE doesn't render underlines, // but it can tell us where to draw them. // You can't draw in a TextLine but it can have children, // so we create a child Shape to draw them in. var fontMetrics:FontMetrics; if (fontContext) fontMetrics = fontContext.callInContext(elementFormat.getFontMetrics, elementFormat, []); else fontMetrics = elementFormat.getFontMetrics(); var shape:Shape = new Shape(); var g:Graphics = shape.graphics; g.lineStyle(fontMetrics.underlineThickness, elementFormat.color, elementFormat.alpha); g.moveTo(0, fontMetrics.underlineOffset); g.lineTo(textLine.textWidth, fontMetrics.underlineOffset); A fix may be being able to set elementFormat dominantBaseline or alignmentBase line property as the defaults are dominantBaseline = "roman" and alignmentBaseline = "useDominantBaseline". > FTETextField underline overlaps with East Asian text > ---------------------------------------------------- > > Key: FLEX-33561 > URL: https://issues.apache.org/jira/browse/FLEX-33561 > Project: Apache Flex > Issue Type: Bug > Components: Spark: FTETextField > Affects Versions: Apache Flex 4.9.0 > Reporter: JC Franco > Labels: fte, underline > Attachments: textfield vs ftetextfield.png > > > The following sample application shows the underline overlapping with East > Asian text (Japanese | Chinese (simplified) | Korean). > <?xml version="1.0" encoding="utf-8"?> > <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" > xmlns:s="library://ns.adobe.com/flex/spark" > xmlns:mx="library://ns.adobe.com/flex/mx" > creationComplete="init();"> > <s:controlBarContent> > <s:Label id="sdkVer" initialize="sdkVer.text = > mx_internal::VERSION;"/> > </s:controlBarContent> > <fx:Script> > <![CDATA[ > import mx.core.FTETextField; > private function init():void > { > var textFormat:TextFormat = new TextFormat(); > textFormat.bold = true; > textFormat.underline = true; > textFormat.size = 40; > var textField:TextField = new TextField(); > textField.defaultTextFormat = textFormat; > textField.text = "こんにちは | 你好 | 안녕하세요" > textField.autoSize = TextFieldAutoSize.LEFT; > textField.y = 10; > canvas.rawChildren.addChild(textField); > var fteTextField:FTETextField = new FTETextField(); > fteTextField.defaultTextFormat = textFormat; > fteTextField.text = "こんにちは | 你好 | 안녕하세요" > fteTextField.autoSize = TextFieldAutoSize.LEFT; > fteTextField.y = 50; > canvas.rawChildren.addChild(fteTextField); > } > ]]> > </fx:Script> > <s:VGroup x="20" y="20"> > <mx:Canvas id="canvas"/> > </s:VGroup> > </s:Application> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira