Loading common/gal/graphics_abstraction_layer.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -28,12 +28,12 @@ #include <gal/graphics_abstraction_layer.h> #include <gal/definitions.h> #include <gal/color4d.h> using namespace KiGfx; GAL::GAL() GAL::GAL() : strokeFont( this ) { // Set the default values for the internal variables SetIsFill( false ); Loading @@ -47,6 +47,8 @@ GAL::GAL() SetCoarseGrid( 5 ); SetLineWidth( 1.0 ); SetDepthRange( VECTOR2D( -2048, 2047 ) ); strokeFont.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); } Loading Loading @@ -156,3 +158,13 @@ void GAL::DrawGrid() SetStrokeColor( savedColor ); } void GAL::SetTextAttributes( const EDA_TEXT* aText ) { strokeFont.SetGlyphSize( VECTOR2D( aText->GetSize() ) ); strokeFont.SetHorizontalJustify( aText->GetHorizJustify() ); strokeFont.SetVerticalJustify( aText->GetVertJustify() ); strokeFont.SetBold( aText->IsBold() ); strokeFont.SetItalic( aText->IsItalic() ); strokeFont.SetMirrored( aText->IsMirrored() ); } common/gal/stroke_font.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -114,17 +114,6 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe } void STROKE_FONT::LoadAttributes( const EDA_TEXT* aText ) { SetGlyphSize( VECTOR2D( aText->GetSize() ) ); SetHorizontalJustify( aText->GetHorizJustify() ); SetVerticalJustify( aText->GetVertJustify() ); SetBold( aText->IsBold() ); SetItalic( aText->IsItalic() ); SetMirrored( aText->IsMirrored() ); } BOX2D STROKE_FONT::computeBoundingBox( const Glyph& aGlyph, const VECTOR2D& aGlyphBoundingX ) const { BOX2D boundingBox; Loading common/painter.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ */ #include <painter.h> #include <gal/stroke_font.h> #include <newstroke_font.h> using namespace KiGfx; Loading Loading @@ -70,14 +68,11 @@ void RENDER_SETTINGS::Update() PAINTER::PAINTER( GAL* aGal ) : m_gal( aGal ), m_settings( NULL ) { m_stroke_font = new STROKE_FONT( aGal ); m_stroke_font->LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); } PAINTER::~PAINTER() { delete m_stroke_font; delete m_settings; } Loading @@ -85,5 +80,4 @@ PAINTER::~PAINTER() void PAINTER::SetGAL( GAL* aGal ) { m_gal = aGal; m_stroke_font->SetGAL( aGal ); } include/gal/graphics_abstraction_layer.h +29 −1 Original line number Diff line number Diff line Loading @@ -33,8 +33,10 @@ #include <wx/event.h> #include <math/matrix3x3.h> #include <gal/color4d.h> #include <gal/color4d.h> #include <gal/stroke_font.h> #include <newstroke_font.h> namespace KiGfx { Loading Loading @@ -260,6 +262,29 @@ public: layerDepth = aLayerDepth; } // ---- // Text // ---- /** * @brief Draws a vector type text using preloaded Newstroke font. * * @param aText is the text to be drawn. * @param aPosition is the text position in world coordinates. * @param aRotationAngle is the text rotation angle. */ inline virtual void StrokeText( const std::string& aText, const VECTOR2D& aPosition, double aRotationAngle ) { strokeFont.Draw( aText, aPosition, aRotationAngle ); } /** * @brief Loads attributes of the given text (bold/italic/underline/mirrored and so on). * * @param aText is the text item. */ virtual void SetTextAttributes( const EDA_TEXT* aText ); // -------------- // Transformation // -------------- Loading Loading @@ -696,6 +721,9 @@ protected: VECTOR2D cursorPosition; ///< The cursor position COLOR4D cursorColor; ///< Cursor color /// Instance of object that stores information about how to draw texts STROKE_FONT strokeFont; /// Compute the scaling factor for the world->screen matrix inline void ComputeWorldScale() { Loading include/gal/stroke_font.h +0 −7 Original line number Diff line number Diff line Loading @@ -66,13 +66,6 @@ public: */ bool LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNewStrokeFontSize ); /** * @brief Load attributes of a given text, in order to be used during drawing. * * @param aText is the text string. */ void LoadAttributes( const EDA_TEXT* aText ); /** * @brief Draw a string. * Loading Loading
common/gal/graphics_abstraction_layer.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -28,12 +28,12 @@ #include <gal/graphics_abstraction_layer.h> #include <gal/definitions.h> #include <gal/color4d.h> using namespace KiGfx; GAL::GAL() GAL::GAL() : strokeFont( this ) { // Set the default values for the internal variables SetIsFill( false ); Loading @@ -47,6 +47,8 @@ GAL::GAL() SetCoarseGrid( 5 ); SetLineWidth( 1.0 ); SetDepthRange( VECTOR2D( -2048, 2047 ) ); strokeFont.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); } Loading Loading @@ -156,3 +158,13 @@ void GAL::DrawGrid() SetStrokeColor( savedColor ); } void GAL::SetTextAttributes( const EDA_TEXT* aText ) { strokeFont.SetGlyphSize( VECTOR2D( aText->GetSize() ) ); strokeFont.SetHorizontalJustify( aText->GetHorizJustify() ); strokeFont.SetVerticalJustify( aText->GetVertJustify() ); strokeFont.SetBold( aText->IsBold() ); strokeFont.SetItalic( aText->IsItalic() ); strokeFont.SetMirrored( aText->IsMirrored() ); }
common/gal/stroke_font.cpp +0 −11 Original line number Diff line number Diff line Loading @@ -114,17 +114,6 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe } void STROKE_FONT::LoadAttributes( const EDA_TEXT* aText ) { SetGlyphSize( VECTOR2D( aText->GetSize() ) ); SetHorizontalJustify( aText->GetHorizJustify() ); SetVerticalJustify( aText->GetVertJustify() ); SetBold( aText->IsBold() ); SetItalic( aText->IsItalic() ); SetMirrored( aText->IsMirrored() ); } BOX2D STROKE_FONT::computeBoundingBox( const Glyph& aGlyph, const VECTOR2D& aGlyphBoundingX ) const { BOX2D boundingBox; Loading
common/painter.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ */ #include <painter.h> #include <gal/stroke_font.h> #include <newstroke_font.h> using namespace KiGfx; Loading Loading @@ -70,14 +68,11 @@ void RENDER_SETTINGS::Update() PAINTER::PAINTER( GAL* aGal ) : m_gal( aGal ), m_settings( NULL ) { m_stroke_font = new STROKE_FONT( aGal ); m_stroke_font->LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ); } PAINTER::~PAINTER() { delete m_stroke_font; delete m_settings; } Loading @@ -85,5 +80,4 @@ PAINTER::~PAINTER() void PAINTER::SetGAL( GAL* aGal ) { m_gal = aGal; m_stroke_font->SetGAL( aGal ); }
include/gal/graphics_abstraction_layer.h +29 −1 Original line number Diff line number Diff line Loading @@ -33,8 +33,10 @@ #include <wx/event.h> #include <math/matrix3x3.h> #include <gal/color4d.h> #include <gal/color4d.h> #include <gal/stroke_font.h> #include <newstroke_font.h> namespace KiGfx { Loading Loading @@ -260,6 +262,29 @@ public: layerDepth = aLayerDepth; } // ---- // Text // ---- /** * @brief Draws a vector type text using preloaded Newstroke font. * * @param aText is the text to be drawn. * @param aPosition is the text position in world coordinates. * @param aRotationAngle is the text rotation angle. */ inline virtual void StrokeText( const std::string& aText, const VECTOR2D& aPosition, double aRotationAngle ) { strokeFont.Draw( aText, aPosition, aRotationAngle ); } /** * @brief Loads attributes of the given text (bold/italic/underline/mirrored and so on). * * @param aText is the text item. */ virtual void SetTextAttributes( const EDA_TEXT* aText ); // -------------- // Transformation // -------------- Loading Loading @@ -696,6 +721,9 @@ protected: VECTOR2D cursorPosition; ///< The cursor position COLOR4D cursorColor; ///< Cursor color /// Instance of object that stores information about how to draw texts STROKE_FONT strokeFont; /// Compute the scaling factor for the world->screen matrix inline void ComputeWorldScale() { Loading
include/gal/stroke_font.h +0 −7 Original line number Diff line number Diff line Loading @@ -66,13 +66,6 @@ public: */ bool LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNewStrokeFontSize ); /** * @brief Load attributes of a given text, in order to be used during drawing. * * @param aText is the text string. */ void LoadAttributes( const EDA_TEXT* aText ); /** * @brief Draw a string. * Loading