RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDKit::MolDraw2D_detail::DrawTextFT Class Referenceabstract

#include <DrawTextFT.h>

Inheritance diagram for RDKit::MolDraw2D_detail::DrawTextFT:
RDKit::MolDraw2D_detail::DrawText RDKit::MolDraw2D_detail::DrawTextFTCairo RDKit::MolDraw2D_detail::DrawTextFTJS RDKit::MolDraw2D_detail::DrawTextFTQt RDKit::MolDraw2D_detail::DrawTextFTSVG

Public Member Functions

virtual ~DrawTextFT () override
 
virtual int MoveToFunctionImpl (const FT_Vector *to)=0
 
virtual int LineToFunctionImpl (const FT_Vector *to)=0
 
virtual int ConicToFunctionImpl (const FT_Vector *control, const FT_Vector *to)=0
 
virtual int CubicToFunctionImpl (const FT_Vector *controlOne, const FT_Vector *controlTwo, const FT_Vector *to)=0
 
 DrawTextFT (double max_fnt_sz, double min_fnt_sz, const std::string &font_file)
 
 DrawTextFT (const DrawTextFT &)=delete
 
 DrawTextFT (DrawTextFT &&)=delete
 
DrawTextFToperator= (const DrawTextFT &)=delete
 
DrawTextFToperator= (DrawTextFT &&)=delete
 
void drawChar (char c, const Point2D &cds) override
 
std::string getFontFile () const override
 
void setFontFile (const std::string &font_file) override
 
double fontCoordToDrawCoord (FT_Pos fc) const
 
void fontPosToDrawPos (FT_Pos fx, FT_Pos fy, double &dx, double &dy) const
 
virtual double extractOutline ()
 
void getStringRects (const std::string &text, std::vector< std::shared_ptr< StringRect > > &rects, std::vector< TextDrawType > &draw_modes, std::vector< char > &draw_chars) const override
 
void calcGlyphBBox (char c, FT_Pos &x_min, FT_Pos &y_min, FT_Pos &x_max, FT_Pos &y_max, FT_Pos &advance) const
 
- Public Member Functions inherited from RDKit::MolDraw2D_detail::DrawText
virtual ~DrawText ()=0
 
 DrawText (double max_fnt_sz, double min_fnt_sz)
 
 DrawText (const DrawText &)=delete
 
 DrawText (DrawText &&)=delete
 
DrawTextoperator= (const DrawText &)=delete
 
DrawTextoperator= (DrawText &&)=delete
 
DrawColour constcolour () const
 
void setColour (const DrawColour &col)
 
double fontSize () const
 
void setFontSize (double new_size)
 
double baseFontSize () const
 
void setBaseFontSize (double new_size)
 
double maxFontSize () const
 
void setMaxFontSize (double new_max)
 
double minFontSize () const
 
void setMinFontSize (double new_max)
 
double fontScale () const
 
bool setFontScale (double new_scale, bool ignoreLimits=false)
 
virtual void getStringSize (const std::string &label, double &label_width, double &label_height) const
 using the current scale, work out the size of the label
 
void getStringExtremes (const std::string &label, OrientType orient, double &x_min, double &y_min, double &x_max, double &y_max, bool dontSplit=false) const
 
void getStringRects (const std::string &text, OrientType orient, std::vector< std::shared_ptr< StringRect > > &rects, std::vector< TextDrawType > &draw_modes, std::vector< char > &draw_chars, bool dontSplit=false, TextAlignType textAlign=TextAlignType::MIDDLE) const
 
virtual void drawString (const std::string &str, const Point2D &cds, TextAlignType align)
 drawString centres the string on cds.
 
void drawString (const std::string &label, const Point2D &cds, OrientType orient)
 
void adjustLineForString (const std::string &label, OrientType orient, const Point2D &end1, Point2D &end2) const
 
void drawStringRects (const std::string &label, OrientType orient, TextAlignType talign, const Point2D &cds, MolDraw2D &mol_draw) const
 
bool doesRectIntersect (const std::string &label, OrientType orient, const Point2D &cds, const StringRect &rect) const
 
bool doesRectIntersect (const std::vector< std::shared_ptr< StringRect > > &rects, const Point2D &cds, const StringRect &rect) const
 
bool doesLineIntersect (const std::string &label, OrientType orient, const Point2D &cds, const Point2D &end1, const Point2D &end2, double padding) const
 
bool doesLineIntersect (const std::vector< std::shared_ptr< StringRect > > &rects, const Point2D &cds, const Point2D &end1, const Point2D &end2, double padding) const
 
bool doesStringIntersect (const std::vector< std::shared_ptr< StringRect > > &rects, const Point2D &cds1, const std::string &label2, OrientType orient2, const Point2D &cds2) const
 
bool doesStringIntersect (const std::string &label1, OrientType orient1, const Point2D &cds1, const std::string &label2, OrientType orient2, const Point2D &cds2) const
 
virtual void alignString (TextAlignType align, const std::vector< TextDrawType > &draw_modes, std::vector< std::shared_ptr< StringRect > > &rects) const
 
void adjustStringRectsForSuperSubScript (const std::vector< TextDrawType > &draw_modes, std::vector< std::shared_ptr< StringRect > > &rects) const
 
double selectScaleFactor (char c, TextDrawType draw_type) const
 
