Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgTextContentElement.cpp File Reference
#include "KoSvgTextContentElement.h"
#include "KoCssTextUtils.h"
#include <kis_dom_utils.h>
#include "SvgUtil.h"
#include "KoXmlWriter.h"
#include "SvgStyleWriter.h"
#include <kis_global.h>
#include "SvgGraphicContext.h"
#include <QRegularExpression>
#include <ksharedconfig.h>
#include <kconfiggroup.h>

Go to the source code of this file.

Functions

Q_GUI_EXPORT int qt_defaultDpi ()
 
static QString transformText (QString text, KoSvgText::TextTransformInfo textTransformInfo, const QString &lang, QVector< QPair< int, int > > &positions)
 

Variables

const QString TEXT_STYLE_RES = "krita:style-resolution"
 
const QString TEXT_STYLE_TYPE = "krita:style-type"
 

Function Documentation

◆ qt_defaultDpi()

Q_GUI_EXPORT int qt_defaultDpi ( )

HACK ALERT: this is a function from a private Qt's header qfont_p.h, we don't include the whole header, because it is painful in the environments we don't fully control, e.g. in distribution packages.

◆ transformText()

static QString transformText ( QString text,
KoSvgText::TextTransformInfo textTransformInfo,
const QString & lang,
QVector< QPair< int, int > > & positions )
static

Definition at line 381 of file KoSvgTextContentElement.cpp.

382{
383 if (textTransformInfo.capitals == KoSvgText::TextTransformCapitalize) {
384 text = KoCssTextUtils::transformTextCapitalize(text, lang, positions);
385 } else if (textTransformInfo.capitals == KoSvgText::TextTransformUppercase) {
386 text = KoCssTextUtils::transformTextToUpperCase(text, lang, positions);
387 } else if (textTransformInfo.capitals == KoSvgText::TextTransformLowercase) {
388 text = KoCssTextUtils::transformTextToLowerCase(text, lang, positions);
389 } else {
390 positions.clear();
391 for (int i = 0; i < text.size(); i++) {
392 positions.append(QPair<int, int>(i, i));
393 }
394 }
395
396 if (textTransformInfo.fullWidth) {
398 }
399 if (textTransformInfo.fullSizeKana) {
401 }
402 return text;
403}
static QString transformTextFullSizeKana(const QString &text)
transformTextFullSizeKana This function will take 'small' Kana (Japanese phonetic script) and transfo...
static QString transformTextCapitalize(const QString &text, QString langCode, QVector< QPair< int, int > > &positions)
transformTextToUpperCase This function splits the text into graphemes, and then uses QLocale::toUpper...
static QString transformTextToUpperCase(const QString &text, const QString &langCode, QVector< QPair< int, int > > &positions)
transformTextToUpperCase convenience function that creates a QLocale and uses it's 'toUpper' function...
static QString transformTextToLowerCase(const QString &text, const QString &langCode, QVector< QPair< int, int > > &positions)
transformTextToUpperCase convenience function that creates a QLocale and uses it's 'toLower' function...
static QString transformTextFullWidth(const QString &text)
transformTextFullWidth This function will transform 'narrow' or 'halfwidth' characters to their norma...
@ TextTransformCapitalize
Definition KoSvgText.h:185
@ TextTransformUppercase
Convert all bicarmel text to upper-case, locale dependant.
Definition KoSvgText.h:187
@ TextTransformLowercase
Convert all bicarmel text to lower-case, locale dependant.
Definition KoSvgText.h:188
TextTransform capitals
Text transform upper/lower/capitalize.
Definition KoSvgText.h:637

References KoSvgText::TextTransformInfo::capitals, KoSvgText::TextTransformInfo::fullSizeKana, KoSvgText::TextTransformInfo::fullWidth, KoSvgText::TextTransformCapitalize, KoSvgText::TextTransformLowercase, KoSvgText::TextTransformUppercase, KoCssTextUtils::transformTextCapitalize(), KoCssTextUtils::transformTextFullSizeKana(), KoCssTextUtils::transformTextFullWidth(), KoCssTextUtils::transformTextToLowerCase(), and KoCssTextUtils::transformTextToUpperCase().

Variable Documentation

◆ TEXT_STYLE_RES

const QString TEXT_STYLE_RES = "krita:style-resolution"

Definition at line 161 of file KoSvgTextContentElement.cpp.

◆ TEXT_STYLE_TYPE

const QString TEXT_STYLE_TYPE = "krita:style-type"

Definition at line 160 of file KoSvgTextContentElement.cpp.