38 return KiROUND( aTextSize / 5.0 );
44 return KiROUND( aTextSize / 6 );
62 return KiROUND( aTextSize / 8.0 );
74 double scale = aStrict ? 0.18 : 0.25;
77 return std::min( aPenSize, maxWidth );
83 double scale = aStrict ? 0.18 : 0.25;
84 float maxWidth = (float) aSize *
scale;
86 return std::min( aPenSize, maxWidth );
99 int aThickness,
bool aBold,
bool aItalic,
const KIFONT::METRICS& aFontMetrics )
112 int aWidth,
bool aItalic,
bool aBold,
KIFONT::FONT* aFont,
116 bool fill_mode =
true;
140 GRLine( aDC, aPt1, aPt2, aWidth, aColor );
142 GRCSegm( aDC, aPt1, aPt2, aWidth, aColor );
147 GRClosedPoly( aDC, aPoly.PointCount(), aPoly.CPoints().data(),
true, aColor );
152 attributes.m_StrokeWidth = aWidth;
153 attributes.m_Italic = aItalic;
154 attributes.m_Bold = aBold;
155 attributes.m_Halign = aH_justify;
156 attributes.m_Valign = aV_justify;
157 attributes.m_Size = aSize;
159 aFont->
Draw( &callback_gal, aText, aPos, attributes, aFontMetrics );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
void Draw(KIGFX::GAL *aGal, const wxString &aText, const VECTOR2I &aPosition, const VECTOR2I &aCursor, const TEXT_ATTRIBUTES &aAttributes, const METRICS &aFontMetrics) const
Draw a string.
VECTOR2I StringBoundaryLimits(const wxString &aText, const VECTOR2I &aSize, int aThickness, bool aBold, bool aItalic, const METRICS &aFontMetrics) const
Compute the boundary limits of aText (the bounding box of all shapes).
A color representation with 4 components: red, green, blue, alpha.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void GRCSegm(wxDC *DC, const VECTOR2I &A, const VECTOR2I &B, int width, const COLOR4D &Color)
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
void GRClosedPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, const COLOR4D &Color)
Draw a closed polyline and fill it if Fill, in object space.
int GetPenSizeForBold(int aTextSize)
int GetPenSizeForDemiBold(int aTextSize)
int GetPenSizeForNormal(int aTextSize)
int GRTextWidth(const wxString &aText, KIFONT::FONT *aFont, const VECTOR2I &aSize, int aThickness, bool aBold, bool aItalic, const KIFONT::METRICS &aFontMetrics)
void GRPrintText(wxDC *aDC, const VECTOR2I &aPos, const COLOR4D &aColor, const wxString &aText, const EDA_ANGLE &aOrient, const VECTOR2I &aSize, enum GR_TEXT_H_ALIGN_T aH_justify, enum GR_TEXT_V_ALIGN_T aV_justify, int aWidth, bool aItalic, bool aBold, KIFONT::FONT *aFont, const KIFONT::METRICS &aFontMetrics)
Print a graphic text through wxDC.
int ClampTextPenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.