LibrePCB Developers Documentation
|
Extract overlines of text with markup. More...
#include <overlinemarkupparser.h>
Public Member Functions | |
OverlineMarkupParser ()=delete | |
OverlineMarkupParser (const OverlineMarkupParser &other)=delete | |
OverlineMarkupParser & | operator= (const OverlineMarkupParser &rhs)=delete |
Static Public Member Functions | |
static QVector< std::pair< int, int > > | extract (const QString &input, QString &output) noexcept |
static QVector< QLineF > | calculate (const QString &text, const QFontMetricsF &fm, int flags, const QVector< std::pair< int, int > > &spans, QRectF &boundingRect) noexcept |
static void | process (const QString &input, const QFontMetricsF &fm, int flags, QString &output, QVector< QLineF > &overlines, QRectF &boundingRect) noexcept |
static qreal | getLineWidth (qreal heightPx) noexcept |
Extract overlines of text with markup.
Parses text like RST/!SHDN
, removes the functional !
and returns the coordinates where to draw overlines instead.
Markup rules:
!
toggles the overline on/off, depending on its previous state (initial state is off)./
implicitly switches off the overline before rendering. This can be prevented by prefixing it with !
.!!
has no effect on overlines, they are rendered as a single !
. In case of an odd number of !
(e.g. !!!
), the last one toggles overline on/off.!
have no effect, they are rendered as-is (bypassing rules 1 and 3).
|
delete |
|
delete |
|
staticnoexcept |
|
staticnoexcept |
|
staticnoexcept |
|
staticnoexcept |
|
delete |