Commit 5759f734 authored by charras's avatar charras
Browse files

Rework on TEXTE_PCB, SCH_TEXT and EDA_TextStruct classes.

Code seriously cleaned, obscure and duplicated code removed, and some oddities removed.
Better support of multiline texts.
parent 804e5397
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,17 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2009-may-12 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++All:
    Rework on TEXTE_PCB, SCH_TEXT and EDA_TextStruct classes.
    Code seriously cleaned, obscure and duplicated code removed,
    and some oddities removed ( like different .m_Orient values in eeschema and
    pcbnew, for the same text orientation )
    Multiline texts (in comments and Pcb texts) are now supported.
    In pcbnew text justifications could work (but not yet used and tested)


2009-may-01 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
2009-may-01 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
================================================================================
++pcbnew:
++pcbnew:
+3 −3
Original line number Original line Diff line number Diff line
@@ -254,8 +254,8 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
    rect.SetSize( textsize );
    rect.SetSize( textsize );


    /* Now, calculate the rect origin, according to text justification
    /* Now, calculate the rect origin, according to text justification
     * At this point the area origin is the text origin.
     * At this point the area origin is the text origin (m_Pos).
     * This is true only for left and top text justified.
     * This is true only for left and top text justified texts.
     * and must be recalculated for others justifications
     * and must be recalculated for others justifications
     * also, note the V justification is relative to the first line
     * also, note the V justification is relative to the first line
     */
     */
@@ -284,7 +284,7 @@ EDA_Rect EDA_TextStruct::GetTextBox( int aLine )
        break;
        break;


    case GR_TEXT_VJUSTIFY_BOTTOM:
    case GR_TEXT_VJUSTIFY_BOTTOM:
        rect.SetY( rect.GetY() + (dy / 2) );
        rect.SetY( rect.GetY() - dy );
        break;
        break;
    }
    }


+57 −74
Original line number Original line Diff line number Diff line
@@ -20,6 +20,14 @@
#define EDA_DRAWBASE
#define EDA_DRAWBASE
#include "grfonte.h"
#include "grfonte.h"


/* Functions to draw / plot a string.
 *  texts have only one line.
 *  They can be in italic.
 *  Horizontal and Vertical justification are handled.
 *  Texts can be rotated
 *  substrings between ~ markers can be "negated" (i.e. with an over bar
 */

/** Function NegableTextLength
/** Function NegableTextLength
 * Return the text length of a negable string, excluding the ~ markers */
 * Return the text length of a negable string, excluding the ~ markers */
int NegableTextLength( const wxString& aText )
int NegableTextLength( const wxString& aText )
@@ -116,10 +124,9 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
    SH_CODE        f_cod, plume = 'U';
    SH_CODE        f_cod, plume = 'U';
    const SH_CODE* ptcar;
    const SH_CODE* ptcar;
    int            ptr;
    int            ptr;
    int            ux0, uy0, dx, dy;        // Draw coordinate for segments to draw. also used in some other calculation
    int            dx, dy;        // Draw coordinate for segments to draw. also used in some other calculation
    int            cX, cY;                  // Texte center
    wxPoint        current_char_pos;        // Draw coordinates for the current char
    int            ox, oy;                  // Draw coordinates for the current char
    wxPoint        overbar_pos;            // Start point for the current overbar
    int            overbar_x, overbar_y;    // Start point for the current overbar
    int            overbars;                // Number of ~ seen
    int            overbars;                // Number of ~ seen


    #define        BUF_SIZE 100
    #define        BUF_SIZE 100
@@ -156,8 +163,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
    else
    else
        pitch -= thickness;
        pitch -= thickness;


    ox = cX = aPos.x;
    current_char_pos = aPos;
    oy = cY = aPos.y;


    /* Do not draw the text if out of draw area! */
    /* Do not draw the text if out of draw area! */
    if( aPanel )
    if( aPanel )
