Fluent-Qt

API reference

TextPaintCompat

Public types, functions, and constants declared in this header.

fluent::painting

Methods

inline qreal verticallyCenteredTextBaseline(const QRectF& targetRect, const QFontMetricsF& metrics)

Returns a centered font baseline, independent of the displayed characters.

inline int verticallyCenteredTextBaseline(const QRect& targetRect, const QFontMetrics& metrics)

Preserves Qt's integer geometry rounding for existing point-based text painters.

inline int devicePixelRatioMetric(QPaintDevice::PaintDeviceMetric metric, qreal dpr)

Encodes a target DPR for a forwarding paint device's metric override.

inline qreal imageRasterDpr(qreal dpr)

Returns the DPR precision used by QImage's raster paint device.

inline qreal verticallyCenteredTextInkOffset(const QRectF& targetRect, const QFontMetricsF& metrics, const QString& text)

Returns the vertical translation that centers visible glyph ink in a target rectangle.

inline QRectF verticallyCenteredTextInkRect(const QRectF& targetRect, const QFontMetricsF& metrics, const QString& text)

Returns a text rectangle translated so its visible glyph ink is vertically centered.

inline qreal alignedTextInkCenterY(const QRectF& alignedRect, const QFontMetricsF& metrics, const QString& text)

Returns the visible glyph-ink center for text drawn with vertical-center alignment.