| 패키지 | flash.text.engine |
| 클래스 | public final class EastAsianJustifier |
| 상속 | EastAsianJustifier TextJustifier Object |
| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
new EastAsianJustifier() 생성자를 사용하여 EastAsianJustifier 객체를 만든 다음 객체의 속성을 설정합니다. EastAsianJustifier 객체의 속성을 TextBlock에 적용한 후 이 속성을 설정하면 TextBlock이 무효화되지 않습니다.
관련 API 요소
공용 속성
| 속성 | 정의 주체 | ||
|---|---|---|---|
| composeTrailingIdeographicSpaces : Boolean
정렬 도중 행의 끝에서 표의 문자 공간을 작성할지 아니면 삭제할지를 지정합니다. | EastAsianJustifier | ||
![]() | constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | |
| justificationStyle : String
텍스트 블록의 텍스트에 대한 정렬 스타일을 지정합니다. | EastAsianJustifier | ||
![]() | lineJustification : String
텍스트 블록의 텍스트에 대한 행 정렬을 지정합니다. | TextJustifier | |
![]() | locale : String [읽기 전용]
텍스트 블록의 텍스트에 대한 정렬 규칙을 결정하기 위한 로캘을 지정합니다. | TextJustifier | |
공용 메서드
| 메서드 | 정의 주체 | ||
|---|---|---|---|
EastAsianJustifier(locale:String = "ja", lineJustification:String = "allButLast", justificationStyle:String = "pushInKinsoku")
EastAsianJustifier 객체를 만듭니다. | EastAsianJustifier | ||
[재정의]
EastAsianJustifier의 복사본을 만듭니다. | EastAsianJustifier | ||
![]() | [정적]
지정된 로캘에 적합한 기본 TextJustifier 하위 클래스를 만듭니다. | TextJustifier | |
![]() |
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | |
![]() |
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | |
![]() |
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | |
![]() |
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | |
![]() |
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 문자열 표현을 반환합니다. | Object | |
![]() |
지정된 객체의 프리미티브 값을 반환합니다. | Object | |
속성 세부 정보
composeTrailingIdeographicSpaces | 속성 |
justificationStyle | 속성 |
justificationStyle:String| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
텍스트 블록의 텍스트에 대한 정렬 스타일을 지정합니다.
기본값은 JustificationStyle.PUSH_IN_KINSOKU입니다.
이 속성의 값을 설정하려면 JustificationStyle 클래스의 상수 중 하나를 사용합니다. 다음 표에는 가능한 값이 나열되어 있습니다.
| 문자열 값 | 설명 |
|---|---|
JustificationStyle.PUSH_IN_KINSOKU | 푸시인 정렬을 지정합니다. |
JustificationStyle.PUSH_OUT_ONLY | 푸시아웃 정렬을 지정합니다. |
JustificationStyle.PRIORITIZE_LEAST_ADJUSTMENT | 최소 조정의 우선 순위가 정해지는 정렬을 지정합니다. |
구현
public function get justificationStyle():String public function set justificationStyle(value:String):void관련 API 요소
생성자 세부 정보
EastAsianJustifier | () | 생성자 |
public function EastAsianJustifier(locale:String = "ja", lineJustification:String = "allButLast", justificationStyle:String = "pushInKinsoku")| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
EastAsianJustifier 객체를 만듭니다.
매개 변수locale:String (default = "ja") — 정렬 규칙을 결정할 로캘입니다. 기본값은 "ja"입니다.
| |
lineJustification:String (default = "allButLast") — 단락의 행 정렬 유형입니다. 이 속성에는 LineJustification 상수를 사용합니다. 기본값은 LineJustification.ALL_BUT_LAST입니다.
| |
justificationStyle:String (default = "pushInKinsoku") — 동아시아 정렬자를 사용하는 텍스트 블록의 텍스트에 대한 정렬 스타일입니다. 이 속성에는 JustificationStyle 상수를 사용합니다. 기본값은 JustificationStyle.PUSH_IN_KINSOKU입니다.
|
오류
ArgumentError — 지정된 locale이 null이거나 너무 짧아 유효한 로캘을 나타낼 수 없습니다.
| |
ArgumentError — 지정된 lineJustification이 LineJustification의 멤버가 아닙니다.
| |
ArgumentError — 지정된 justificationStyle이 JustificationStyle의 멤버가 아닙니다.
|
관련 API 요소
메서드 세부 정보
clone | () | 메서드 |
override public function clone():flash.text.engine:TextJustifier| 언어 버전: | ActionScript 3.0 |
| 런타임 버전: | Flash Player 10, AIR 1.5, Flash Lite 4 |
EastAsianJustifier의 복사본을 만듭니다.
반환값flash.text.engine:TextJustifier — EastAsianJustifier 객체의 복사본입니다.
|
예제 예제 사용 방법
EastAsianJustifierExample.as
이 예제에서는 일본어 블록을 세로 방향으로 표시하고 EastAsianJustifier 속성을 사용하여 텍스트를 정렬합니다.
package {
import flash.text.engine.TextBlock;
import flash.text.engine.TextLine;
import flash.text.engine.TextElement;
import flash.text.engine.TextBaseline;
import flash.text.engine.EastAsianJustifier;
import flash.text.engine.LineJustification;
import flash.text.engine.TextRotation;
import flash.text.engine.FontDescription;
import flash.text.engine.ElementFormat;
import flash.display.Stage;
import flash.display.Sprite;
import flash.system.Capabilities;
public class EastAsianJustifierExample extends Sprite {
public function EastAsianJustifierExample():void {
var Japanese_txt:String = String.fromCharCode(
0x5185, 0x95A3, 0x5E9C, 0x304C, 0x300C, 0x653F, 0x5E9C, 0x30A4,
0x30F3, 0x30BF, 0x30FC, 0x30CD, 0x30C3, 0x30C8, 0x30C6, 0x30EC,
0x30D3, 0x300D, 0x306E, 0x52D5, 0x753B, 0x914D, 0x4FE1, 0x5411,
0x3051, 0x306B, 0x30A2, 0x30C9, 0x30D3, 0x30B7, 0x30B9, 0x30C6,
0x30E0, 0x30BA, 0x793E, 0x306E
) +
"FMS 2" +
String.fromCharCode(0x3092, 0x63A1, 0x7528, 0x3059, 0x308B, 0x3068,
0x767a, 0x8868, 0x3057, 0x307e, 0x3057, 0x305F, 0x3002);
var textBlock:TextBlock = new TextBlock();
var font:FontDescription = new FontDescription();
var format:ElementFormat = new ElementFormat();
format.fontSize = 12;
format.locale = "ja";
format.color = 0xCC0000;
textBlock.baselineZero = TextBaseline.IDEOGRAPHIC_CENTER;
textBlock.textJustifier = new EastAsianJustifier("ja", LineJustification.ALL_INCLUDING_LAST);
textBlock.lineRotation = TextRotation.ROTATE_90;
var linePosition:Number = this.stage.stageWidth - 75;
if (Capabilities.os.search("Mac OS") > -1)
// set fontName: Kozuka Mincho Pro R
font.fontName = String.fromCharCode(0x5C0F, 0x585A, 0x660E, 0x671D) + " Pro R";
else
font.fontName = "Kozuka Mincho Pro R";
textBlock.content = new TextElement(Japanese_txt, format);
var previousLine:TextLine = null;
while (true)
{
var textLine:TextLine = textBlock.createTextLine(previousLine, 320);
if (textLine == null)
break;
textLine.y = 20;
textLine.x = linePosition;
linePosition -= 25;
addChild(textLine);
previousLine = textLine;
}
}
}
}
Tue Jun 12 2018, 03:17 PM Z
상속되는 공용 속성 숨기기
상속되는 공용 속성 표시