@@ -166,8 +172,8 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
        int textsize = ABS( pitch );
        int textsize = ABS( pitch );
        ll = aPanel->GetScreen()->Scale( textsize * char_count );
        ll = aPanel->GetScreen()->Scale( textsize * char_count );


        xc = GRMapX( cX );
        xc = GRMapX( current_char_pos.x );
        yc = GRMapY( cY );
        yc = GRMapY( current_char_pos.y );


        x0 = aPanel->m_ClipBox.GetX() - ll;
        x0 = aPanel->m_ClipBox.GetX() - ll;
        y0 = aPanel->m_ClipBox.GetY() - ll;
        y0 = aPanel->m_ClipBox.GetY() - ll;
@@ -185,81 +191,60 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
    }
    }




    /* Compute the position ux0, uy0 of the first letter , next */
    /* Compute the position of the first letter of the text
    dx = (pitch * char_count) / 2;
     * this position is the position of the left bottom point of the letter
    dy = size_v / 2;                            /* dx, dy = draw offset between first letter and text center */
     * this is the same as the text position only for a left and bottom justified text

     * In others cases, this position must be calculated from the text position ans size
    ux0 = uy0 = 0;                              /* for ux0 = uy0 = 0, the text is centered */
    */

    dx = pitch * char_count;
    wxPoint offset_org( dx, dy );
    dy = size_v;                            /* dx, dy = draw offset between first letter and text center */
    int     irot = aOrient;
    while( irot >= 1800 )
        irot -= 1800;

    while( irot < 0 )
        irot += 1800;

    if( irot != 0 )
        EXCHG( offset_org.x, offset_org.y );


    switch( aH_justify )
    switch( aH_justify )
    {
    {
    case GR_TEXT_HJUSTIFY_CENTER:
    case GR_TEXT_HJUSTIFY_CENTER:
        current_char_pos.x -= dx / 2;
        break;
        break;


    case GR_TEXT_HJUSTIFY_RIGHT:
    case GR_TEXT_HJUSTIFY_RIGHT:
        ux0 = -offset_org.x;
        current_char_pos.x -= dx;
        break;
        break;


    case GR_TEXT_HJUSTIFY_LEFT:
    case GR_TEXT_HJUSTIFY_LEFT:
        ux0 = offset_org.x;
        break;
        break;
    }
    }


    switch( aV_justify )
    switch( aV_justify )
    {
    {
    case GR_TEXT_VJUSTIFY_CENTER:
    case GR_TEXT_VJUSTIFY_CENTER:
        current_char_pos.y += dy/2;
        break;
        break;


    case GR_TEXT_VJUSTIFY_TOP:
    case GR_TEXT_VJUSTIFY_TOP:
        uy0 = offset_org.y;
        current_char_pos.y += dy;
        break;
        break;


    case GR_TEXT_VJUSTIFY_BOTTOM:
    case GR_TEXT_VJUSTIFY_BOTTOM:
        uy0 = -offset_org.y;
        break;
        break;
    }
    }



    cX += ux0;
    cY += uy0;

    ox = cX - dx;
    oy = cY + dy;

    // Note: if aPanel == NULL, we are using a GL Canvas that handle scaling
    // Note: if aPanel == NULL, we are using a GL Canvas that handle scaling
    if( aPanel && aPanel->GetScreen()->Scale( aSize.x ) == 0 )
    if( aPanel && aPanel->GetScreen()->Scale( aSize.x ) == 0 )
        return;
        return;


    if( aPanel && ABS( ( aPanel->GetScreen()->Scale( aSize.x ) ) ) < 3 )    /* shapes are too small: connot be drawn */
    /* if a text size is too small, the text cannot be drawn, and it is drawn as a single graphic line */
    if( aPanel && ABS( ( aPanel->GetScreen()->Scale( aSize.x ) ) ) < 3 )
    {
    {
        /* insteed the text is drawn as a line */
        /* draw the text as a line always vertically centered */
        dx = (pitch * char_count) / 2;
        wxPoint end( current_char_pos.x + dx, current_char_pos.y);
        dy = size_v / 2;                /* line is always centered */

        ux0 = cX - dx;
        uy0 = cY;

        dx += cX;
        dy  = cY;


        RotatePoint( &ux0, &uy0, cX, cY, aOrient );
        RotatePoint( &current_char_pos, aPos, aOrient );
        RotatePoint( &dx, &dy, cX, cY, aOrient );
        RotatePoint( &end, aPos, aOrient );


        if( aCallback )
        if( aCallback )
            aCallback( ux0, uy0, dx, dy );
            aCallback( current_char_pos.x, current_char_pos.y, end.x, end.y );
        else
        else
            GRLine( &aPanel->m_ClipBox, aDC, ux0, uy0, dx, dy, aWidth, aColor );
            GRLine( &aPanel->m_ClipBox, aDC,
                current_char_pos.x, current_char_pos.y, end.x, end.y , aWidth, aColor );


        return;
        return;
    }
    }
