라이브러리

[PHP] UIDrawTextFontDescriptor::getWeight - 무게 감지




UIDrawTextFontDescriptor::getWeight

`UIDrawTextFontDescriptor`는 iOS에서 사용하는 텍스트 렌더링을 위한 클래스입니다. `getWeight` 메서드는 텍스트의 글꼴 중량을 반환하는 메서드입니다.

중량 종류


`getWeight` 메서드는 다음 중량 종류를 반환할 수 있습니다.

* `UIFontWeightRegular` (400)
* `UIFontWeightMedium` (500)
* `UIFontWeightBold` (600)
* `UIFontWeightHeavy` (800)
* `UIFontWeightBlack` (900)

예제


#hostingforum.kr
php

// UIFontWeightRegular (400)

$fontDescriptor = new UIDrawTextFontDescriptor();

$fontDescriptor->setWeight(UIFontWeightRegular);

$font = $fontDescriptor->createFont();

print($font->getWeight()); // 400



// UIFontWeightMedium (500)

$fontDescriptor = new UIDrawTextFontDescriptor();

$fontDescriptor->setWeight(UIFontWeightMedium);

$font = $fontDescriptor->createFont();

print($font->getWeight()); // 500



// UIFontWeightBold (600)

$fontDescriptor = new UIDrawTextFontDescriptor();

$fontDescriptor->setWeight(UIFontWeightBold);

$font = $fontDescriptor->createFont();

print($font->getWeight()); // 600



// UIFontWeightHeavy (800)

$fontDescriptor = new UIDrawTextFontDescriptor();

$fontDescriptor->setWeight(UIFontWeightHeavy);

$font = $fontDescriptor->createFont();

print($font->getWeight()); // 800



// UIFontWeightBlack (900)

$fontDescriptor = new UIDrawTextFontDescriptor();

$fontDescriptor->setWeight(UIFontWeightBlack);

$font = $fontDescriptor->createFont();

print($font->getWeight()); // 900



참고


* `UIDrawTextFontDescriptor` 클래스는 iOS에서 사용하는 텍스트 렌더링을 위한 클래스입니다.
* `getWeight` 메서드는 텍스트의 글꼴 중량을 반환하는 메서드입니다.
* 중량 종류는 `UIFontWeightRegular`, `UIFontWeightMedium`, `UIFontWeightBold`, `UIFontWeightHeavy`, `UIFontWeightBlack` 등입니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 8,985건 / 57 페이지

검색

게시물 검색