cyrillic font support, russian GOST support

This commit is contained in:
faa 2008-11-05 11:41:15 +00:00
parent 76467a7fa5
commit 8bed5053da
16 changed files with 1375 additions and 13 deletions

View File

@ -14,6 +14,11 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# building minizip.
option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
# Russian GOST and CYRILLIC patch
option(KICAD_CYRILLIC "enable/disable building unicode (default OFF)")
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building unicode (default OFF)")
# Comment this out if you don't want to build with Python support.
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
@ -33,6 +38,18 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(KICAD_CYRILLIC)
add_definitions(-DKICAD_CYRILLIC)
endif(KICAD_CYRILLIC)
if(wxUSE_UNICODE)
add_definitions(-DwxUSE_UNICODE)
endif(wxUSE_UNICODE)
if(KICAD_GOST)
add_definitions(-DKICAD_GOST)
endif(KICAD_GOST)
# Locations for install targets.
set(KICAD_BIN bin
CACHE PATH "Location of KiCad binaries.")

View File

@ -5,6 +5,11 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-nov-5 UPDATE Andrey Fedorushkov <andrf@mail.ru>
================================================================================
+all:
Add cyrillic font support.
Add russian GOST worksheet support.
2008-nov-2 CLEANUP Jerry Jacobs <jerkejacobs@gmail.com>
================================================================================

View File

@ -535,7 +535,15 @@ void EDA_TextStruct::CreateDrawData()
while( kk++ < nbchar )
{
x0 = 0; y0 = 0;
AsciiCode = (*ptr) & 255;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode = (*ptr) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
#else
AsciiCode = (*ptr) & 255;
#endif
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
* du caractere a dessiner */

View File

@ -82,7 +82,14 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size, const wxPoint& offset, const wxS
m_Name = name;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400;
#if defined(KICAD_GOST)
m_LeftMargin = LEFTMARGIN;
m_RightMargin = RIGHTMARGIN;
m_TopMargin = TOPMARGIN;
m_BottomMargin = BOTTOMMARGIN;
#else
m_LeftMargin = m_RightMargin = m_TopMargin = m_BottomMargin = 400;
#endif
}

View File

