blob: 96d805dcda537e25062f1294d7d2d200ffc9487f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Inkscape::Text::Layout - text layout engine misc
*
* Authors:
* Richard Hughes <cyreve@users.sf.net>
*
* Copyright (C) 2005 Richard Hughes
*
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
*/
#include "Layout-TNG.h"
namespace Inkscape {
namespace Text {
const gunichar Layout::UNICODE_SOFT_HYPHEN = 0x00AD;
const double Layout::LINE_HEIGHT_NORMAL = 1.25;
Layout::Layout() = default;
Layout::~Layout()
{
clear();
}
void Layout::clear()
{
_clearInputObjects();
_clearOutputObjects();
textLength._set = false;
textLengthMultiplier = 1;
textLengthIncrement = 0;
lengthAdjust = LENGTHADJUST_SPACING;
}
bool Layout::_directions_are_orthogonal(Direction d1, Direction d2)
{
if (d1 == BOTTOM_TO_TOP) d1 = TOP_TO_BOTTOM;
if (d2 == BOTTOM_TO_TOP) d2 = TOP_TO_BOTTOM;
if (d1 == RIGHT_TO_LEFT) d1 = LEFT_TO_RIGHT;
if (d2 == RIGHT_TO_LEFT) d2 = LEFT_TO_RIGHT;
return d1 != d2;
}
}//namespace Text
}//namespace Inkscape
|