Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgTextShapeLayoutFunc.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 * SPDX-FileCopyrightText: 2022 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KO_SVG_TEXT_SHAPE_LAYOUT_FUNC_H
9#define KO_SVG_TEXT_SHAPE_LAYOUT_FUNC_H
10
11#include "KoSvgTextShape_p.h"
12
14{
15
16void calculateLineHeight(CharacterResult cr, double &ascent, double &descent, bool isHorizontal, bool compare = false);
17
19 QPointF &currentPos,
20 QVector<int> &wordIndices,
21 LineBox &currentLine,
22 bool ltr,
23 bool isHorizontal);
24
26 QPointF &currentPos,
27 LineBox &currentLine,
28 QPointF &lineOffset,
29 const KoSvgText::TextAnchor anchor,
30 const KoSvgText::WritingMode writingMode,
31 const bool ltr,
32 const bool inlineSize,
33 const bool textInShape,
34 const KoSvgText::ResolutionHandler &resHandler);
35
37 const QMap<int, int> &logicalToVisual,
39 QPointF startPos, const KoSvgText::ResolutionHandler &resHandler);
40
42getShapes(QList<KoShape *> shapesInside, QList<KoShape *> shapesSubtract, const KoSvgTextProperties &properties);
43
45 const QMap<int, int> &logicalToVisual,
47 QList<QPainterPath> shapes, QPointF &startPos, const KoSvgText::ResolutionHandler &resHandler);
48
49} // namespace KoSvgTextShapeLayoutFunc
50
51#endif // KO_SVG_TEXT_SHAPE_LAYOUT_FUNC_H
void calculateLineHeight(CharacterResult cr, double &ascent, double &descent, bool isHorizontal, bool compare=false)
calculateLineHeight calculate the total ascent and descent (including baseline-offset) of a charResul...
QVector< LineBox > flowTextInShapes(const KoSvgTextProperties &properties, const QMap< int, int > &logicalToVisual, QVector< CharacterResult > &result, QList< QPainterPath > shapes, QPointF &startPos, const KoSvgText::ResolutionHandler &resHandler)
void finalizeLine(QVector< CharacterResult > &result, QPointF &currentPos, LineBox &currentLine, QPointF &lineOffset, const KoSvgText::TextAnchor anchor, const KoSvgText::WritingMode writingMode, const bool ltr, const bool inlineSize, const bool textInShape, const KoSvgText::ResolutionHandler &resHandler)
QList< QPainterPath > getShapes(QList< KoShape * > shapesInside, QList< KoShape * > shapesSubtract, const KoSvgTextProperties &properties)
QVector< LineBox > breakLines(const KoSvgTextProperties &properties, const QMap< int, int > &logicalToVisual, QVector< CharacterResult > &result, QPointF startPos, const KoSvgText::ResolutionHandler &resHandler)
void addWordToLine(QVector< CharacterResult > &result, QPointF &currentPos, QVector< int > &wordIndices, LineBox &currentLine, bool ltr, bool isHorizontal)
addWordToLine Small function used in break lines to quickly add a 'word' to the current line....
TextAnchor
Where the text is anchored for SVG 1.1 text and 'inline-size'.
Definition KoSvgText.h:79
The ResolutionHandler class.
Definition KoSvgText.h:1084
The LineBox struct.