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 1349 of file psd_text_data_converter.cpp.

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

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};