@ -127,6 +127,17 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
xg = (PageSize.x - Sheet->m_RightMargin) * conv_unit;
yg = (PageSize.y - Sheet->m_BottomMargin) * conv_unit; /* lower right corner */
#if defined(KICAD_GOST)
FctPlume(ref,'U');
pos.x = xg; pos.y = ref.y;
FctPlume(pos,'D');
pos.x = xg; pos.y = yg;
FctPlume(pos,'D');
pos.x = ref.x; pos.y = yg;
FctPlume( pos,'D' );
FctPlume(ref,'D');
#else
for( ii = 0; ii < 2; ii++ )
{
FctPlume( ref, 'U' );
@ -140,6 +151,7 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
ref.x += GRID_REF_W * conv_unit; ref.y += GRID_REF_W * conv_unit;
xg -= GRID_REF_W * conv_unit; yg -= GRID_REF_W * conv_unit;
}
#endif
/* trace des reperes */
text_size.x = WSTEXTSIZE * conv_unit;
@ -150,6 +162,48 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
xg = (PageSize.x - Sheet->m_RightMargin);
yg = (PageSize.y - Sheet->m_BottomMargin); /* lower right corner in 1/1000 inch */
#if defined(KICAD_GOST)
for ( WsItem = &WS_Segm1_LU; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (ref.x - WsItem->m_Posx) * conv_unit;
pos.y = (yg - WsItem->m_Posy) * conv_unit;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_CADRE:
break;
case WS_PODPIS_LU:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
PlotGraphicText(format_plot, pos, color,
msg, TEXT_ORIENT_VERT, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM);
break;
case WS_SEGMENT_LU:
FctPlume(pos, 'U');
pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (yg - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D');
break;
}
}
for ( WsItem = &WS_Segm1_LT; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (ref.x + WsItem->m_Posx) * conv_unit;
pos.y = (ref.y + WsItem->m_Posy) * conv_unit;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_SEGMENT_LT:
FctPlume(pos, 'U');
pos.x = (ref.x + WsItem->m_Endx) * conv_unit;
pos.y = (ref.y + WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D');
break;
}
}
#else
/* Trace des reperes selon l'axe X */
ipas = (xg - ref.x) / PAS_REF;
gxpas = ( xg - ref.x) / ipas;
@ -214,10 +268,102 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
PlotGraphicText( format_plot, pos, color, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER );
}
#endif
/* Trace du cartouche */
text_size.x = SIZETEXT * conv_unit;
text_size.y = SIZETEXT * conv_unit;
#if defined(KICAD_GOST)
ref.x = PageSize.x - Sheet->m_RightMargin;
ref.y = PageSize.y - Sheet->m_BottomMargin;
if (screen->m_ScreenNumber == 1)
{
for( WsItem = &WS_Date; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (ref.x - WsItem->m_Posx) * conv_unit;
pos.y = (ref.y - WsItem->m_Posy) * conv_unit;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_DATE:
break;
case WS_REV:
break;
case WS_KICAD_VERSION:
break;
case WS_PODPIS:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
break;
case WS_SIZESHEET:
break;
case WS_IDENTSHEET:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
break;
case WS_SHEETS:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
break;
case WS_COMPANY_NAME:
break;
case WS_TITLE:
break;
case WS_COMMENT1:
break;
case WS_COMMENT2:
break;
case WS_COMMENT3:
break;
case WS_COMMENT4:
break;
case WS_UPPER_SEGMENT:
case WS_LEFT_SEGMENT:
case WS_SEGMENT:
FctPlume(pos, 'U');
pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (ref.y - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D');
break;
}
}
} else {
for( WsItem = &WS_CADRE_D; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (ref.x - WsItem->m_Posx) * conv_unit;
pos.y = (ref.y - WsItem->m_Posy) * conv_unit;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_CADRE:
/* Begin list number > 1 */
case WS_PODPIS_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
break;
case WS_IDENTSHEET_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber;
PlotGraphicText(format_plot, pos, color, msg, TEXT_ORIENT_HORIZ,text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER);
break;
case WS_LEFT_SEGMENT_D:
case WS_SEGMENT_D:
FctPlume(pos, 'U');
pos.x = (ref.x - WsItem->m_Endx) * conv_unit;
pos.y = (ref.y - WsItem->m_Endy) * conv_unit;
FctPlume(pos, 'D');
break;
}
}
}
#else
ref.x = PageSize.x - GRID_REF_W - Sheet->m_RightMargin;
ref.y = PageSize.y - GRID_REF_W - Sheet->m_BottomMargin;
@ -327,6 +473,7 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER );
}
}
#endif
switch( format_plot )
{

View File

@ -219,7 +219,15 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
while( kk++ < nbchar )
{
x0 = 0; y0 = 0;
AsciiCode = Text.GetChar( ptr ) & 255;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode = Text.GetChar(ptr) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
#else
AsciiCode = Text.GetChar( ptr ) & 255;
#endif
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
* du caractere a dessiner */
@ -423,7 +431,15 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
while( kk++ < nbchar )
{
AsciiCode = Text.GetChar( ptr ) & 255;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode = Text.GetChar(ptr) & 0x7FF;
if ( AsciiCode > 0x40F && AsciiCode < 0x450 ) // big small Cyr
AsciiCode = utf8_to_ascii[AsciiCode - 0x410] & 0xFF;
else
AsciiCode = AsciiCode & 0xFF;
#else
AsciiCode = Text.GetChar( ptr ) & 0xFF;
#endif
ptcar = graphic_fonte_shape[AsciiCode]; /* ptcar pointe la description
* du caractere a dessiner */

View File

@ -61,6 +61,11 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
xg = Sheet->m_Size.x - Sheet->m_RightMargin;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
#if defined(KICAD_GOST)
GRRect( &DrawPanel->m_ClipBox, DC, refx * scale, refy * scale,
xg * scale, yg * scale, width, Color );
#else
for( ii = 0; ii < 2; ii++ )
{
GRRect( &DrawPanel->m_ClipBox, DC, refx * scale, refy * scale,
@ -69,9 +74,52 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
refx += GRID_REF_W; refy += GRID_REF_W;
xg -= GRID_REF_W; yg -= GRID_REF_W;
}
#endif
/* trace des reperes */
refx = Sheet->m_LeftMargin;
#if defined(KICAD_GOST)
refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* Lower left corner */
for( WsItem = &WS_Segm1_LU; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (refx - WsItem->m_Posx)* scale;
pos.y = (refy - WsItem->m_Posy)* scale;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_CADRE:
break;
case WS_PODPIS_LU:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_VERT, size,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_BOTTOM,width);
break;
case WS_SEGMENT_LU:
xg = Sheet->m_LeftMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color);
break;
}
}
refy = Sheet->m_BottomMargin; /* Left Top corner */
for( WsItem = &WS_Segm1_LT; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (refx + WsItem->m_Posx)* scale;
pos.y = (refy + WsItem->m_Posy)* scale;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_SEGMENT_LT:
xg = Sheet->m_LeftMargin + WsItem->m_Endx;
yg = Sheet->m_BottomMargin + WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color);
break;
}
}
#else
refy = Sheet->m_TopMargin; /* Upper left corner */
xg = Sheet->m_Size.x - Sheet->m_RightMargin;
yg = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
@ -135,8 +183,114 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Line, TEXT_ORIENT_HORIZ, size_ref,
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, width );
}
#endif
/* Trace du cartouche */
#if defined(KICAD_GOST)
refx = Sheet->m_Size.x - Sheet->m_RightMargin;
refy = Sheet->m_Size.y - Sheet->m_BottomMargin; /* lower right corner */
if (screen->m_ScreenNumber == 1)
{
for( WsItem = &WS_Date; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (refx - WsItem->m_Posx)* scale;
pos.y = (refy - WsItem->m_Posy)* scale;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_DATE:
break;
case WS_REV:
break;
case WS_KICAD_VERSION:
break;
case WS_PODPIS:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_SIZESHEET:
break;
case WS_IDENTSHEET:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_SHEETS:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, width);
break;
case WS_COMPANY_NAME:
break;
case WS_TITLE:
break;
case WS_COMMENT1:
break;
case WS_COMMENT2:
break;
case WS_COMMENT3:
break;
case WS_COMMENT4:
break;
case WS_UPPER_SEGMENT:
case WS_LEFT_SEGMENT:
WS_MostUpperLine.m_Posy =
WS_MostUpperLine.m_Endy =
WS_MostLeftLine.m_Posy = STAMP_OY;
pos.y = (refy - WsItem->m_Posy)* scale;
case WS_SEGMENT:
xg = Sheet->m_Size.x -
Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color);
break;
}
}
} else {
for( WsItem = &WS_CADRE_D; WsItem != NULL; WsItem = WsItem->Pnext )
{
pos.x = (refx - WsItem->m_Posx)* scale;
pos.y = (refy - WsItem->m_Posy)* scale;
msg.Empty();
switch( WsItem->m_Type )
{
case WS_CADRE:
/* Begin list number > 1 */
case WS_PODPIS_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,width);
break;
case WS_IDENTSHEET_D:
if(WsItem->m_Legende) msg = WsItem->m_Legende;
msg << screen->m_ScreenNumber;
DrawGraphicText(DrawPanel, DC, pos, Color,
msg, TEXT_ORIENT_HORIZ, size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,width);
break;
case WS_LEFT_SEGMENT_D:
pos.y = (refy - WsItem->m_Posy)* scale;
case WS_SEGMENT_D:
xg = Sheet->m_Size.x -
Sheet->m_RightMargin - WsItem->m_Endx;
yg = Sheet->m_Size.y -
Sheet->m_BottomMargin - WsItem->m_Endy;
GRLine(&DrawPanel->m_ClipBox, DC, pos.x, pos.y,
xg * scale, yg * scale, width, Color);
break;
}
}
}
#else
refx = Sheet->m_Size.x - Sheet->m_RightMargin - GRID_REF_W;
refy = Sheet->m_Size.y - Sheet->m_BottomMargin - GRID_REF_W; /* lower right corner */
@ -312,6 +466,7 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
break;
}
}
#endif
}

View File

@ -839,6 +839,16 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly )
nextcmpref = CONV_FROM_UTF8( ListeCmp[ii + 1].m_TextRef );
cmpvalue = CONV_FROM_UTF8( ListeCmp[ii].m_TextValue );
nextcmpvalue = CONV_FROM_UTF8( ListeCmp[ii + 1].m_TextValue );
#if defined(KICAD_GOST)
msg.Printf( _( "Diff values for %s%d.%c (%s) and %s%d.%c (%s)" ),
cmpref.GetData(),
ListeCmp[ii].m_NumRef,
ListeCmp[ii].m_Unit + '1' - 1,
cmpvalue.GetData(), nextcmpref.GetData(),
ListeCmp[ii + 1].m_NumRef,
ListeCmp[ii + 1].m_Unit + '1' - 1,
nextcmpvalue.GetData() );
#else
msg.Printf( _( "Diff values for %s%d%c (%s) and %s%d%c (%s)" ),
cmpref.GetData(),
ListeCmp[ii].m_NumRef,
@ -847,6 +857,7 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly )
ListeCmp[ii + 1].m_NumRef,
ListeCmp[ii + 1].m_Unit + 'A' - 1,
nextcmpvalue.GetData() );
#endif
DisplayError( frame, msg );
error++;

