Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Layout-TNG.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Inkscape::Text::Layout - text layout engine misc
4 *
5 * Authors:
6 * Richard Hughes <cyreve@users.sf.net>
7 *
8 * Copyright (C) 2005 Richard Hughes
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12#include "Layout-TNG.h"
13
14namespace Inkscape {
15namespace Text {
16
18const double Layout::LINE_HEIGHT_NORMAL = 1.25;
19
20Layout::Layout() = default;
21
23{
24 clear();
25}
26
37
39{
40 if (d1 == BOTTOM_TO_TOP) d1 = TOP_TO_BOTTOM;
41 if (d2 == BOTTOM_TO_TOP) d2 = TOP_TO_BOTTOM;
42 if (d1 == RIGHT_TO_LEFT) d1 = LEFT_TO_RIGHT;
43 if (d2 == RIGHT_TO_LEFT) d2 = LEFT_TO_RIGHT;
44 return d1 != d2;
45}
46
47}//namespace Text
48}//namespace Inkscape
void clear()
Empties everything stored in this class and resets it to its original state, like when it was created...
LengthAdjust lengthAdjust
How do we meet textLength if specified: by letterspacing or by scaling horizontally.
Definition Layout-TNG.h:312
static const double LINE_HEIGHT_NORMAL
The CSS spec allows line-height:normal to be whatever the user agent thinks will look good.
Definition Layout-TNG.h:209
void _clearInputObjects()
Erases all the stuff set by the owner as input, ie _input_stream and _input_wrap_shapes.
void _clearOutputObjects()
Erases all the stuff output by computeFlow().
double textLengthIncrement
This one is used by letterspacing strategy: to each glyph width, this is added.
Definition Layout-TNG.h:320
static bool _directions_are_orthogonal(Direction d1, Direction d2)
so that LEFT_TO_RIGHT == RIGHT_TO_LEFT but != TOP_TO_BOTTOM
double textLengthMultiplier
By how much each character needs to be wider or narrower, using the specified lengthAdjust strategy,...
Definition Layout-TNG.h:318
SVGLength textLength
Gives the length target of this layout, as given by textLength attribute.
Definition Layout-TNG.h:309
Direction
Used to specify any particular text direction required.
Definition Layout-TNG.h:159
static const gunichar UNICODE_SOFT_HYPHEN
Definition Layout-TNG.h:684
bool _set
Definition svg-length.h:41
Helper class to stream background task notifications as a series of messages.
unsigned int gunichar