FontMetrics QML Type

주어진 글꼴에 대한 메트릭을 제공합니다. 더 보기...

Import Statement: import QtQuick

속성

방법

상세 설명

FontMetrics는 주어진 글꼴에 대한 문자 및 문자열의 크기를 계산합니다.

C++ QFontMetricsF API의 하위 집합을 제공하며 font 속성을 통해 계산에 사용되는 글꼴을 변경할 수 있는 기능이 추가되었습니다.

FontMetrics {
    id: fontMetrics
    font.family: "Arial"
}

Rectangle {
    width: fontMetrics.height * 4
    height: fontMetrics.height * 2
}

QFontMetricsFTextMetrics참조하세요 .

속성 문서

ascent : real [read-only]

이 속성은 글꼴의 상승을 보유합니다.

QFontMetricsF::ascent(), descent, height참조하세요 .


averageCharacterWidth : real [read-only]

이 속성은 글꼴의 글리프의 평균 너비를 보유합니다.

QFontMetricsF::averageCharWidth()도 참조하세요 .


descent : real [read-only]

이 속성은 글꼴의 하강을 보유합니다.

QFontMetricsF::descent(), ascent, 및 height도 참조 하세요.


font : font

이 속성은 메트릭 계산에 사용되는 글꼴을 보유합니다.


height : real [read-only]

이 속성은 글꼴의 높이를 보유합니다.

QFontMetricsF::height()도 참조하세요 .


leading : real [read-only]

이 속성은 글꼴의 앞부분을 보유합니다.

QFontMetricsF::leading()도 참조하세요 .


lineSpacing : real [read-only]

이 속성은 한 기준선으로부터 다음 기준선까지의 거리를 보유합니다.

QFontMetricsF::lineSpacing()도 참조하세요 .


lineWidth : real [read-only]

이 속성은 글꼴의 포인트 크기에 맞게 조정된 밑줄 및 취소선의 너비를 보유합니다.

QFontMetricsF::lineWidth()도 참조하세요 .


maximumCharacterWidth : real [read-only]

이 속성은 글꼴에서 가장 넓은 문자의 너비를 보유합니다.

QFontMetricsF::maxWidth()도 참조하세요 .


minimumLeftBearing : real [read-only]

이 속성은 글꼴의 최소 왼쪽 방향을 보유합니다.

QFontMetricsF::minLeftBearing()도 참조하세요 .


minimumRightBearing : real [read-only]

이 속성은 글꼴의 최소 오른쪽 방위각을 보유합니다.

QFontMetricsF::minRightBearing()도 참조하세요 .


overlinePosition : real [read-only]

이 속성은 기준선으로부터 오버라인을 그려야 하는 위치까지의 거리를 보유합니다.

QFontMetricsF::overlinePos(), underlinePosition, 및 strikeOutPosition참조하세요 .


strikeOutPosition : real [read-only]

이 속성은 기준선에서 취소선이 그려져야 하는 위치까지의 거리를 보유합니다.

QFontMetricsF::strikeOutPos(), overlinePosition, 및 underlinePosition도 참조 하세요.


underlinePosition : real [read-only]

이 속성은 기준선에서 밑줄을 그려야 하는 위치까지의 거리를 보유합니다.

QFontMetricsF::underlinePos(), overlinePosition, 및 strikeOutPosition도 참조 하세요.


xHeight : real [read-only]

이 속성은 글꼴의 'x' 높이를 보유합니다.

QFontMetricsF::xHeight()도 참조 하세요.


메서드 문서

qreal advanceWidth(string text)

이 메서드는 text 에 있는 문자의 픽셀 단위 전진을 반환합니다. 이것은 문자열의 위치에서 다음 문자열을 그려야 하는 위치까지의 거리입니다.

이 메서드는 TextMetricsadvanceWidth 속성에 대한 필수적인 대안으로 제공됩니다.

QFontMetricsF::horizontalAdvance() 및 QFontMetricsF::height()도 참조하세요 .


rect boundingRect(string text)

이 메서드는 text 에 지정된 문자열에 있는 문자의 경계 사각형을 반환합니다.

이 메서드는 TextMetricsboundingRect 속성에 대한 명령형 대안으로 제공됩니다.

QFontMetricsF::boundingRect() 및 tightBoundingRect()도 참조하십시오 .


string elidedText(string text, enumeration mode, real width, int flags)

이 메서드는 문자열 textwidth 보다 넓은 경우 문자열의 제거된 버전(즉, "..."가 포함된 문자열)을 반환합니다. 그렇지 않으면 원래 문자열을 반환합니다.

mode 인수는 텍스트 줄 바꿈 모드, 즉 맞지 않는 텍스트를 표시할 때 줄임표가 표시되어야 하는 위치를 지정합니다.

flags 인수는 선택 사항이며 현재 Qt::TextShowMnemonic 만 지원합니다.

이 메서드는 TextMetricselidedText 속성에 대한 필수적인 대안으로 제공됩니다.

Qt::TextElideModeQFontMetricsF::elidedText()도 참조하세요 .


rect tightBoundingRect(string text)

이 메서드는 text 에 지정된 문자열의 문자를 둘러싸는 단단한 경계 사각형을 반환합니다.

이 메서드는 TextMetricstightBoundingRect 속성에 대한 필수 대안으로 제공됩니다.

QFontMetricsF::tightBoundingRect() 및 boundingRect()도 참조하십시오 .


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.