0. 음.... (수정 됨)

embedFonts: true;
이놈은 적용하지 않아도 되는거 같기도 한데 ...... 흠...

1. 적용하는 방법

Label이나 Text 등에서는 바로 사용하여도 되지만... ComboBox, TextInput ... 에 임베디드된 폰트를 사용하고자 하는 경우에는...

    <mx:Style>
        @font-face{
            src: url("./fonts/base02.ttf");
            fontFamily: "Base02";
        }

        .myButtonStyle {
            embedFonts: true;
            fontFamily: Base02;
            fontWeight: normal;
            fontSize: 24;
        }
    </mx:Style>

2. 확인사항

위에서처럼 embedFonts를 이용하여 Button에 적용했는데 안되요~ 라고 말하는 경우를 종종 볼 수 있다.

이유인 즉은 @font-face 설정시 font-weight는 1개만 적용 가능하다는 것이다. 그렇기 때문에 font-weight가 맞지 않게 설정된 경우에는 Button에 폰트가 적용된 것을 확인 할 수 없다 !

이러한 경우에는 아래 처럼 @font-face에서 font-famiily를 동일하게 하고 font-weight를 bold, normal 각각 만들어서 적용해야 한다.

<mx:Style>
    @font-face {
        src: local("Arial");
        fontFamily: ArialEmbedded;
        fontStyle: normal;
        font-weight: normal;
    }

    @font-face {
        src: local("Arial");
        fontFamily: ArialEmbedded;
        fontStyle: normal;
        font-weight: bold;
    }

    Application {
        color: white;
        fontSize: 12px;
        fontFamily: ArialEmbedded;
    }
</mx:Style>



자세한 내용은...

http://blog.flexexamples.com/2007/08/28/styling-a-flex-button-control-using-embedded-fonts/

위 포스트를 참조하기 바랍니다.

+ Recent posts