라이브러리

[PHP] ImagickDraw::getFontStretch - 텍스트로 주석을 달 때 사용할 글꼴 스트레치를 가져옵니다.




ImagickDraw::getFontStretch

ImagickDraw::getFontStretch는 ImagickDraw 객체의 font stretch 속성을 반환하는 메서드입니다. 이 속성은 글꼴의 두께를 조절하는 데 사용됩니다.

사용 방법


ImagickDraw::getFontStretch를 사용하려면 먼저 ImagickDraw 객체를 생성하고, font stretch 속성을 설정한 후 getFontStretch 메서드를 호출하면 됩니다.

예제


#hostingforum.kr
php

<?php



// ImagickDraw 객체 생성

$draw = new ImagickDraw();



// font stretch 속성 설정 (normal, condensed, expanded)

$draw->setFontStretch('expanded');



// getFontStretch 메서드 호출

$fontStretch = $draw->getFontStretch();



// 결과 출력

echo "fontStretch: $fontStretch
";



// 이미지 생성

$image = new Imagick();

$image->newImage(500, 500, 'white');

$image->setImageFormat('png');



// 이미지에 텍스트 그리기

$image->annotateImage($draw, 100, 100, 0, 'ImagickDraw::getFontStretch');



// 이미지 출력

header('Content-Type: image/png');

echo $image;



?>



결과


이 예제에서는 ImagickDraw::getFontStretch 메서드를 호출하여 font stretch 속성을 반환하고, 결과를 출력합니다. 결과는 다음과 같습니다.

#hostingforum.kr


fontStretch: expanded



이 예제에서는 font stretch 속성을 expanded로 설정하고, getFontStretch 메서드를 호출하여 속성을 반환합니다. 결과는 expanded가 출력됩니다.

참고


ImagickDraw::getFontStretch 메서드는 ImagickDraw 객체의 font stretch 속성을 반환합니다. 이 속성은 글꼴의 두께를 조절하는 데 사용됩니다. 이 메서드를 사용하려면 먼저 ImagickDraw 객체를 생성하고, font stretch 속성을 설정한 후 getFontStretch 메서드를 호출하면 됩니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 468 페이지

검색

게시물 검색