void drawChars (const Point2D &a_cds, const std::vector< std::shared_ptr< StringRect > > &rects, const std::vector< TextDrawType > &draw_modes, const std::vector< char > &draw_chars)
 

Public Attributes

FT_Library library_
 
FT_Face face_
 
std::string font_file_
 
double x_trans_
 
double y_trans_
 
FT_Pos string_y_max_
 
double em_scale_
 
- Public Attributes inherited from RDKit::MolDraw2D_detail::DrawText
DrawColour colour_
 
double font_scale_
 
double max_font_size_
 
double min_font_size_
 
double base_font_size_ = DEFAULT_FONT_SCALE
 

Additional Inherited Members

- Static Public Attributes inherited from RDKit::MolDraw2D_detail::DrawText
static constexpr double DEFAULT_FONT_SCALE
 
static constexpr double SUBS_SCALE = 0.66
 
static constexpr double SUPER_SCALE = 0.66
 

Detailed Description

Definition at line 36 of file DrawTextFT.h.

Constructor & Destructor Documentation

◆ ~DrawTextFT()

virtual RDKit::MolDraw2D_detail::DrawTextFT::~DrawTextFT ( )
overridevirtual

◆ DrawTextFT() [1/3]

RDKit::MolDraw2D_detail::DrawTextFT::DrawTextFT ( double  max_fnt_sz,
double  min_fnt_sz,
const std::string &  font_file 
)

◆ DrawTextFT() [2/3]

RDKit::MolDraw2D_detail::DrawTextFT::DrawTextFT ( const DrawTextFT )
delete

◆ DrawTextFT() [3/3]

RDKit::MolDraw2D_detail::DrawTextFT::DrawTextFT ( DrawTextFT &&  )
delete

Member Function Documentation

◆ calcGlyphBBox()

void RDKit::MolDraw2D_detail::DrawTextFT::calcGlyphBBox ( char  c,
FT_Pos x_min,
FT_Pos y_min,
FT_Pos x_max,
FT_Pos y_max,
FT_Pos advance 
) const

◆ ConicToFunctionImpl()

virtual int RDKit::MolDraw2D_detail::DrawTextFT::ConicToFunctionImpl ( const FT_Vector control,
const FT_Vector to 
)
pure virtual

◆ CubicToFunctionImpl()

virtual int RDKit::MolDraw2D_detail::DrawTextFT::CubicToFunctionImpl ( const FT_Vector controlOne,
const FT_Vector controlTwo,
const FT_Vector to 
)
pure virtual

◆ drawChar()

void RDKit::MolDraw2D_detail::DrawTextFT::drawChar ( char  c,
const Point2D cds 
)
overridevirtual

◆ extractOutline()

◆ fontCoordToDrawCoord()

double RDKit::MolDraw2D_detail::DrawTextFT::fontCoordToDrawCoord ( FT_Pos  fc) const

◆ fontPosToDrawPos()

void RDKit::MolDraw2D_detail::DrawTextFT::fontPosToDrawPos ( FT_Pos  fx,
FT_Pos  fy,
double dx,
double dy 
) const

◆ getFontFile()

std::string RDKit::MolDraw2D_detail::DrawTextFT::getFontFile ( ) const
overridevirtual

Reimplemented from RDKit::MolDraw2D_detail::DrawText.

◆ getStringRects()

void RDKit::MolDraw2D_detail::DrawTextFT::getStringRects ( const std::string &  text,
std::vector< std::shared_ptr< StringRect > > &  rects,
std::vector< TextDrawType > &  draw_modes,
std::vector< char > &  draw_chars 
) const
overridevirtual

◆ LineToFunctionImpl()

◆ MoveToFunctionImpl()

◆ operator=() [1/2]

DrawTextFT & RDKit::MolDraw2D_detail::DrawTextFT::operator= ( const DrawTextFT )
delete

◆ operator=() [2/2]

DrawTextFT & RDKit::MolDraw2D_detail::DrawTextFT::operator= ( DrawTextFT &&  )
delete

◆ setFontFile()

void RDKit::MolDraw2D_detail::DrawTextFT::setFontFile ( const std::string &  font_file)
overridevirtual

Reimplemented from RDKit::MolDraw2D_detail::DrawText.

Member Data Documentation

◆ em_scale_

double RDKit::MolDraw2D_detail::DrawTextFT::em_scale_

Definition at line 72 of file DrawTextFT.h.

◆ face_

FT_Face RDKit::MolDraw2D_detail::DrawTextFT::face_

Definition at line 67 of file DrawTextFT.h.

◆ font_file_

std::string RDKit::MolDraw2D_detail::DrawTextFT::font_file_

Definition at line 68 of file DrawTextFT.h.

◆ library_

FT_Library RDKit::MolDraw2D_detail::DrawTextFT::library_

Definition at line 66 of file DrawTextFT.h.

◆ string_y_max_

FT_Pos RDKit::MolDraw2D_detail::DrawTextFT::string_y_max_
mutable

Definition at line 71 of file DrawTextFT.h.

◆ x_trans_

double RDKit::MolDraw2D_detail::DrawTextFT::x_trans_

Definition at line 69 of file DrawTextFT.h.

◆ y_trans_

double RDKit::MolDraw2D_detail::DrawTextFT::y_trans_

Definition at line 69 of file DrawTextFT.h.


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