@@ -278,20 +263,18 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
                if( overbars % 2 )
                if( overbars % 2 )
                {
                {
                    /* Starting the overbar */
                    /* Starting the overbar */
                    overbar_x = ox;
                    overbar_pos = current_char_pos;
                    overbar_y = oy - overbar_position( size_v, thickness );
                    overbar_pos.y -= overbar_position( size_v, thickness );
                    RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
                    RotatePoint( &overbar_pos, aPos, aOrient );
                }
                }
                else
                else
                {
                {
                    /* Ending the overbar */
                    /* Ending the overbar */
                    coord[0].x = overbar_x;
                    coord[0] = overbar_pos;
                    coord[0].y = overbar_y;
                    overbar_pos  = current_char_pos;
                    overbar_x  = ox;
                    overbar_pos.y -= overbar_position( size_v, thickness );
                    overbar_y  = oy - overbar_position( size_v, thickness );
                    RotatePoint( &overbar_pos, aPos, aOrient );
                    RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
                    coord[1] = overbar_pos;
                    coord[1].x = overbar_x;
                    coord[1].y = overbar_y;
                    /* Plot the overbar segment */
                    /* Plot the overbar segment */
                    DrawGraphicTextPline( aPanel, aDC, aColor, aWidth,
                    DrawGraphicTextPline( aPanel, aDC, aColor, aWidth,
                                          sketch_mode, 2, coord, aCallback );
                                          sketch_mode, 2, coord, aCallback );
@@ -345,6 +328,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
            default:
            default:
            {
            {
                int y, k1, k2;
                int y, k1, k2;
                wxPoint currpoint;
                y  = k1 = f_cod;        /* trace sur axe V */
                y  = k1 = f_cod;        /* trace sur axe V */
                k1 = -( (k1 * size_v) / 9 );
                k1 = -( (k1 * size_v) / 9 );


@@ -357,11 +341,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
                // To simulate an italic font, add a x offset depending on the y offset
                // To simulate an italic font, add a x offset depending on the y offset
                if( aItalic )
                if( aItalic )
                    k2 -= italic_reverse ? -k1 / 8 : k1 / 8;
                    k2 -= italic_reverse ? -k1 / 8 : k1 / 8;
                dx = k2 + ox; dy = k1 + oy;
                currpoint.x = k2 + current_char_pos.x;
                currpoint.y = k1 + current_char_pos.y;


                RotatePoint( &dx, &dy, cX, cY, aOrient );
                RotatePoint( &currpoint, aPos, aOrient );
                coord[point_count].x = dx;
                coord[point_count] = currpoint;
                coord[point_count].y = dy;
               if( point_count < BUF_SIZE - 1 )
               if( point_count < BUF_SIZE - 1 )
                    point_count++;
                    point_count++;
                break;
                break;
@@ -373,19 +357,18 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,


        /* end draw 1 char */
        /* end draw 1 char */


        ptr++; ox += pitch;
        ptr++;
        current_char_pos.x += pitch;    // current_char_pos is now the next position
    }
    }


    if( overbars % 2 )
    if( overbars % 2 )
    {
    {
        /* Close the last overbar */
        /* Close the last overbar */
        coord[0].x = overbar_x;
        coord[0] = overbar_pos;
        coord[0].y = overbar_y;
        overbar_pos  = current_char_pos;
        overbar_x  = ox;
        overbar_pos.y  -= overbar_position( size_v, thickness );
        overbar_y  = oy - overbar_position( size_v, thickness );
        RotatePoint( &overbar_pos, aPos, aOrient );
        RotatePoint( &overbar_x, &overbar_y, cX, cY, aOrient );
        coord[1] = overbar_pos;
        coord[1].x = overbar_x;
        coord[1].y = overbar_y;
        /* Plot the overbar segment */
        /* Plot the overbar segment */
        DrawGraphicTextPline( aPanel, aDC, aColor, aWidth,
        DrawGraphicTextPline( aPanel, aDC, aColor, aWidth,
                              sketch_mode, 2, coord, aCallback );
                              sketch_mode, 2, coord, aCallback );
+94 −80
Original line number Original line Diff line number Diff line
@@ -545,41 +545,45 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
        else            /* Its a vertical line. */
        else            /* Its a vertical line. */
        {
        {
            // Text is drawn from bottom to top (i.e. to negative value for Y axis)
            // Text is drawn from bottom to top (i.e. to negative value for Y axis)
            if( DrawPinName )
            {
            if( orient == PIN_DOWN )
            if( orient == PIN_DOWN )
            {
            {
                y = y1 + TextInside;
                y = y1 + TextInside;


                if( DrawPinName )
                    DrawGraphicText( panel, DC, wxPoint( x1, y ), NameColor,
                    DrawGraphicText( panel, DC, wxPoint( x1, y ), NameColor,
                                     m_PinName,
                                     m_PinName,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_HJUSTIFY_RIGHT,
                                     GR_TEXT_VJUSTIFY_TOP, LineWidth,
                                     GR_TEXT_VJUSTIFY_CENTER, LineWidth,
                                     false, true );
                                     false, true );
                if( DrawPinNum )
                    DrawGraphicText( panel, DC,
                                     wxPoint( x1 - TXTMARGE,
                                              (y1 + pin_pos.y) / 2 ), NumColor,
                                     StringPinNum,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_VJUSTIFY_BOTTOM, LineWidth );
            }
            }
            else        /* PIN_UP */
            else        /* PIN_UP */
            {
            {
                y = y1 - TextInside;
                y = y1 - TextInside;


                if( DrawPinName )
                    DrawGraphicText( panel, DC, wxPoint( x1, y ), NameColor,
                    DrawGraphicText( panel, DC, wxPoint( x1, y ), NameColor,
                                     m_PinName,
                                     m_PinName,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_HJUSTIFY_LEFT,
                                     GR_TEXT_VJUSTIFY_BOTTOM, LineWidth,
                                     GR_TEXT_VJUSTIFY_CENTER, LineWidth,
                                     false, true );
                                     false, true );
                }
            }

                if( DrawPinNum )
                if( DrawPinNum )
            {
                    DrawGraphicText( panel, DC,
                    DrawGraphicText( panel, DC,
                                     wxPoint( x1 - TXTMARGE,
                                     wxPoint( x1 - TXTMARGE,
                                              (y1 + pin_pos.y) / 2 ), NumColor,
                                              (y1 + pin_pos.y) / 2 ), NumColor,
                                     StringPinNum,
                                     StringPinNum,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                 GR_TEXT_HJUSTIFY_RIGHT,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER, LineWidth );
                                     GR_TEXT_VJUSTIFY_BOTTOM, LineWidth );
            }
            }
        }
        }
    }
    }
@@ -606,7 +610,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
                                                     y1 + TXTMARGE ),
                                                     y1 + TXTMARGE ),
                                 NumColor, StringPinNum,
                                 NumColor, StringPinNum,
                                 TEXT_ORIENT_HORIZ, PinNumSize,
                                 TEXT_ORIENT_HORIZ, PinNumSize,
                                 GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_TOP,
                                 LineWidth );
                                 LineWidth );
            }
            }
        }
        }
