|
Krita Source Code Documentation
|
The FontMetrics class A class to keep track of a variety of font metrics. Note that values are in Freetype pixels and coordinates! (that is 64 times bigger than a regular pixel, and Y is swapped.) More...
#include <KoSvgText.h>
Inheritance diagram for KoSvgText::FontMetrics:Public Member Functions | |
| FontMetrics () | |
| FontMetrics (qreal fontSizeInPt, bool isHorizontal) | |
| void | offsetMetricsToNewOrigin (const Baseline baseline) |
| bool | operator== (const FontMetrics &other) const |
| void | scaleBaselines (const qreal multiplier) |
| void | setBaselineValueByTag (const QString &tag, int32_t value) |
| void | setMetricsValueByTag (const QLatin1String &tag, int32_t value) |
| int | valueForBaselineValue (Baseline baseline) const |
Public Attributes | |
| qint32 | alphabeticBaseline |
| location of alphabetic baseline from origin. | |
| qint32 | ascender |
| distance from origin to top. | |
| qint32 | capHeight |
| Height of capital letters, defaults to ascender. | |
| qint32 | caretOffset |
| qint32 | caretRise |
| qint32 | caretRun |
| These are only used to determine the caret slant proportion. | |
| qint32 | descender |
| distance for origin to bottom. | |
| qint32 | fontSize |
| Currently set size, CSS unit 'em'. | |
| qint32 | hangingBaseline |
| location of the hanging baseline used in north brahmic scripts. | |
| qint32 | ideographicAdvance |
| Advance of the character '水' (U+6C34), CSS Unit ic, defaults to 1 em. | |
| qint32 | ideographicCenterBaseline |
| default baseline for vertical, centered between over and under. | |
| qint32 | ideographicFaceOverBaseline |
| location of ideographic face over baseline, that is, the top of the glyphs. | |
| qint32 | ideographicFaceUnderBaseline |
| location of ideographic face under baseline, that is, the bottom of the glyphs. | |
| qint32 | ideographicOverBaseline |
| location of ideographic over baseline from origin. | |
| qint32 | ideographicUnderBaseline |
| location of ideographic under baseline from origin, may fall back to descender. | |
| bool | isVertical = false |
| Different fontMetrics count between vertical and horizontal. | |
| qint32 | lineGap |
| additional linegap between consecutive lines. | |
| qint32 | lineThroughOffset |
| offset of strike-through from alphabetic baseline. | |
| qint32 | lineThroughThickness |
| strikethrough thickness, from font. | |
| qint32 | mathematicalBaseline |
| location of mathematical baseline from origin. | |
| qint32 | spaceAdvance |
| Advance of the character ' ', used by tabs. | |
| QPair< qint32, qint32 > | subScriptOffset |
| subscript baseline height, defaults to 1/5th em below alphabetic. | |
| QPair< qint32, qint32 > | superScriptOffset |
| superscript baseline height, defaults to 2/3rd above alphabetic. | |
| qint32 | underlineOffset |
| underline offset from alphabetic, positive. | |
| qint32 | underlineThickness |
| underline thickness from font. | |
| qint32 | xHeight |
| height of X, defaults to 0.5 fontsize. | |
| qint32 | zeroAdvance |
| Advance of the character '0', CSS Unit 'ch', defaults to 0.5 em in horizontal and 1.0 em in vertical. | |
The FontMetrics class A class to keep track of a variety of font metrics. Note that values are in Freetype pixels and coordinates! (that is 64 times bigger than a regular pixel, and Y is swapped.)
Definition at line 327 of file KoSvgText.h.
|
inline |
Definition at line 366 of file KoSvgText.h.
| KoSvgText::FontMetrics::FontMetrics | ( | qreal | fontSizeInPt, |
| bool | isHorizontal ) |
Definition at line 1399 of file KoSvgText.cpp.
References alphabeticBaseline, ascender, capHeight, caretOffset, caretRise, caretRun, descender, fontSize, hangingBaseline, ideographicAdvance, ideographicCenterBaseline, ideographicFaceOverBaseline, ideographicFaceUnderBaseline, ideographicOverBaseline, ideographicUnderBaseline, lineThroughOffset, mathematicalBaseline, spaceAdvance, subScriptOffset, superScriptOffset, xHeight, and zeroAdvance.
Definition at line 1605 of file KoSvgText.cpp.
References alphabeticBaseline, ascender, descender, hangingBaseline, ideographicCenterBaseline, ideographicFaceOverBaseline, ideographicFaceUnderBaseline, ideographicOverBaseline, ideographicUnderBaseline, mathematicalBaseline, and valueForBaselineValue().
| bool KoSvgText::FontMetrics::operator== | ( | const FontMetrics & | other | ) | const |
Definition at line 1455 of file KoSvgText.cpp.
References alphabeticBaseline, ascender, capHeight, caretOffset, caretRise, caretRun, descender, fontSize, hangingBaseline, ideographicAdvance, ideographicCenterBaseline, ideographicFaceOverBaseline, ideographicFaceUnderBaseline, ideographicOverBaseline, ideographicUnderBaseline, isVertical, lineGap, lineThroughOffset, lineThroughThickness, mathematicalBaseline, spaceAdvance, subScriptOffset, superScriptOffset, underlineOffset, underlineThickness, xHeight, and zeroAdvance.
| void KoSvgText::FontMetrics::scaleBaselines | ( | const qreal | multiplier | ) |
Definition at line 1574 of file KoSvgText.cpp.
References alphabeticBaseline, ascender, capHeight, descender, fontSize, hangingBaseline, ideographicAdvance, ideographicCenterBaseline, ideographicFaceOverBaseline, ideographicFaceUnderBaseline, ideographicOverBaseline, ideographicUnderBaseline, lineGap, lineThroughOffset, lineThroughThickness, mathematicalBaseline, spaceAdvance, subScriptOffset, superScriptOffset, underlineOffset, underlineThickness, xHeight, and zeroAdvance.
| void KoSvgText::FontMetrics::setBaselineValueByTag | ( | const QString & | tag, |
| int32_t | value ) |
Definition at line 1518 of file KoSvgText.cpp.
References alphabeticBaseline, hangingBaseline, ideographicCenterBaseline, ideographicFaceOverBaseline, ideographicFaceUnderBaseline, ideographicOverBaseline, ideographicUnderBaseline, mathematicalBaseline, and value().
| void KoSvgText::FontMetrics::setMetricsValueByTag | ( | const QLatin1String & | tag, |
| int32_t | value ) |
Definition at line 1538 of file KoSvgText.cpp.
References capHeight, caretOffset, caretRise, caretRun, lineThroughOffset, lineThroughThickness, subScriptOffset, superScriptOffset, underlineOffset, underlineThickness, value(), and xHeight.
| int KoSvgText::FontMetrics::valueForBaselineValue | ( | Baseline | baseline | ) | const |
Definition at line 1485 of file KoSvgText.cpp.
References alphabeticBaseline, ascender, KoSvgText::BaselineAlphabetic, KoSvgText::BaselineCentral, KoSvgText::BaselineHanging, KoSvgText::BaselineIdeographic, KoSvgText::BaselineMathematical, KoSvgText::BaselineMiddle, KoSvgText::BaselineTextBottom, KoSvgText::BaselineTextTop, descender, hangingBaseline, ideographicCenterBaseline, ideographicUnderBaseline, isVertical, mathematicalBaseline, and xHeight.
| qint32 KoSvgText::FontMetrics::alphabeticBaseline |
location of alphabetic baseline from origin.
Definition at line 343 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ascender |
distance from origin to top.
Definition at line 339 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::capHeight |
Height of capital letters, defaults to ascender.
Definition at line 335 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::caretOffset |
Definition at line 364 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::caretRise |
Definition at line 363 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::caretRun |
These are only used to determine the caret slant proportion.
Definition at line 362 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::descender |
distance for origin to bottom.
Definition at line 340 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::fontSize |
Currently set size, CSS unit 'em'.
Definition at line 329 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::hangingBaseline |
location of the hanging baseline used in north brahmic scripts.
Definition at line 354 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicAdvance |
Advance of the character '水' (U+6C34), CSS Unit ic, defaults to 1 em.
Definition at line 332 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicCenterBaseline |
default baseline for vertical, centered between over and under.
location of ideographic center baseline from origin,
Definition at line 347 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicFaceOverBaseline |
location of ideographic face over baseline, that is, the top of the glyphs.
Definition at line 352 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicFaceUnderBaseline |
location of ideographic face under baseline, that is, the bottom of the glyphs.
Definition at line 351 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicOverBaseline |
location of ideographic over baseline from origin.
Definition at line 349 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::ideographicUnderBaseline |
location of ideographic under baseline from origin, may fall back to descender.
Definition at line 346 of file KoSvgText.h.
| bool KoSvgText::FontMetrics::isVertical = false |
Different fontMetrics count between vertical and horizontal.
Definition at line 328 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::lineGap |
additional linegap between consecutive lines.
Definition at line 341 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::lineThroughOffset |
offset of strike-through from alphabetic baseline.
Definition at line 358 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::lineThroughThickness |
strikethrough thickness, from font.
Definition at line 359 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::mathematicalBaseline |
location of mathematical baseline from origin.
Definition at line 344 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::spaceAdvance |
Advance of the character ' ', used by tabs.
Definition at line 331 of file KoSvgText.h.
| QPair<qint32, qint32> KoSvgText::FontMetrics::subScriptOffset |
subscript baseline height, defaults to 1/5th em below alphabetic.
Definition at line 336 of file KoSvgText.h.
| QPair<qint32, qint32> KoSvgText::FontMetrics::superScriptOffset |
superscript baseline height, defaults to 2/3rd above alphabetic.
Definition at line 337 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::underlineOffset |
underline offset from alphabetic, positive.
Definition at line 356 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::underlineThickness |
underline thickness from font.
Definition at line 357 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::xHeight |
height of X, defaults to 0.5 fontsize.
Definition at line 334 of file KoSvgText.h.
| qint32 KoSvgText::FontMetrics::zeroAdvance |
Advance of the character '0', CSS Unit 'ch', defaults to 0.5 em in horizontal and 1.0 em in vertical.
Definition at line 330 of file KoSvgText.h.