LibrePCB Developers Documentation
StrokeFont Class Referencefinal

The StrokeFont class. More...

#include <strokefont.h>

Inherits QObject.

+ Collaboration diagram for StrokeFont:

Public Member Functions

 StrokeFont (const FilePath &fontFilePath, const QByteArray &content) noexcept
 
 StrokeFont (const StrokeFont &other)=delete
 
 ~StrokeFont () noexcept
 
Ratio getLetterSpacing () const noexcept
 
Ratio getLineSpacing () const noexcept
 
QVector< Pathstroke (const QString &text, const PositiveLength &height, const Length &letterSpacing, const Length &lineSpacing, const Alignment &align, Point &bottomLeft, Point &topRight) const noexcept
 
QVector< QPair< QVector< Path >, Length > > strokeLines (const QString &text, const PositiveLength &height, const Length &letterSpacing, Length &width) const noexcept
 
QVector< PathstrokeLine (const QString &text, const PositiveLength &height, const Length &letterSpacing, Length &width) const noexcept
 
QVector< PathstrokeGlyph (const QChar &glyph, const PositiveLength &height, Length &spacing) const noexcept
 
StrokeFontoperator= (const StrokeFont &rhs)=delete
 

Private Member Functions

void fontLoaded () noexcept
 
const fontobene::GlyphListAccessor & accessor () const noexcept
 
Length convertLength (const PositiveLength &height, qreal length) const noexcept
 

Static Private Member Functions

static QVector< Pathpolylines2paths (const QVector< fontobene::Polyline > &polylines, const PositiveLength &height) noexcept
 
static Path polyline2path (const fontobene::Polyline &p, const PositiveLength &height) noexcept
 
static Vertex convertVertex (const fontobene::Vertex &v, const PositiveLength &height) noexcept
 
static void computeBoundingRect (const QVector< Path > &paths, Point &bottomLeft, Point &topRight) noexcept
 

Private Attributes

FilePath mFilePath
 
QFuture< std::shared_ptr< fontobene::Font > > mFuture
 
QFutureWatcher< std::shared_ptr< fontobene::Font > > mWatcher
 
std::shared_ptr< fontobene::Font > mFont
 
QScopedPointer< fontobene::GlyphListCache > mGlyphListCache
 
QScopedPointer< fontobene::GlyphListAccessor > mGlyphListAccessor
 

Detailed Description

The StrokeFont class.

Constructor & Destructor Documentation

◆ StrokeFont() [1/2]

StrokeFont ( const FilePath fontFilePath,
const QByteArray &  content 
)
noexcept
+ Here is the call graph for this function:

◆ StrokeFont() [2/2]

StrokeFont ( const StrokeFont other)
delete

◆ ~StrokeFont()

~StrokeFont ( )
noexcept

Member Function Documentation

◆ getLetterSpacing()

Ratio getLetterSpacing ( ) const
noexcept
+ Here is the call graph for this function:

◆ getLineSpacing()

Ratio getLineSpacing ( ) const
noexcept
+ Here is the call graph for this function:

◆ stroke()

QVector< Path > stroke ( const QString &  text,
const PositiveLength height,
const Length letterSpacing,
const Length lineSpacing,
const Alignment align,
Point bottomLeft,
Point topRight 
) const
noexcept
+ Here is the call graph for this function:

◆ strokeLines()

QVector< QPair< QVector< Path >, Length > > strokeLines ( const QString &  text,
const PositiveLength height,
const Length letterSpacing,
Length width 
) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strokeLine()

QVector< Path > strokeLine ( const QString &  text,
const PositiveLength height,
const Length letterSpacing,
Length width 
) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strokeGlyph()

QVector< Path > strokeGlyph ( const QChar &  glyph,
const PositiveLength height,
Length spacing 
) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

StrokeFont& operator= ( const StrokeFont rhs)
delete

◆ fontLoaded()

void fontLoaded ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accessor()

const fb::GlyphListAccessor & accessor ( ) const
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ polylines2paths()

QVector< Path > polylines2paths ( const QVector< fontobene::Polyline > &  polylines,
const PositiveLength height 
)
staticprivatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ polyline2path()

Path polyline2path ( const fontobene::Polyline &  p,
const PositiveLength height 
)
staticprivatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertVertex()

Vertex convertVertex ( const fontobene::Vertex &  v,
const PositiveLength height 
)
staticprivatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertLength()

Length convertLength ( const PositiveLength height,
qreal  length 
) const
privatenoexcept
+ Here is the caller graph for this function:

◆ computeBoundingRect()

void computeBoundingRect ( const QVector< Path > &  paths,
Point bottomLeft,
Point topRight 
)
staticprivatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mFilePath

FilePath mFilePath
private

◆ mFuture

QFuture<std::shared_ptr<fontobene::Font> > mFuture
private

◆ mWatcher

QFutureWatcher<std::shared_ptr<fontobene::Font> > mWatcher
private

◆ mFont

std::shared_ptr<fontobene::Font> mFont
mutableprivate

◆ mGlyphListCache

QScopedPointer<fontobene::GlyphListCache> mGlyphListCache
mutableprivate

◆ mGlyphListAccessor

QScopedPointer<fontobene::GlyphListAccessor> mGlyphListAccessor
mutableprivate

The documentation for this class was generated from the following files: