Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_text_data_converter.cpp File Reference
#include "psd_text_data_converter.h"
#include <ft2build.h>
#include <KoCSSFontInfo.h>
#include <KoSvgTextProperties.h>
#include <KoPathSegment.h>
#include <KoPathPoint.h>
#include <KoFontRegistry.h>
#include <KoShape.h>
#include <KoPathShape.h>
#include <KoColorSpace.h>
#include <KoColor.h>
#include <QBuffer>
#include <QStringList>
#include <QTransform>
#include <QXmlStreamWriter>
#include <QtMath>

Go to the source code of this file.

Classes

struct  PsdTextDataConverter::Private
 

Functions

void gatherFills (QDomElement el, QVariantHash &styleDict)
 

Variables

static QHash< int, QString > psdLanguageMap
 

Function Documentation

◆ gatherFills()

void gatherFills ( QDomElement el,
QVariantHash & styleDict )

Definition at line 1346 of file psd_text_data_converter.cpp.

1346 {
1347 if (el.hasAttribute("fill")) {
1348 if (el.attribute("fill") != "none") {
1349 QColor c = QColor(el.attribute("fill"));
1350 //double opacity = el.attribute("fill-opacity", "1.0").toDouble();
1351 styleDict["/FillFlag"] = true;
1352 styleDict["/FillColor"] = QVariantHash({ {"/StreamTag", "/SimplePaint"},
1353 { "/Color", QVariantHash({
1354 {"/Type", 1},
1355 {"/Values", QVariantList({1.0, c.redF(), c.greenF(), c.blueF()})
1356 }})}
1357 });
1358 } else {
1359 styleDict["/FillFlag"] = false;
1360 }
1361 }
1362 if (el.hasAttribute("stroke")) {
1363 if (el.attribute("stroke") != "none" && el.attribute("stroke-width").toDouble() != 0) {
1364 QColor c = QColor(el.attribute("stroke"));
1365 //double opacity = el.attribute("stroke-opacity").toDouble();
1366 styleDict["/StrokeFlag"] = true;
1367 styleDict["/StrokeColor"] = QVariantHash({ {"/StreamTag", "/SimplePaint"},
1368 { "/Color", QVariantHash({
1369 {"/Type", 1},
1370 {"/Values", QVariantList({1.0, c.redF(), c.greenF(), c.blueF()})
1371 }})}
1372 });
1373 } else {
1374 styleDict["/StrokeFlag"] = false;
1375 }
1376 }
1377 if (el.hasAttribute("stroke-linejoin")) {
1378 QString val = el.attribute("stroke-linejoin");
1379 if (val == "miter") {
1380 styleDict["/LineJoin"] = 0;
1381 } else if (val == "round") {
1382 styleDict["/LineJoin"] = 1;
1383 } else if (val == "bevel") {
1384 styleDict["/LineJoin"] = 2;
1385 }
1386 }
1387 if (el.hasAttribute("stroke-linecap")) {
1388 QString val = el.attribute("stroke-linecap");
1389 if (val == "butt") {
1390 styleDict["/LineCap"] = 0;
1391 } else if (val == "round") {
1392 styleDict["/LineCap"] = 1;
1393 } else if (val == "square") {
1394 styleDict["/LineCap"] = 2;
1395 }
1396 }
1397 if (el.hasAttribute("stroke-width") && el.attribute("stroke-width").toDouble() != 0) {
1398 styleDict["/LineWidth"] = el.attribute("stroke-width").toDouble();
1399 }
1400}

Variable Documentation

◆ psdLanguageMap

QHash<int, QString> psdLanguageMap
static

Definition at line 87 of file psd_text_data_converter.cpp.

87 {
88 {0, "en-US"}, // US English
89 {1, "fi"}, // Finnish
90 {2, "fr"}, // French
91 {3, "fr-CA"}, // Canadian French
92 {4, "de"}, // German
93 {5, "de-1901"}, // German before spelling reform
94 {6, "gsw"}, // Swiss German
95 {7, "it"}, // Italian
96 {8, "nb"}, //Norwegian
97 {9, "nn"}, // Norsk (nynorsk)
98 {10, "pt"}, // Portuguese
99 {11, "pt-BR"}, // Brazilian Portuguese
100 {12, "es"}, // Spansh
101 {13, "sv"}, // Swedish
102 {14, "en-UK"}, // British English
103 {15, "nl"}, // Dutch
104 {16, "da"}, // Danish
105 //{17, ""},
106 {18, "ru"}, // Russian
107 //{19, ""},
108 //{20, ""},
109 //{21, ""},
110 {22, "cs"}, // Czech
111 {23, "pl"}, // Polish
112 //{24, ""},
113 {25, "el"}, // Greek
114 {26, "tr"}, // Turkish
115 //{27, ""},
116 {28, "hu"}, // Hungarian
117};