42 return KiROUND( aTextSize / 5.0 );
48 return KiROUND( aTextSize / 6 );
66 return KiROUND( aTextSize / 8.0 );
89 double scale = aStrict ? 0.18 : 0.25;
92 return std::min( aPenSize, maxWidth );
98 double scale = aStrict ? 0.18 : 0.25;
99 float maxWidth = (float) aSize *
scale;
101 return std::min( aPenSize, maxWidth );
114 int aThickness,
bool aBold,
bool aItalic,
const KIFONT::METRICS& aFontMetrics )
145 int aWidth,
bool aItalic,
bool aBold,
KIFONT::FONT* aFont,
149 bool fill_mode =
true;
173 GRLine( aDC, aPt1, aPt2, aWidth, aColor );
175 GRCSegm( aDC, aPt1, aPt2, aWidth, aColor );
180 GRClosedPoly( aDC, aPoly.PointCount(), aPoly.CPoints().data(),
true, aColor );
185 attributes.m_StrokeWidth = aWidth;
186 attributes.m_Italic = aItalic;
187 attributes.m_Bold = aBold;
188 attributes.m_Halign = aH_justify;
189 attributes.m_Valign = aV_justify;
190 attributes.m_Size = aSize;
192 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)
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aStrict)
Pen width should not allow characters to become cluttered up in their own fatness.
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.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)