View File

@ -727,7 +727,11 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByRef( FILE* f,
Multi = Entry->m_UnitCount;
if( ( Multi > 1 ) && aIncludeSubComponents )
#if defined(KICAD_GOST)
Unit = aList[ii].m_Unit + '1' - 1;
#else
Unit = aList[ii].m_Unit + 'A' - 1;
#endif
sprintf( CmpName, "%s", aList[ii].m_Ref );
if( !CompactForm || Unit != ' ' )
@ -815,10 +819,17 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByVal( FILE* f,
if( ( Multi > 1 ) && aIncludeSubComponents )
{
#if defined(KICAD_GOST)
Unit = aList[ii].m_Unit + '1' - 1;
}
sprintf( CmpName, "%s.%c", aList[ii].m_Ref, Unit );
#else
Unit = aList[ii].m_Unit + 'A' - 1;
}
sprintf( CmpName, "%s%c", aList[ii].m_Ref, Unit );
#endif
fprintf( f, "| %-12s %-10s", CONV_TO_UTF8( DrawLibItem->GetField(VALUE)->m_Text ), CmpName );
// print the sheet path

View File

@ -130,7 +130,11 @@ void DrawLibEntry( WinEDA_DrawPanel* panel, wxDC* DC,
else color = Color;
if( LibEntry->m_UnitCount > 1 )
#if defined(KICAD_GOST)
Prefix.Printf( wxT( "%s?.%c" ), LibEntry->m_Prefix.m_Text.GetData(), Multi + '1' - 1);
#else
Prefix.Printf( wxT( "%s?%c" ), LibEntry->m_Prefix.m_Text.GetData(), Multi + 'A' - 1 );
#endif
else
Prefix = LibEntry->m_Prefix.m_Text + wxT( "?" );
@ -309,7 +313,12 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
{
/* On ajoute alors A ou B ... a la reference */
wxString fulltext = m_Text;
#if defined(KICAD_GOST)
fulltext.Append( '.');
fulltext.Append( '1' - 1 + DrawLibItem->m_Multi );
#else
fulltext.Append( 'A' - 1 + DrawLibItem->m_Multi );
#endif
DrawGraphicText( panel, DC, pos, color, fulltext.GetData(),
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,

View File

@ -433,7 +433,12 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
/* Adding A, B ... to the reference */
wxString Text;
Text = field->m_Text;
#if defined(KICAD_GOST)
Text.Append( '.' );
Text.Append( '1' - 1 + DrawLibItem->m_Multi );
#else
Text.Append( 'A' - 1 + DrawLibItem->m_Multi );
#endif
PlotGraphicText( g_PlotFormat, textpos, color, Text,
orient ? TEXT_ORIENT_VERT : TEXT_ORIENT_HORIZ,
field->m_Size, hjustify, vjustify );

View File

@ -75,6 +75,13 @@ enum pseudokeys {
#define MILLIMETRE 1
#define CENTIMETRE 2
#if defined(KICAD_GOST)
#define LEFTMARGIN 800 /* 20mm */
#define RIGHTMARGIN 200 /* 5mm */
#define TOPMARGIN 200 /* 5mm */
#define BOTTOMMARGIN 200 /* 5mm */
#endif
/* forward declarations: */
class LibNameList;

View File

@ -45,6 +45,10 @@ ___ 0 ----------
#define SH_CODE signed char
extern const SH_CODE *graphic_fonte_shape[256];
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
extern const int utf8_to_ascii[64];
#endif
#ifdef EDA_DRAWBASE
#define Up (SH_CODE)'U'
@ -174,6 +178,65 @@ const SH_CODE char_shape_o_circ[] = {Up,0,2,Dn,1,1,5,1,6,2,6,7,5,8,1,8,0,7,0,2,U
const SH_CODE char_shape_u_circ[] = {Up,6,1,Dn,2,1,0,3,0,6,2,8,6,8,Up,7,1,Dn,9,4,7,7,Up,X};
const SH_CODE char_shape_u_trema[] = {Up,6,1,Dn,2,1,0,3,0,6,2,8,6,8,Up,9,2,Dn,9,3,Up,9,5,Dn,9,6,Up,X};
#if defined(KICAD_CYRILLIC)
const SH_CODE char_shape_yu[] = {Up,6,0,Dn,0,0,Up,3,0,Dn,3,2,Up,0,3,Dn,1,2,5,2,6,3,6,7,5,8,1,8,0,7,0,3,Up,X}; // ю
const SH_CODE char_shape_YU[] = {Up,9,0,Dn,0,0,Up,4,0,Dn,4,2,Up,0,3,Dn,1,2,8,2,9,3,9,7,8,8,1,8,0,7,0,3,Up,X}; // Ю
const SH_CODE char_shape_be[] = {Up,6,7,Dn,6,2,5,1,1,1,0,2,0,7,1,8,5,8,6,7,9,1,9,8,Up,X}; // б
const SH_CODE char_shape_BE[] = {Up,9,8,Dn,9,1,0,1,0,7,1,8,4,8,5,7,5,1,Up,X}; // Б
const SH_CODE char_shape_tse[] = {Up,6,1,Dn,1,1,0,2,0,8,6,8,Up,0,8,Dn,0,9,-2,9,Up,X}; // ц
const SH_CODE char_shape_TSE[] = {Up,9,1,Dn,0,1,0,9,-2,9,Up,9,8,Dn,0,8,Up,X}; // Ц
const SH_CODE char_shape_de[] = {Up,9,3,Dn,9,7,8,8,1,8,0,7,0,2,1,1,5,1,6,2,6,8,Up,X}; // д
const SH_CODE char_shape_DE[] = {Up,0,2,Dn,9,3,9,7,0,7,Up,-1,1,Dn,0,1,0,8,-1,8,Up,X}; // Д
const SH_CODE char_shape_ee[] = {Up,3,1,Dn,3,8,5,8,6,7,6,2,5,1,1,1,0,2,0,8,Up,X}; //e
const SH_CODE char_shape_EE[] = {Up,9,8,Dn,9,1,0,1,0,8,Up,5,1,Dn,5,7,Up,X}; //E
const SH_CODE char_shape_ef[] = {Up,7,4,Dn,-3,4,Up,5,1,Dn,6,2,6,6,5,7,1,7,0,6,0,2,1,1,5,1,Up,X}; // ф
const SH_CODE char_shape_EF[] = {Up,9,4,Dn,0,4,Up,7,0,Dn,8,1,8,7,7,8,3,8,2,7,2,1,3,0,7,0,Up,X}; // Ф
const SH_CODE char_shape_ghe[] = {Up,5,1,Dn,6,2,6,7,5,8,4,8,3,7,3,2,2,1,1,1,0,2,0,7,1,8,Up,X}; // г
const SH_CODE char_shape_GHE[] = {Up,0,1,Dn,9,1,9,8,Up,X}; // Г
const SH_CODE char_shape_xe[] = {Up,0,1,Dn,6,8,Up,6,1,Dn,0,8,Up,X}; // x
const SH_CODE char_shape_XE[] = {Up,0,1,Dn,9,8,Up,9,1,Dn,0,8,Up,X}; // X
const SH_CODE char_shape_ii[] = {Up,6,1,Dn,1,1,0,2,0,3,1,8,Up,0,8,Dn,6,8,Up,X}; // и
const SH_CODE char_shape_II[] = {Up,0,1,Dn,9,1,Up,1,1,Dn,8,8,Up,9,8,Dn,0,8,Up,X}; // И
const SH_CODE char_shape_shorti[] = {Up,6,1,Dn,1,1,0,2,0,3,1,8,Up,0,8,Dn,6,8,Up,8,3,Dn,8,6,Up,X}; // й
const SH_CODE char_shape_SHORTI[] = {Up,9,1,Dn,0,1,Up,1,1,Dn,8,8,Up,9,8,Dn,0,8,Up,9,3,Dn,9,6,Up,X}; // Й
const SH_CODE char_shape_ka[] = {Up,6,1,Dn,0,1,Up,3,1,Dn,6,8,Up,4,3,Dn,0,8,Up,X}; //к
const SH_CODE char_shape_KA[] = {Up,9,1,Dn,0,1,Up,4,1,Dn,9,8,Up,5,3,Dn,0,8,Up,X}; //K
const SH_CODE char_shape_letterel[] = {Up,0,1,Dn,6,5,6,8,0,8,Up,X}; // л
const SH_CODE char_shape_EL[] = {Up,0,1,Dn,9,5,9,8,0,8,Up,X}; // Л
const SH_CODE char_shape_em[] = {Up,0,0,Dn,6,0,3,4,6,8,0,8,Up,X}; // м
//const SH_CODE char_shape_M[] = {X}; // М
const SH_CODE char_shape_en[] = {Up,6,1,Dn,0,1,Up,6,8,Dn,0,8,Up,3,1,Dn,3,8,Up,X}; // н
const SH_CODE char_shape_EN[] = {Up,9,1,Dn,0,1,Up,9,8,Dn,0,8,Up,5,1,Dn,5,8,Up,X}; // H
const SH_CODE char_shape_pe[] = {Up,0,1,Dn,6,1,6,7,5,8,0,8,Up,X}; // п
const SH_CODE char_shape_PE[] = {Up,0,1,Dn,9,1,9,8,0,8,Up,X}; // П
const SH_CODE char_shape_ya[] = {Up,0,8,Dn,6,8,6,2,5,1,4,1,3,2,3,8,Up,3,3,Dn,0,1,Up,X}; // я
const SH_CODE char_shape_YA[] = {Up,0,8,Dn,9,8,9,2,8,1,5,1,4,2,4,8,Up,4,3,Dn,0,1,Up,X}; // Я
const SH_CODE char_shape_te[] = {Up,0,1,Dn,6,1,6,6,5,7,0,7,Up,6,4,Dn,0,4,Up,X}; // т == m
const SH_CODE char_shape_TE[] = {Up,0,4,Dn,9,4,Up,9,1,Dn,9,7,Up,X}; // Т
const SH_CODE char_shape_uu[] = {Up,6,1,Dn,1,1,0,2,0,8,6,8,Up,0,8,Dn,-2,8,-3,7,-3,1,Up,X}; // у - latin y
const SH_CODE char_shape_UU[] = {Up,9,1,Dn,5,1,4,2,4,8,Up,9,8,Dn,1,8,0,7,0,1,Up,X}; // У
const SH_CODE char_shape_zhe[] = {Up,0,0,Dn,6,8,Up,6,0,Dn,0,8,Up,6,4,Dn,0,4,Up,X}; // ж
const SH_CODE char_shape_ZHE[] = {Up,0,0,Dn,9,8,Up,9,0,Dn,0,8,Up,9,4,Dn,0,4,Up,X}; // Ж
const SH_CODE char_shape_ve[] = {Up,5,1,Dn,6,2,6,7,5,8,1,8,0,7,0,2,1,1,8,1,9,2,9,4,8,5,7,5,6,4,Up,X}; // в
const SH_CODE char_shape_VE[] = {Up,5,1,Dn,5,7,4,8,1,8,0,7,0,1,9,1,9,7,8,8,6,8,5,7,Up,X}; // В
const SH_CODE char_shape_softsign[] = {Up,6,1,Dn,0,1,0,7,1,8,2,8,3,7,3,1,Up,X}; // ь
const SH_CODE char_shape_SOFTSIGN[] = {Up,9,1,Dn,0,1,0,7,1,8,4,8,5,7,5,1,Up,X}; // Ь
const SH_CODE char_shape_yeru[] = {Up,6,1,Dn,0,1,0,6,1,7,2,7,3,6,3,1,Up,6,8,Dn,0,8,Up,X}; // ы
const SH_CODE char_shape_YERU[] = {Up,9,1,Dn,0,1,0,6,1,7,3,7,4,6,4,1,Up,9,8,Dn,0,8,Up,X}; // Ы
const SH_CODE char_shape_ze[] = {Up,5,1,Dn,6,2,6,7,5,8,4,8,3,7,3,5,Up,3,7,Dn,2,8,1,8,0,7,0,2,1,1,Up,X}; // з
const SH_CODE char_shape_ZE[] = {Up,8,1,Dn,9,2,9,7,8,8,6,8,5,7,5,4,Up,5,7,Dn,4,8,1,8,0,7,0,2,1,1,Up,X}; // З
const SH_CODE char_shape_sha[] = {Up,6,0,Dn,1,0,0,1,0,8,6,8,Up,6,4,Dn,0,4,Up,X}; // ш
const SH_CODE char_shape_SHA[] = {Up,9,0,Dn,0,0,0,8,9,8,Up,9,4,Dn,0,4,Up,X}; // Ш
const SH_CODE char_shape_ye[] = {Up,0,1,Dn,0,7,1,8,5,8,6,7,6,1,Up,3,4,Dn,3,8,Up,X}; // э
const SH_CODE char_shape_YE[] = {Up,0,1,Dn,0,7,1,8,8,8,9,7,9,1,Up,5,4,Dn,5,8,Up,X}; // Э
const SH_CODE char_shape_shcha[] = {Up,6,0,Dn,1,0,0,1,0,8,6,8,Up,6,4,Dn,0,4,Up,0,8,Dn,0,9,-2,9,Up,X}; // щ
const SH_CODE char_shape_SHCHA[] = {Up,9,0,Dn,0,0,0,8,9,8,Up,9,4,Dn,0,4,Up,0,8,Dn,0,9,-2,9,Up,X}; // Щ
const SH_CODE char_shape_che[] = {Up,6,1,Dn,4,1,3,2,3,8,Up,6,8,Dn,0,8,Up,X}; // ч
const SH_CODE char_shape_CHE[] = {Up,9,1,Dn,5,1,4,2,4,8,Up,9,8,Dn,0,8,Up,X}; // Ч
const SH_CODE char_shape_hardsign[] = {Up,6,0,Dn,6,1,0,1,0,7,1,8,2,8,3,7,3,1,Up,X}; // ъ
const SH_CODE char_shape_HARDSIGN[] = {Up,9,0,Dn,9,1,0,1,0,7,1,8,4,8,5,7,5,1,Up,X}; // Ъ
#endif
const SH_CODE *graphic_fonte_shape[256] =
{
// codes 0..31:
@ -246,6 +309,24 @@ const SH_CODE *graphic_fonte_shape[256] =
noshape, noshape, noshape, noshape, //184..187
noshape, noshape, noshape, noshape, //188..191
#if defined(KICAD_CYRILLIC)
char_shape_yu, char_shape_a, char_shape_be, char_shape_tse,
char_shape_de, char_shape_ee, char_shape_ef, char_shape_ghe, //196..199
char_shape_xe, char_shape_ii, char_shape_shorti, char_shape_ka, // 200..203
char_shape_letterel, char_shape_em, char_shape_en, char_shape_o, //204..207
char_shape_pe, char_shape_ya, char_shape_p, char_shape_c, //208..211
char_shape_te, char_shape_uu, char_shape_zhe, char_shape_ve, //212..215
char_shape_softsign, char_shape_yeru, char_shape_ze, char_shape_sha, //216..219
char_shape_ye, char_shape_shcha, char_shape_che, char_shape_hardsign, //220..223
char_shape_YU, char_shape_A, char_shape_BE, char_shape_TSE, //0xE0..0xE3 224..227
char_shape_DE, char_shape_EE, char_shape_EF, char_shape_GHE, //228..231
char_shape_XE, char_shape_II, char_shape_SHORTI, char_shape_KA, //232..235
char_shape_EL, char_shape_M, char_shape_EN, char_shape_O, //236..239
char_shape_PE, char_shape_YA, char_shape_P, char_shape_C, //240..243
char_shape_TE, char_shape_UU, char_shape_ZHE, char_shape_VE, //244..247
char_shape_SOFTSIGN, char_shape_YERU, char_shape_ZE, char_shape_SHA, //248..251
char_shape_YE, char_shape_SHCHA, char_shape_CHE, char_shape_HARDSIGN, //252..255
#else
noshape, noshape, noshape, noshape, //192..195
noshape, noshape, noshape, char_shape_C_Cedille, //196..199
noshape, noshape, noshape, noshape, // 200..203
@ -263,8 +344,22 @@ const SH_CODE *graphic_fonte_shape[256] =
char_shape_o_circ, noshape, char_shape_o_trema, noshape, //244..247
noshape, char_shape_u_grave, noshape, char_shape_u_circ, //248..251
char_shape_u_trema, noshape, noshape, noshape, //252..255
#endif
} ;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
const int utf8_to_ascii[] =
{
0xE1, 0xE2, 0xF7, 0xE7, 0xE4, 0xE5, 0xF6, 0xFA,
0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0,
0xF2, 0xF3, 0xF4, 0xF5, 0xE6, 0xE8, 0xE3, 0xFE,
0xFB, 0xFD, 0xFF, 0xF9, 0xF8, 0xFC, 0xE0, 0xF1,
0xC1, 0xC2, 0xD7, 0xC7, 0xC4, 0xC5, 0xD6, 0xDA,
0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0,
0xD2, 0xD3, 0xD4, 0xD5, 0xC6, 0xC8, 0xC3, 0xDE,
0xDB, 0xDD, 0xDF, 0xD9, 0xD8, 0xDC, 0xC0, 0xD1
};
#endif
#endif
#endif // ifndef _GRFONTE_H_

File diff suppressed because it is too large Load Diff

View File

@ -158,6 +158,15 @@ Build the "minizip" executable. Use OFF to disable it building.
-DKICAD_PYTHON=ON
Build the KiCad with Python support.
-DKICAD_CYRILLIC=ON
Build the KiCad with cyrillic fonts support.
-DwxUSE_UNICODE=ON
Require on locale utf8 for build the KiCad with cyrillic fonts support.
-DKICAD_GOST=ON
Build the KiCad with russian GOST support.
-DCMAKE_CXX_FLAGS=<some extra flags>
Extra flags for the c++ compiler for your system required.

View File

@ -624,7 +624,15 @@ void Plot_1_texte( int format_plot, const wxString& Text, int angle,
/* trace du texte */
for( ; kk < nbcodes; kk++ )
{
int code = Text.GetChar( kk ) & 0xFF;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
int code = Text.GetChar(kk) & 0x7FF;
if ( code > 0x40F && code < 0x450 ) // big small Cyr
code = utf8_to_ascii[code - 0x410] & 0xFF;
else
code = code & 0xFF;
#else
int code = Text.GetChar( kk ) & 0xFF;
#endif
ptcar = graphic_fonte_shape[code]; /* ptcar pointe la description
* du caractere a dessiner */