| <?xml version="1.0"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <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="flash.text.TextRenderer.displayMode=flash.text.TextDisplayMode.CRT"> |
| |
| <fx:Script> |
| <![CDATA[ |
| public var baselinePos1AtMeasure:Number; |
| public var baselinePos1AtDisplay:Number; |
| |
| public var baselinePos2AtMeasure:Number; |
| public var baselinePos2AtDisplay:Number; |
| |
| public var baselinePos3AtMeasure:Number; |
| public var baselinePos3AtDisplay:Number; |
| |
| public var baselinePos4AtMeasure:Number; |
| public var baselinePos4AtDisplay:Number; |
| |
| public var baselinePos5AtMeasure:Number; |
| public var baselinePos5AtDisplay:Number; |
| |
| public var baselinePos6AtMeasure:Number; |
| public var baselinePos6AtDisplay:Number; |
| |
| override protected function measure():void |
| { |
| super.measure(); |
| baselinePos1AtMeasure=label1.baselinePosition; |
| trace("measure() label1.baselinePosition=" + label1.baselinePosition); |
| baselinePos2AtMeasure=label2.baselinePosition; |
| trace("measure() label2.baselinePosition=" + label2.baselinePosition); |
| baselinePos3AtMeasure=label3.baselinePosition; |
| trace("measure() label3.baselinePosition=" + label3.baselinePosition); |
| |
| baselinePos4AtMeasure=richText1.baselinePosition; |
| trace("measure() richText1.baselinePosition=" + richText1.baselinePosition); |
| baselinePos5AtMeasure=richText2.baselinePosition; |
| trace("measure() richText2.baselinePosition=" + richText2.baselinePosition); |
| baselinePos6AtMeasure=richText3.baselinePosition; |
| trace("measure() richText3.baselinePosition=" + richText3.baselinePosition); |
| |
| } |
| |
| override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void |
| { |
| super.updateDisplayList(unscaledWidth, unscaledHeight); |
| baselinePos1AtDisplay=label1.baselinePosition; |
| trace("Display() label1.baselinePosition=" + label1.baselinePosition); |
| baselinePos2AtDisplay=label2.baselinePosition; |
| trace("Display() label2.baselinePosition=" + label2.baselinePosition); |
| baselinePos3AtDisplay=label3.baselinePosition; |
| trace("Display() label3.baselinePosition=" + label3.baselinePosition); |
| |
| baselinePos4AtDisplay=richText1.baselinePosition; |
| trace("Display() richText1.baselinePosition=" + richText1.baselinePosition); |
| baselinePos5AtDisplay=richText2.baselinePosition; |
| trace("Display() richText2.baselinePosition=" + richText2.baselinePosition); |
| baselinePos6AtDisplay=richText3.baselinePosition; |
| trace("Display() richText3.baselinePosition=" + richText3.baselinePosition); |
| } |
| |
| ]]> |
| </fx:Script> |
| <fx:Style> |
| @namespace s "library://ns.adobe.com/flex/spark"; |
| @namespace mx "library://ns.adobe.com/flex/mx"; |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Regular.ttf"); |
| fontFamily: ArialEmbedded; |
| embedAsCFF: true; |
| } |
| |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Bold.ttf"); |
| fontWeight: bold; |
| fontFamily: ArialEmbedded; |
| embedAsCFF: true; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/PT_Serif/PT_Serif-Web-Italic.ttf"); |
| fontStyle: italic; |
| fontFamily: ArialEmbedded; |
| embedAsCFF: true; |
| |
| } |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf"); |
| fontFamily: veraEmbedded; |
| embedAsCFF: false; |
| } |
| |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Bold.ttf"); |
| fontWeight: bold; |
| fontFamily: veraEmbedded; |
| embedAsCFF: false; |
| } |
| |
| @font-face{ |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Italic.ttf"); |
| fontStyle: italic; |
| fontFamily: veraEmbedded; |
| embedAsCFF: false; |
| |
| } |
| |
| @font-face { |
| src: url("../../../../../Assets/Fonts/Lobster_Two/LobsterTwo-Regular.ttf"); |
| fontFamily: ArnoEmbedded; |
| embedAsCFF: true; |
| } |
| s|Label, |
| s|RichText{ |
| fontAntiAliasType: "normal"; |
| fontFamily: ArialEmbedded; |
| fontLookup: "embeddedCFF"; |
| |
| } |
| |
| </fx:Style> |
| <s:Label id="label1" text="Hello World"/> |
| <s:RichText id="richText1" text="Hello, RichText"/> |
| <s:Label id="label2" text=""/> |
| <s:RichText id="richText2" text=""/> |
| <s:Label id="label3" /> |
| <s:RichText id="richText3" /> |
| <s:Label id="label4" backgroundColor="red" textAlign="center" verticalAlign="middle" maxDisplayedLines="1" |
| text="letterbox" width="8" height="17" /> |
| <s:RichText id="richText4" backgroundColor="red" textAlign="center" verticalAlign="middle" maxDisplayedLines="1" |
| text="letterbox" width="8" height="17" /> |
| </s:Application> |