@@ -619,8 +624,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
                                                     y ),
                                                     y ),
                                 NameColor, m_PinName,
                                 NameColor, m_PinName,
                                 TEXT_ORIENT_VERT, PinNameSize,
                                 TEXT_ORIENT_VERT, PinNameSize,
                                 GR_TEXT_HJUSTIFY_RIGHT,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER, LineWidth, false, true );
                                 GR_TEXT_VJUSTIFY_BOTTOM, LineWidth, false, true );
            }
            }


            if( DrawPinNum )
            if( DrawPinNum )
@@ -630,8 +635,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
                                          (y1 + pin_pos.y) / 2 ),
                                          (y1 + pin_pos.y) / 2 ),
                                 NumColor, StringPinNum,
                                 NumColor, StringPinNum,
                                 TEXT_ORIENT_VERT, PinNumSize,
                                 TEXT_ORIENT_VERT, PinNumSize,
                                 GR_TEXT_HJUSTIFY_LEFT,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER, LineWidth );
                                 GR_TEXT_VJUSTIFY_TOP, LineWidth );
            }
            }
        }
        }
    }
    }
@@ -717,6 +722,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                else    // orient == PIN_LEFT
                else    // orient == PIN_LEFT
                {
                {
                    x = x1 - TextInside;
                    x = x1 - TextInside;
                    if( DrawPinName )
                        PlotGraphicText( g_PlotFormat, wxPoint( x, y1 ),
                        PlotGraphicText( g_PlotFormat, wxPoint( x, y1 ),
                                         NameColor, m_PinName, TEXT_ORIENT_HORIZ,
                                         NameColor, m_PinName, TEXT_ORIENT_HORIZ,
                                         PinNameSize,
                                         PinNameSize,
@@ -724,13 +730,10 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                                         GR_TEXT_VJUSTIFY_CENTER,
                                         GR_TEXT_VJUSTIFY_CENTER,
                                         aWidth, aItalic, true );
                                         aWidth, aItalic, true );
                }
                }
            }

                if( DrawPinNum )
                if( DrawPinNum )
                {
                {
                    PlotGraphicText( g_PlotFormat,
                    PlotGraphicText( g_PlotFormat,
                                 wxPoint( (x1 + pin_pos.x) / 2,
                                     wxPoint( (x1 + pin_pos.x) / 2, y1 - TXTMARGE ),
                                         y1 - TXTMARGE ),
                                     NumColor, StringPinNum,
                                     NumColor, StringPinNum,
                                     TEXT_ORIENT_HORIZ, PinNumSize,
                                     TEXT_ORIENT_HORIZ, PinNumSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_HJUSTIFY_CENTER,
@@ -738,34 +741,43 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                                     aWidth, aItalic );
                                     aWidth, aItalic );
                }
                }
            }
            }
        }
        else         /* Its a vertical line. */
        else         /* Its a vertical line. */
        {
            if( DrawPinName )
        {
        {
            if( orient == PIN_DOWN )
            if( orient == PIN_DOWN )
            {
            {
                y = y1 + TextInside;
                y = y1 + TextInside;


                if( DrawPinName )
                    PlotGraphicText( g_PlotFormat, wxPoint( x1, y ), NameColor,
                    PlotGraphicText( g_PlotFormat, wxPoint( x1, y ), NameColor,
                                     m_PinName,
                                     m_PinName,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_HJUSTIFY_RIGHT,
                                     GR_TEXT_VJUSTIFY_TOP,
                                     GR_TEXT_VJUSTIFY_CENTER,
                                     aWidth, aItalic, true );
                                     aWidth, aItalic, true );
                if( DrawPinNum )
                {
                    PlotGraphicText( g_PlotFormat,
                                     wxPoint( x1 - TXTMARGE,
                                              (y1 + pin_pos.y) / 2 ),
                                     NumColor, StringPinNum,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_VJUSTIFY_BOTTOM,
                                     aWidth, aItalic );
                }
            }
            }
            else        /* PIN_UP */
            else        /* PIN_UP */
            {
            {
                y = y1 - TextInside;
                y = y1 - TextInside;


                if( DrawPinName )
                    PlotGraphicText( g_PlotFormat, wxPoint( x1, y ), NameColor,
                    PlotGraphicText( g_PlotFormat, wxPoint( x1, y ), NameColor,
                                     m_PinName,
                                     m_PinName,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     TEXT_ORIENT_VERT, PinNameSize,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                     GR_TEXT_HJUSTIFY_LEFT,
                                     GR_TEXT_VJUSTIFY_BOTTOM,
                                     GR_TEXT_VJUSTIFY_CENTER,
                                     aWidth, aItalic, true );
                                     aWidth, aItalic, true );
                }
            }

                if( DrawPinNum )
                if( DrawPinNum )
                {
                {
                    PlotGraphicText( g_PlotFormat,
                    PlotGraphicText( g_PlotFormat,
@@ -773,12 +785,13 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                                              (y1 + pin_pos.y) / 2 ),
                                              (y1 + pin_pos.y) / 2 ),
                                     NumColor, StringPinNum,
                                     NumColor, StringPinNum,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                     TEXT_ORIENT_VERT, PinNumSize,
                                 GR_TEXT_HJUSTIFY_RIGHT,
                                     GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER,
                                     GR_TEXT_VJUSTIFY_BOTTOM,
                                     aWidth, aItalic );
                                     aWidth, aItalic );
                }
                }
            }
            }
        }
        }
    }
    else     /* Draw num & text pin outside */
    else     /* Draw num & text pin outside */
    {
    {
        if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
        if( (orient == PIN_LEFT) || (orient == PIN_RIGHT) )
@@ -801,7 +814,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                PlotGraphicText( g_PlotFormat, wxPoint( x, y1 + TXTMARGE ),
                PlotGraphicText( g_PlotFormat, wxPoint( x, y1 + TXTMARGE ),
                                 NumColor, StringPinNum,
                                 NumColor, StringPinNum,
                                 TEXT_ORIENT_HORIZ, PinNumSize,
                                 TEXT_ORIENT_HORIZ, PinNumSize,
                                 GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_TOP,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_TOP,
                                 aWidth, aItalic );
                                 aWidth, aItalic );
            }
            }
        }
        }
@@ -814,8 +828,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                                                        y ),
                                                        y ),
                                 NameColor, m_PinName,
                                 NameColor, m_PinName,
                                 TEXT_ORIENT_VERT, PinNameSize,
                                 TEXT_ORIENT_VERT, PinNameSize,
                                 GR_TEXT_HJUSTIFY_RIGHT,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_BOTTOM,
                                 aWidth, aItalic, true );
                                 aWidth, aItalic, true );
            }
            }


@@ -826,8 +840,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
                                          (y1 + pin_pos.y) / 2 ),
                                          (y1 + pin_pos.y) / 2 ),
                                 NumColor, StringPinNum,
                                 NumColor, StringPinNum,
                                 TEXT_ORIENT_VERT, PinNumSize,
                                 TEXT_ORIENT_VERT, PinNumSize,
                                 GR_TEXT_HJUSTIFY_LEFT,
                                 GR_TEXT_HJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_CENTER,
                                 GR_TEXT_VJUSTIFY_TOP,
                                 aWidth, aItalic );
                                 aWidth, aItalic );
            }
            }
        }
        }
Loading