|
Krita Source Code Documentation
|
The ResolutionHandler class. More...
#include <KoSvgText.h>
Public Member Functions | |
| QPointF | adjust (const QPointF point) const |
| Adjusts the point to rounded pixel values, based on whether roundToPixelHorizontal or roundToPixelVertical are true. | |
| QRectF | adjust (const QRectF rect) const |
| Adjusts the rect to rounded pixel values, based on whether roundToPixelHorizontal or roundToPixelVertical are true. | |
| QPointF | adjustCeil (const QPointF point) const |
| Adjusts the point to ceiled pixel values. | |
| QPointF | adjustFloor (const QPointF point) const |
| Adjusts the point to floored pixel values. | |
| QPointF | adjustWithOffset (const QPointF point, const QPointF offset) const |
| qreal | freeTypePixelToPointFactor (const bool x=true) const |
| QTransform | freeTypeToPixelTransform () const |
| QTransform | freeTypeToPointTransform () const |
| QTransform | pixelToPoint () const |
| qreal | pixelToPointFactor (const bool x=true) const |
| QTransform | pointToPixel () const |
| qreal | pointToPixelFactor (const bool x=true) const |
| ResolutionHandler (qreal _xRes=72.0, qreal _yRes=72.0, bool _roundToPixelHorizontal=false, bool _roundToPixelVertical=false) | |
Public Attributes | |
| const qreal | freeTypePixel = 64.0 |
| const qreal | pointInInch = 72.0 |
| bool | roundToPixelHorizontal = false |
| bool | roundToPixelVertical = false |
| qreal | xRes = 72.0 |
| qreal | yRes = 72.0 |
The ResolutionHandler class.
convenience struct to handle all the conversions between pixels and points and freetype pixels.
Definition at line 1084 of file KoSvgText.h.
|
inline |
Definition at line 1086 of file KoSvgText.h.
| QPointF KoSvgText::ResolutionHandler::adjust | ( | const QPointF | point | ) | const |
Adjusts the point to rounded pixel values, based on whether roundToPixelHorizontal or roundToPixelVertical are true.
Definition at line 1704 of file KoSvgText.cpp.
References pixelToPoint(), pointToPixel(), roundToPixelHorizontal, and roundToPixelVertical.
| QRectF KoSvgText::ResolutionHandler::adjust | ( | const QRectF | rect | ) | const |
Adjusts the rect to rounded pixel values, based on whether roundToPixelHorizontal or roundToPixelVertical are true.
Definition at line 1748 of file KoSvgText.cpp.
References adjust().
| QPointF KoSvgText::ResolutionHandler::adjustCeil | ( | const QPointF | point | ) | const |
Adjusts the point to ceiled pixel values.
Definition at line 1729 of file KoSvgText.cpp.
References pixelToPoint(), pointToPixel(), roundToPixelHorizontal, and roundToPixelVertical.
| QPointF KoSvgText::ResolutionHandler::adjustFloor | ( | const QPointF | point | ) | const |
Adjusts the point to floored pixel values.
Definition at line 1716 of file KoSvgText.cpp.
References pixelToPoint(), pointToPixel(), roundToPixelHorizontal, and roundToPixelVertical.
| QPointF KoSvgText::ResolutionHandler::adjustWithOffset | ( | const QPointF | point, |
| const QPointF | offset ) const |
For text decoration, we need to ensure that the whole thing, including width and height is aligned to the pixel. So this adds the offset (half the total width) and uses that to round to.
Definition at line 1742 of file KoSvgText.cpp.
References adjust(), roundToPixelHorizontal, and roundToPixelVertical.
| qreal KoSvgText::ResolutionHandler::freeTypePixelToPointFactor | ( | const bool | x = true | ) | const |
Definition at line 1687 of file KoSvgText.cpp.
References freeTypePixel, and pixelToPointFactor().
| QTransform KoSvgText::ResolutionHandler::freeTypeToPixelTransform | ( | ) | const |
Definition at line 1691 of file KoSvgText.cpp.
References freeTypePixel.
| QTransform KoSvgText::ResolutionHandler::freeTypeToPointTransform | ( | ) | const |
Definition at line 1695 of file KoSvgText.cpp.
References freeTypeToPixelTransform(), and pixelToPoint().
| QTransform KoSvgText::ResolutionHandler::pixelToPoint | ( | ) | const |
| qreal KoSvgText::ResolutionHandler::pixelToPointFactor | ( | const bool | x = true | ) | const |
| QTransform KoSvgText::ResolutionHandler::pointToPixel | ( | ) | const |
Definition at line 1756 of file KoSvgText.cpp.
References pointInInch, xRes, and yRes.
| qreal KoSvgText::ResolutionHandler::pointToPixelFactor | ( | const bool | x = true | ) | const |
Definition at line 1752 of file KoSvgText.cpp.
References pointInInch, xRes, and yRes.
| const qreal KoSvgText::ResolutionHandler::freeTypePixel = 64.0 |
Definition at line 1095 of file KoSvgText.h.
| const qreal KoSvgText::ResolutionHandler::pointInInch = 72.0 |
Definition at line 1096 of file KoSvgText.h.
| bool KoSvgText::ResolutionHandler::roundToPixelHorizontal = false |
Definition at line 1092 of file KoSvgText.h.
| bool KoSvgText::ResolutionHandler::roundToPixelVertical = false |
Definition at line 1093 of file KoSvgText.h.
| qreal KoSvgText::ResolutionHandler::xRes = 72.0 |
Definition at line 1090 of file KoSvgText.h.
| qreal KoSvgText::ResolutionHandler::yRes = 72.0 |
Definition at line 1091 of file KoSvgText.h.