← Back to team overview

kicad-developers team mailing list archive

[PATCH] cherry-picks related with sheet to stable branch 4.0

 

Hello.
Wayne or Jean-Pier, can anyone merge these cherry-picks to stable branch.
>From 6291f2580001369d8a9e03e1531ce7a5ca8feadc Mon Sep 17 00:00:00 2001
From: jean-pierre charras <jp.charras@xxxxxxxxxx>
Date: Thu, 6 Oct 2016 17:19:55 +0200
Subject: [PATCH 3/3] Fixes: lp:1629387 (pagelayout text sometimes shrinking)
 https://bugs.launchpad.net/kicad/+bug/1629387

---
 common/gal/stroke_font.cpp                      | 53 +++++++++++++++++++++++--
 common/page_layout/class_worksheet_dataitem.cpp | 12 +++---
 common/page_layout/title_block_shapes.cpp       | 12 +++---
 3 files changed, 63 insertions(+), 14 deletions(-)

diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp
index 636f75ea7..f7094f74f 100644
--- a/common/gal/stroke_font.cpp
+++ b/common/gal/stroke_font.cpp
@@ -375,7 +375,25 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText )
 
 VECTOR2D STROKE_FONT::computeTextSize( const UTF8& aText ) const
 {
-    VECTOR2D result = VECTOR2D( 0.0, m_glyphSize.y );
+    // Compute the Y position of the overbar. This is the distance between
+    // the text base line and the overbar axis.
+    return ComputeOverbarVerticalPosition( m_gal->GetGlyphSize().y, m_gal->GetLineWidth() );
+}
+
+
+VECTOR2D STROKE_FONT::computeTextLineSize( const UTF8& aText ) const
+{
+    return ComputeStringBoundaryLimits( aText, m_gal->GetGlyphSize(), m_gal->GetLineWidth() );
+}
+
+
+VECTOR2D STROKE_FONT::ComputeStringBoundaryLimits( const UTF8& aText, VECTOR2D aGlyphSize,
+                                        double aGlyphThickness,
+                                        double* aTopLimit, double* aBottomLimit ) const
+{
+    VECTOR2D string_bbox;
+    double ymax = 0.0;
+    double ymin = 0.0;
 
     for( UTF8::uni_iter it = aText.ubegin(), end = aText.uend(); it < end; ++it )
     {
@@ -396,8 +414,37 @@ VECTOR2D STROKE_FONT::computeTextSize( const UTF8& aText ) const
         if( dd >= (int) m_glyphBoundingBoxes.size() || dd < 0 )
             dd = '?' - ' ';
 
-        result.x += m_glyphSize.x * m_glyphBoundingBoxes[dd].GetEnd().x;
+        const BOX2D& box = m_glyphBoundingBoxes[dd];
+
+        string_bbox.x += box.GetEnd().x;
+
+        // Calculate Y min and Y max
+        if( aTopLimit )
+        {
+            ymax = std::max( ymax, box.GetY() );
+            ymax = std::max( ymax, box.GetEnd().y );
+        }
+
+        if( aBottomLimit )
+        {
+            ymin = std::min( ymin, box.GetY() );
+            ymin = std::min( ymin, box.GetEnd().y );
+        }
     }
 
-    return result;
+    string_bbox.x *= aGlyphSize.x;
+    string_bbox.x += aGlyphThickness;
+    string_bbox.y = aGlyphSize.y + aGlyphThickness;
+
+    // For italic correction, take in account italic tilt
+    if( m_gal->IsFontItalic() )
+        string_bbox.x += string_bbox.y * STROKE_FONT::ITALIC_TILT;
+
+    if( aTopLimit )
+        *aTopLimit = ymax * aGlyphSize.y;
+
+    if( aBottomLimit )
+        *aBottomLimit = ymin * aGlyphSize.y;
+
+    return string_bbox;
 }
diff --git a/common/page_layout/class_worksheet_dataitem.cpp b/common/page_layout/class_worksheet_dataitem.cpp
index b5e673f88..5b8fc6d22 100644
--- a/common/page_layout/class_worksheet_dataitem.cpp
+++ b/common/page_layout/class_worksheet_dataitem.cpp
@@ -512,14 +512,15 @@ void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize()
 
     if( m_BoundingBoxSize.x || m_BoundingBoxSize.y )
     {
-        int linewidth = 0;
         // to know the X and Y size of the line, we should use
         // EDA_TEXT::GetTextBox()
         // but this function uses integers
         // So, to avoid truncations with our unit in mm, use microns.
         wxSize size_micron;
-        size_micron.x = KiROUND( m_ConstrainedTextSize.x * 1000.0 );
-        size_micron.y = KiROUND( m_ConstrainedTextSize.y * 1000.0 );
+        #define FSCALE 1000.0
+        int linewidth = 0;
+        size_micron.x = KiROUND( m_ConstrainedTextSize.x * FSCALE );
+        size_micron.y = KiROUND( m_ConstrainedTextSize.y * FSCALE );
         WS_DRAW_ITEM_TEXT dummy( WS_DRAW_ITEM_TEXT( this, this->m_FullText,
                                                wxPoint(0,0),
                                                size_micron,
@@ -527,10 +528,11 @@ void WORKSHEET_DATAITEM_TEXT::SetConstrainedTextSize()
                                                IsItalic(), IsBold() ) );
         dummy.SetMultilineAllowed( true );
         TransfertSetupToGraphicText( &dummy );
+
         EDA_RECT rect = dummy.GetTextBox();
         DSIZE size;
-        size.x = rect.GetWidth() / 1000.0;
-        size.y = rect.GetHeight() / 1000.0;
+        size.x = rect.GetWidth() / FSCALE;
+        size.y = rect.GetHeight() / FSCALE;
 
         if( m_BoundingBoxSize.x && size.x > m_BoundingBoxSize.x )
             m_ConstrainedTextSize.x *= m_BoundingBoxSize.x / size.x;
diff --git a/common/page_layout/title_block_shapes.cpp b/common/page_layout/title_block_shapes.cpp
index c7a838578..086d518f4 100644
--- a/common/page_layout/title_block_shapes.cpp
+++ b/common/page_layout/title_block_shapes.cpp
@@ -163,12 +163,12 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
                 if( jj && ! wsText->IsInsidePage( jj ) )
                     continue;
 
-                Append( gtext = new WS_DRAW_ITEM_TEXT( wsText, wsText->m_FullText,
-                                                       wsText->GetStartPosUi( jj ),
-                                                       textsize,
-                                                       pensize, color,
-                                                       wsText->IsItalic(),
-                                                       wsText->IsBold() ) );
+                gtext = new WS_DRAW_ITEM_TEXT( wsText, wsText->m_FullText,
+                                               wsText->GetStartPosUi( jj ),
+                                               textsize, pensize, color,
+                                               wsText->IsItalic(),
+                                               wsText->IsBold() );
+                Append( gtext );
                 gtext->SetMultilineAllowed( multilines );
                 wsText->TransfertSetupToGraphicText( gtext );
 
-- 
2.11.0

>From 0abb2fcc236a84c4c7f4faac26197d57d35c28ae Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin <eldar.khayrullin@xxxxxxx>
Date: Sat, 10 Sep 2016 18:58:09 +0300
Subject: [PATCH 2/3] Fix style of gost page layouts in accordance with GOST
 2.104-2006.

Fixes reverted commit 16d03fd
---
 template/gost_landscape.kicad_wks | 134 +++++++++++++++++++-------------------
 template/gost_portrait.kicad_wks  | 134 +++++++++++++++++++-------------------
 2 files changed, 136 insertions(+), 132 deletions(-)

diff --git a/template/gost_landscape.kicad_wks b/template/gost_landscape.kicad_wks
index 4888afde3..6758ea99a 100644
--- a/template/gost_landscape.kicad_wks
+++ b/template/gost_landscape.kicad_wks
@@ -1,5 +1,5 @@
-( page_layout
-  (setup(textsize 2.5 2.5)(linewidth 0.3)(textlinewidth 0.3)
+(page_layout
+  (setup (textsize 2.5 2.5)(linewidth 0.3)(textlinewidth 0.25)
   (left_margin 8)(right_margin 5)(top_margin 5)(bottom_margin 5))
   (line (name segm1:Line) (start 0 60 lbcorner) (end 12 60 lbcorner) (linewidth 0.6) (repeat 3) (incry 25))
   (line (name segm2:Line) (start 96 0 ltcorner) (end 96 14 ltcorner) (option page1only) (linewidth 0.6) (repeat 2) (incrx 53))
@@ -17,69 +17,71 @@
   (line (name segm14:Line) (start 185 40) (end 120 40) (option page1only) (repeat 3) (incry 5))
   (line (name segm15:Line) (start 185 30) (end 120 30) (option page1only) (linewidth 0.6) (repeat 2) (incry 5))
   (line (name segm16:Line) (start 185 5) (end 120 5) (option page1only) (repeat 5) (incry 5))
-  (line (name segm17:Line) (start 185 55) (end 0 55) (option page1only) (linewidth 0.6))
-  (line (name segm18:Line) (start 0 145 lbcorner) (end 0 0 lbcorner) (linewidth 0.6) (repeat 2) (incrx 5))
-  (line (name segm19:Line) (start 45 35) (end 45 20) (option page1only) (repeat 2) (incrx -5))
-  (line (name segm20:Line) (start 35 40) (end 35 20) (option page1only) (linewidth 0.6) (repeat 2) (incrx -17))
-  (line (name segm21:Line) (start 50 20) (end 0 20) (option page1only) (linewidth 0.6) (repeat 2) (incry 15))
-  (line (name segm22:Line) (start 50 40) (end 50 0) (option page1only) (linewidth 0.6))
-  (line (name segm23:Line) (start 120 15) (end 0 15) (option page1only) (linewidth 0.6))
-  (line (name segm24:Line) (start 120 40) (end 0 40) (option page1only) (linewidth 0.6))
-  (line (name segm25:Line) (start 185 0) (end 185 55) (option page1only) (linewidth 0.6))
+  (line (name segm17:Line) (start 120 63) (end 0 63) (option page1only) (linewidth 0.6))
+  (line (name segm18:Line) (start 120 55) (end 120 63) (option page1only) (linewidth 0.6))
+  (line (name segm19:Line) (start 185 55) (end 0 55) (option page1only) (linewidth 0.6))
+  (line (name segm20:Line) (start 0 145 lbcorner) (end 0 0 lbcorner) (linewidth 0.6) (repeat 2) (incrx 5))
+  (line (name segm21:Line) (start 45 35) (end 45 20) (option page1only) (repeat 2) (incrx -5))
+  (line (name segm22:Line) (start 35 40) (end 35 20) (option page1only) (linewidth 0.6) (repeat 2) (incrx -17))
+  (line (name segm23:Line) (start 50 20) (end 0 20) (option page1only) (linewidth 0.6) (repeat 2) (incry 15))
+  (line (name segm24:Line) (start 50 40) (end 50 0) (option page1only) (linewidth 0.6))
+  (line (name segm25:Line) (start 120 15) (end 0 15) (option page1only) (linewidth 0.6))
+  (line (name segm26:Line) (start 120 40) (end 0 40) (option page1only) (linewidth 0.6))
+  (line (name segm27:Line) (start 185 0) (end 185 55) (option page1only) (linewidth 0.6))
   (rect (name rect1:Rect) (start 12 0 lbcorner) (end 0 0 rtcorner) (linewidth 0.6))
-  (tbtext Лист (name text1:Text) (pos 173 32.5) (option page1only) (justify center))
-  (tbtext %C2 (name text2:Text) (pos 167.5 22.5) (option page1only) (maxlen 22))
-  (tbtext Пров. (name text3:Text) (pos 184.5 22.5) (option page1only))
-  (tbtext Утв. (name text4:Text) (pos 184.5 2.5) (option page1only))
-  (tbtext Н.контр. (name text5:Text) (pos 184.5 7.5) (option page1only))
-  (tbtext Лит. (name text6:Text) (pos 42 37.5) (option page1only) (justify center))
-  (tbtext %C0 (name text7:Text) (pos 60 47.5) (option page1only) (font (size 5 5)) (justify center) (maxlen 119))
-  (tbtext %N (name text8:Text) (pos 8 17.5) (option page1only) (justify center))
-  (line (name segm26:Line) (start 185 15) (end 185 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm27:Line) (start 185 15) (end 0 15) (option notonpage1) (linewidth 0.6))
-  (tbtext %Y (name text9:Text) (pos 25 7) (option page1only) (justify center) (maxlen 49) (maxheight 14))
-  (tbtext %T (name text10:Text) (pos 85 27.5) (option page1only) (justify center) (maxlen 69) (maxheight 24))
-  (tbtext Листов (name text11:Text) (pos 29 17.5) (option page1only))
-  (tbtext %C0 (name text12:Text) (pos 47 7 ltcorner) (rotate 180) (font (size 3.5 3.5)) (justify center) (maxlen 69))
-  (tbtext %S (name text13:Text) (pos 35 17.5) (option page1only) (justify center))
-  (tbtext Лист (name text14:Text) (pos 49 17.5) (option page1only))
-  (line (name segm28:Line) (start 30 20) (end 30 15) (option page1only) (linewidth 0.6))
-  (tbtext Масштаб (name text15:Text) (pos 9 37.5) (option page1only) (justify center))
-  (tbtext Масса (name text16:Text) (pos 26.5 37.5) (option page1only) (justify center))
-  (tbtext %C3 (name text17:Text) (pos 167.5 2.5) (option page1only) (maxlen 22))
-  (tbtext %C1 (name text18:Text) (pos 167.5 27.5) (option page1only) (maxlen 22))
-  (tbtext Разраб. (name text19:Text) (pos 184.5 27.5) (option page1only))
-  (tbtext Дата (name text20:Text) (pos 125 32.5) (option page1only) (justify center))
-  (tbtext Подп. (name text21:Text) (pos 137 32.5) (option page1only) (justify center))
-  (tbtext "N докум." (name text22:Text) (pos 156.5 32.5) (option page1only) (justify center))
-  (tbtext Изм. (name text23:Text) (pos 181.5 32.5) (option page1only) (justify center) (maxlen 6.5))
-  (line (name segm29:Line) (start 0 287 lbcorner) (end 12 287 lbcorner) (option page1only) (linewidth 0.6) (repeat 3) (incry -60))
-  (tbtext Взам.инв.N (name text24:Text) (pos 2.5 72.5 lbcorner) (rotate 90) (justify center))
-  (tbtext Т.контр. (name text25:Text) (pos 184.5 17.5) (option page1only))
-  (tbtext "Подп. и дата" (name text26:Text) (pos 2.5 42.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Инв.N дубл." (name text27:Text) (pos 2.5 97.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Инв.N подл." (name text28:Text) (pos 2.5 12.5 lbcorner) (rotate 90) (justify center))
-  (line (name segm30:Line) (start 0 287 lbcorner) (end 0 167 lbcorner) (option page1only) (linewidth 0.6) (repeat 2) (incrx 5))
-  (tbtext "Подп. и дата" (name text29:Text) (pos 2.5 127.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Перв. примен." (name text30:Text) (pos 2.5 257 lbcorner) (option page1only) (rotate 90) (justify center))
-  (tbtext "Справ. N" (name text31:Text) (pos 2.5 197 lbcorner) (option page1only) (rotate 90) (justify center))
-  (tbtext %S (name text32:Text) (pos 5 4) (option notonpage1) (justify center))
-  (tbtext Лист (name text33:Text) (pos 5 11.5) (option notonpage1) (justify center))
-  (tbtext Копировал (name text34:Text) (pos 110 -2.5))
-  (tbtext "Формат %Z" (name text35:Text) (pos 40 -2.5))
-  (tbtext %C0 (name text36:Text) (pos 65 7.5) (option notonpage1) (font (size 5 5)) (justify center) (maxlen 109) (maxheight 14))
-  (tbtext Дата (name text37:Text) (pos 125 2.5) (option notonpage1) (justify center))
-  (tbtext Подп. (name text38:Text) (pos 137.5 2.5) (option notonpage1) (justify center))
-  (tbtext "N докум." (name text39:Text) (pos 156.5 2.5) (option notonpage1) (justify center))
-  (tbtext Лист (name text40:Text) (pos 173 2.5) (option notonpage1) (justify center))
-  (tbtext Изм. (name text41:Text) (pos 181.5 2.5) (option notonpage1) (justify center) (maxlen 6.5))
-  (line (name segm31:Line) (start 10 8) (end 0 8) (option notonpage1) (linewidth 0.6))
-  (line (name segm32:Line) (start 10 15) (end 10 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm33:Line) (start 185 10) (end 120 10) (option notonpage1))
-  (line (name segm34:Line) (start 185 5) (end 120 5) (option notonpage1) (linewidth 0.6))
-  (line (name segm35:Line) (start 120 15) (end 120 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm36:Line) (start 130 15) (end 130 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm37:Line) (start 145 15) (end 145 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm38:Line) (start 168 15) (end 168 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm39:Line) (start 178 15) (end 178 0) (option notonpage1) (linewidth 0.6))
+  (tbtext Лист (name text1:Text) (pos 173 32.5) (option page1only) (font italic) (justify center))
+  (tbtext %C2 (name text2:Text) (pos 167.5 22.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext Пров. (name text3:Text) (pos 184.5 22.5) (option page1only) (font italic))
+  (tbtext Утв. (name text4:Text) (pos 184.5 2.5) (option page1only) (font italic))
+  (tbtext Н.контр. (name text5:Text) (pos 184.5 7.5) (option page1only) (font italic))
+  (tbtext Лит. (name text6:Text) (pos 42 37.5) (option page1only) (font italic) (justify center))
+  (tbtext %C0 (name text7:Text) (pos 60 47.5) (option page1only) (font (linewidth 0.5) (size 5 5) italic) (justify center) (maxlen 119))
+  (tbtext %N (name text8:Text) (pos 8 17.5) (option page1only) (font italic) (justify center))
+  (line (name segm28:Line) (start 185 15) (end 185 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm29:Line) (start 185 15) (end 0 15) (option notonpage1) (linewidth 0.6))
+  (tbtext %Y (name text9:Text) (pos 25 7) (option page1only) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 48) (maxheight 14))
+  (tbtext %T (name text10:Text) (pos 85 27.5) (option page1only) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 67) (maxheight 22))
+  (tbtext Листов (name text11:Text) (pos 29 17.5) (option page1only) (font italic))
+  (tbtext %C0 (name text12:Text) (pos 47 7 ltcorner) (rotate 180) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 69))
+  (tbtext %S (name text13:Text) (pos 35 17.5) (option page1only) (font italic) (justify center))
+  (tbtext Лист (name text14:Text) (pos 49 17.5) (option page1only) (font italic))
+  (line (name segm30:Line) (start 30 20) (end 30 15) (option page1only) (linewidth 0.6))
+  (tbtext Масштаб (name text15:Text) (pos 9 37.5) (option page1only) (font italic) (justify center))
+  (tbtext Масса (name text16:Text) (pos 26.5 37.5) (option page1only) (font italic) (justify center))
+  (tbtext %C3 (name text17:Text) (pos 167.5 2.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext %C1 (name text18:Text) (pos 167.5 27.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext Разраб. (name text19:Text) (pos 184.5 27.5) (option page1only) (font italic))
+  (tbtext Дата (name text20:Text) (pos 125 32.5) (option page1only) (font italic) (justify center))
+  (tbtext Подп. (name text21:Text) (pos 137 32.5) (option page1only) (font italic) (justify center))
+  (tbtext N°докум. (name text22:Text) (pos 156.5 32.5) (option page1only) (font italic) (justify center))
+  (tbtext Изм. (name text23:Text) (pos 181.5 32.5) (option page1only) (font italic) (justify center) (maxlen 6.5))
+  (line (name segm31:Line) (start 0 287 lbcorner) (end 12 287 lbcorner) (option page1only) (linewidth 0.6) (repeat 3) (incry -60))
+  (tbtext Взам.инв.N° (name text24:Text) (pos 2.5 72.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Т.контр. (name text25:Text) (pos 184.5 17.5) (option page1only) (font italic))
+  (tbtext "Подп. и дата" (name text26:Text) (pos 2.5 42.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Инв.N°дубл. (name text27:Text) (pos 2.5 97.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Инв.N°подл. (name text28:Text) (pos 2.5 12.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (line (name segm32:Line) (start 0 287 lbcorner) (end 0 167 lbcorner) (option page1only) (linewidth 0.6) (repeat 2) (incrx 5))
+  (tbtext "Подп. и дата" (name text29:Text) (pos 2.5 127.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext "Перв. примен." (name text30:Text) (pos 2.5 257 lbcorner) (option page1only) (rotate 90) (font italic) (justify center))
+  (tbtext "Справ. N°" (name text31:Text) (pos 2.5 197 lbcorner) (option page1only) (rotate 90) (font italic) (justify center))
+  (tbtext %S (name text32:Text) (pos 5 4) (option notonpage1) (font italic) (justify center))
+  (tbtext Лист (name text33:Text) (pos 5 11.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Копировал (name text34:Text) (pos 110 -2.5) (font italic))
+  (tbtext "Формат %Z" (name text35:Text) (pos 40 -2.5) (font italic))
+  (tbtext %C0 (name text36:Text) (pos 65 7.5) (option notonpage1) (font (linewidth 0.5) (size 5 5) italic) (justify center) (maxlen 109) (maxheight 14))
+  (tbtext Дата (name text37:Text) (pos 125 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Подп. (name text38:Text) (pos 137.5 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext N°докум. (name text39:Text) (pos 156.5 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Лист (name text40:Text) (pos 173 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Изм. (name text41:Text) (pos 181.5 2.5) (option notonpage1) (font italic) (justify center) (maxlen 6.5))
+  (line (name segm33:Line) (start 10 8) (end 0 8) (option notonpage1) (linewidth 0.6))
+  (line (name segm34:Line) (start 10 15) (end 10 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm35:Line) (start 185 10) (end 120 10) (option notonpage1))
+  (line (name segm36:Line) (start 185 5) (end 120 5) (option notonpage1) (linewidth 0.6))
+  (line (name segm37:Line) (start 120 15) (end 120 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm38:Line) (start 130 15) (end 130 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm39:Line) (start 145 15) (end 145 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm40:Line) (start 168 15) (end 168 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm41:Line) (start 178 15) (end 178 0) (option notonpage1) (linewidth 0.6))
 )
diff --git a/template/gost_portrait.kicad_wks b/template/gost_portrait.kicad_wks
index 31358a27a..0c4fce665 100644
--- a/template/gost_portrait.kicad_wks
+++ b/template/gost_portrait.kicad_wks
@@ -1,5 +1,5 @@
-( page_layout
-  (setup(textsize 2.5 2.5)(linewidth 0.3)(textlinewidth 0.3)
+(page_layout
+  (setup (textsize 2.5 2.5)(linewidth 0.3)(textlinewidth 0.25)
   (left_margin 8)(right_margin 5)(top_margin 5)(bottom_margin 5))
   (line (name segm1:Line) (start 0 60 lbcorner) (end 12 60 lbcorner) (linewidth 0.6) (repeat 3) (incry 25))
   (line (name segm2:Line) (start 14 84 rtcorner) (end 0 84 rtcorner) (option page1only) (linewidth 0.6) (repeat 2) (incry 53))
@@ -17,69 +17,71 @@
   (line (name segm14:Line) (start 185 40) (end 120 40) (option page1only) (repeat 3) (incry 5))
   (line (name segm15:Line) (start 185 30) (end 120 30) (option page1only) (linewidth 0.6) (repeat 2) (incry 5))
   (line (name segm16:Line) (start 185 5) (end 120 5) (option page1only) (repeat 5) (incry 5))
-  (line (name segm17:Line) (start 185 55) (end 0 55) (option page1only) (linewidth 0.6))
-  (line (name segm18:Line) (start 0 145 lbcorner) (end 0 0 lbcorner) (linewidth 0.6) (repeat 2) (incrx 5))
-  (line (name segm19:Line) (start 45 35) (end 45 20) (option page1only) (repeat 2) (incrx -5))
-  (line (name segm20:Line) (start 35 40) (end 35 20) (option page1only) (linewidth 0.6) (repeat 2) (incrx -17))
-  (line (name segm21:Line) (start 50 20) (end 0 20) (option page1only) (linewidth 0.6) (repeat 2) (incry 15))
-  (line (name segm22:Line) (start 50 40) (end 50 0) (option page1only) (linewidth 0.6))
-  (line (name segm23:Line) (start 120 15) (end 0 15) (option page1only) (linewidth 0.6))
-  (line (name segm24:Line) (start 120 40) (end 0 40) (option page1only) (linewidth 0.6))
-  (line (name segm25:Line) (start 185 0) (end 185 55) (option page1only) (linewidth 0.6))
+  (line (name segm17:Line) (start 120 63) (end 0 63) (option page1only) (linewidth 0.6))
+  (line (name segm18:Line) (start 120 55) (end 120 63) (option page1only) (linewidth 0.6))
+  (line (name segm19:Line) (start 185 55) (end 0 55) (option page1only) (linewidth 0.6))
+  (line (name segm20:Line) (start 0 145 lbcorner) (end 0 0 lbcorner) (linewidth 0.6) (repeat 2) (incrx 5))
+  (line (name segm21:Line) (start 45 35) (end 45 20) (option page1only) (repeat 2) (incrx -5))
+  (line (name segm22:Line) (start 35 40) (end 35 20) (option page1only) (linewidth 0.6) (repeat 2) (incrx -17))
+  (line (name segm23:Line) (start 50 20) (end 0 20) (option page1only) (linewidth 0.6) (repeat 2) (incry 15))
+  (line (name segm24:Line) (start 50 40) (end 50 0) (option page1only) (linewidth 0.6))
+  (line (name segm25:Line) (start 120 15) (end 0 15) (option page1only) (linewidth 0.6))
+  (line (name segm26:Line) (start 120 40) (end 0 40) (option page1only) (linewidth 0.6))
+  (line (name segm27:Line) (start 185 0) (end 185 55) (option page1only) (linewidth 0.6))
   (rect (name rect1:Rect) (start 12 0 lbcorner) (end 0 0 rtcorner) (linewidth 0.6))
-  (tbtext Лист (name text1:Text) (pos 173 32.5) (option page1only) (justify center))
-  (tbtext %C2 (name text2:Text) (pos 167.5 22.5) (option page1only) (maxlen 22))
-  (tbtext Пров. (name text3:Text) (pos 184.5 22.5) (option page1only))
-  (tbtext Утв. (name text4:Text) (pos 184.5 2.5) (option page1only))
-  (tbtext Н.контр. (name text5:Text) (pos 184.5 7.5) (option page1only))
-  (tbtext Лит. (name text6:Text) (pos 42 37.5) (option page1only) (justify center))
-  (tbtext %C0 (name text7:Text) (pos 60 47.5) (option page1only) (font (size 5 5)) (justify center) (maxlen 119))
-  (tbtext %N (name text8:Text) (pos 8 17.5) (option page1only) (justify center))
-  (line (name segm26:Line) (start 185 15) (end 185 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm27:Line) (start 185 15) (end 0 15) (option notonpage1) (linewidth 0.6))
-  (tbtext %Y (name text9:Text) (pos 25 7) (option page1only) (justify center) (maxlen 49) (maxheight 14))
-  (tbtext %T (name text10:Text) (pos 85 27.5) (option page1only) (justify center) (maxlen 69) (maxheight 24))
-  (tbtext Листов (name text11:Text) (pos 29 17.5) (option page1only))
-  (tbtext %C0 (name text12:Text) (pos 7 35 rtcorner) (rotate 270) (font (size 3.5 3.5)) (justify center) (maxlen 69))
-  (tbtext %S (name text13:Text) (pos 35 17.5) (option page1only) (justify center))
-  (tbtext Лист (name text14:Text) (pos 49 17.5) (option page1only))
-  (line (name segm28:Line) (start 30 20) (end 30 15) (option page1only) (linewidth 0.6))
-  (tbtext Масштаб (name text15:Text) (pos 9 37.5) (option page1only) (justify center))
-  (tbtext Масса (name text16:Text) (pos 26.5 37.5) (option page1only) (justify center))
-  (tbtext %C3 (name text17:Text) (pos 167.5 2.5) (option page1only) (maxlen 22))
-  (tbtext %C1 (name text18:Text) (pos 167.5 27.5) (option page1only) (maxlen 22))
-  (tbtext Разраб. (name text19:Text) (pos 184.5 27.5) (option page1only))
-  (tbtext Дата (name text20:Text) (pos 125 32.5) (option page1only) (justify center))
-  (tbtext Подп. (name text21:Text) (pos 137 32.5) (option page1only) (justify center))
-  (tbtext "N докум." (name text22:Text) (pos 156.5 32.5) (option page1only) (justify center))
-  (tbtext Изм. (name text23:Text) (pos 181.5 32.5) (option page1only) (justify center) (maxlen 6.5))
-  (line (name segm29:Line) (start 0 287 lbcorner) (end 12 287 lbcorner) (option page1only) (linewidth 0.6) (repeat 3) (incry -60))
-  (tbtext Взам.инв.N (name text24:Text) (pos 2.5 72.5 lbcorner) (rotate 90) (justify center))
-  (tbtext Т.контр. (name text25:Text) (pos 184.5 17.5) (option page1only))
-  (tbtext "Подп. и дата" (name text26:Text) (pos 2.5 42.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Инв.N дубл." (name text27:Text) (pos 2.5 97.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Инв.N подл." (name text28:Text) (pos 2.5 12.5 lbcorner) (rotate 90) (justify center))
-  (line (name segm30:Line) (start 0 287 lbcorner) (end 0 167 lbcorner) (option page1only) (linewidth 0.6) (repeat 2) (incrx 5))
-  (tbtext "Подп. и дата" (name text29:Text) (pos 2.5 127.5 lbcorner) (rotate 90) (justify center))
-  (tbtext "Перв. примен." (name text30:Text) (pos 2.5 257 lbcorner) (option page1only) (rotate 90) (justify center))
-  (tbtext "Справ. N" (name text31:Text) (pos 2.5 197 lbcorner) (option page1only) (rotate 90) (justify center))
-  (tbtext %S (name text32:Text) (pos 5 4) (option notonpage1) (justify center))
-  (tbtext Лист (name text33:Text) (pos 5 11.5) (option notonpage1) (justify center))
-  (tbtext Копировал (name text34:Text) (pos 110 -2.5))
-  (tbtext "Формат %Z" (name text35:Text) (pos 40 -2.5))
-  (tbtext %C0 (name text36:Text) (pos 65 7.5) (option notonpage1) (font (size 5 5)) (justify center) (maxlen 109) (maxheight 14))
-  (tbtext Дата (name text37:Text) (pos 125 2.5) (option notonpage1) (justify center))
-  (tbtext Подп. (name text38:Text) (pos 137.5 2.5) (option notonpage1) (justify center))
-  (tbtext "N докум." (name text39:Text) (pos 156.5 2.5) (option notonpage1) (justify center))
-  (tbtext Лист (name text40:Text) (pos 173 2.5) (option notonpage1) (justify center))
-  (tbtext Изм. (name text41:Text) (pos 181.5 2.5) (option notonpage1) (justify center) (maxlen 6.5))
-  (line (name segm31:Line) (start 10 8) (end 0 8) (option notonpage1) (linewidth 0.6))
-  (line (name segm32:Line) (start 10 15) (end 10 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm33:Line) (start 185 10) (end 120 10) (option notonpage1))
-  (line (name segm34:Line) (start 185 5) (end 120 5) (option notonpage1) (linewidth 0.6))
-  (line (name segm35:Line) (start 120 15) (end 120 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm36:Line) (start 130 15) (end 130 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm37:Line) (start 145 15) (end 145 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm38:Line) (start 168 15) (end 168 0) (option notonpage1) (linewidth 0.6))
-  (line (name segm39:Line) (start 178 15) (end 178 0) (option notonpage1) (linewidth 0.6))
+  (tbtext Лист (name text1:Text) (pos 173 32.5) (option page1only) (font italic) (justify center))
+  (tbtext %C2 (name text2:Text) (pos 167.5 22.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext Пров. (name text3:Text) (pos 184.5 22.5) (option page1only) (font italic))
+  (tbtext Утв. (name text4:Text) (pos 184.5 2.5) (option page1only) (font italic))
+  (tbtext Н.контр. (name text5:Text) (pos 184.5 7.5) (option page1only) (font italic))
+  (tbtext Лит. (name text6:Text) (pos 42 37.5) (option page1only) (font italic) (justify center))
+  (tbtext %C0 (name text7:Text) (pos 60 47.5) (option page1only) (font (linewidth 0.5) (size 5 5) italic) (justify center) (maxlen 119))
+  (tbtext %N (name text8:Text) (pos 8 17.5) (option page1only) (font italic) (justify center))
+  (line (name segm28:Line) (start 185 15) (end 185 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm29:Line) (start 185 15) (end 0 15) (option notonpage1) (linewidth 0.6))
+  (tbtext %Y (name text9:Text) (pos 25 7) (option page1only) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 48) (maxheight 14))
+  (tbtext %T (name text10:Text) (pos 85 27.5) (option page1only) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 67) (maxheight 22))
+  (tbtext Листов (name text11:Text) (pos 29 17.5) (option page1only) (font italic))
+  (tbtext %C0 (name text12:Text) (pos 7 35 rtcorner) (rotate 90) (font (linewidth 0.35) (size 3.5 3.5) italic) (justify center) (maxlen 69))
+  (tbtext %S (name text13:Text) (pos 35 17.5) (option page1only) (font italic) (justify center))
+  (tbtext Лист (name text14:Text) (pos 49 17.5) (option page1only) (font italic))
+  (line (name segm30:Line) (start 30 20) (end 30 15) (option page1only) (linewidth 0.6))
+  (tbtext Масштаб (name text15:Text) (pos 9 37.5) (option page1only) (font italic) (justify center))
+  (tbtext Масса (name text16:Text) (pos 26.5 37.5) (option page1only) (font italic) (justify center))
+  (tbtext %C3 (name text17:Text) (pos 167.5 2.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext %C1 (name text18:Text) (pos 167.5 27.5) (option page1only) (font italic) (maxlen 21.5))
+  (tbtext Разраб. (name text19:Text) (pos 184.5 27.5) (option page1only) (font italic))
+  (tbtext Дата (name text20:Text) (pos 125 32.5) (option page1only) (font italic) (justify center))
+  (tbtext Подп. (name text21:Text) (pos 137 32.5) (option page1only) (font italic) (justify center))
+  (tbtext N°докум. (name text22:Text) (pos 156.5 32.5) (option page1only) (font italic) (justify center))
+  (tbtext Изм. (name text23:Text) (pos 181.5 32.5) (option page1only) (font italic) (justify center) (maxlen 6.5))
+  (line (name segm31:Line) (start 0 287 lbcorner) (end 12 287 lbcorner) (option page1only) (linewidth 0.6) (repeat 3) (incry -60))
+  (tbtext Взам.инв.N° (name text24:Text) (pos 2.5 72.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Т.контр. (name text25:Text) (pos 184.5 17.5) (option page1only) (font italic))
+  (tbtext "Подп. и дата" (name text26:Text) (pos 2.5 42.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Инв.N°дубл. (name text27:Text) (pos 2.5 97.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext Инв.N°подл. (name text28:Text) (pos 2.5 12.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (line (name segm32:Line) (start 0 287 lbcorner) (end 0 167 lbcorner) (option page1only) (linewidth 0.6) (repeat 2) (incrx 5))
+  (tbtext "Подп. и дата" (name text29:Text) (pos 2.5 127.5 lbcorner) (rotate 90) (font italic) (justify center))
+  (tbtext "Перв. примен." (name text30:Text) (pos 2.5 257 lbcorner) (option page1only) (rotate 90) (font italic) (justify center))
+  (tbtext "Справ. N°" (name text31:Text) (pos 2.5 197 lbcorner) (option page1only) (rotate 90) (font italic) (justify center))
+  (tbtext %S (name text32:Text) (pos 5 4) (option notonpage1) (font italic) (justify center))
+  (tbtext Лист (name text33:Text) (pos 5 11.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Копировал (name text34:Text) (pos 110 -2.5) (font italic))
+  (tbtext "Формат %Z" (name text35:Text) (pos 40 -2.5) (font italic))
+  (tbtext %C0 (name text36:Text) (pos 65 7.5) (option notonpage1) (font (linewidth 0.5) (size 5 5) italic) (justify center) (maxlen 109) (maxheight 14))
+  (tbtext Дата (name text37:Text) (pos 125 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Подп. (name text38:Text) (pos 137.5 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext N°докум. (name text39:Text) (pos 156.5 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Лист (name text40:Text) (pos 173 2.5) (option notonpage1) (font italic) (justify center))
+  (tbtext Изм. (name text41:Text) (pos 181.5 2.5) (option notonpage1) (font italic) (justify center) (maxlen 6.5))
+  (line (name segm33:Line) (start 10 8) (end 0 8) (option notonpage1) (linewidth 0.6))
+  (line (name segm34:Line) (start 10 15) (end 10 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm35:Line) (start 185 10) (end 120 10) (option notonpage1))
+  (line (name segm36:Line) (start 185 5) (end 120 5) (option notonpage1) (linewidth 0.6))
+  (line (name segm37:Line) (start 120 15) (end 120 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm38:Line) (start 130 15) (end 130 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm39:Line) (start 145 15) (end 145 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm40:Line) (start 168 15) (end 168 0) (option notonpage1) (linewidth 0.6))
+  (line (name segm41:Line) (start 178 15) (end 178 0) (option notonpage1) (linewidth 0.6))
 )
-- 
2.11.0

>From 699ba838b2ef25bbf318684ac99839e456116f78 Mon Sep 17 00:00:00 2001
From: jp-charras <jp.charras@xxxxxxxxxx>
Date: Sat, 10 Sep 2016 17:16:48 +0200
Subject: [PATCH 1/3] Fixes: lp:1622184 (pl-editor doesn't save text thickness
 when it is not the default value)
 https://bugs.launchpad.net/kicad/+bug/1622184

---
 pagelayout_editor/page_layout_writer.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pagelayout_editor/page_layout_writer.cpp b/pagelayout_editor/page_layout_writer.cpp
index bb427afaf..1ddba509e 100644
--- a/pagelayout_editor/page_layout_writer.cpp
+++ b/pagelayout_editor/page_layout_writer.cpp
@@ -239,11 +239,18 @@ void WORKSHEET_LAYOUT_IO::format( WORKSHEET_DATAITEM_TEXT* aItem, int aNestLevel
 
     // Write font info, only if it is not the default setup
     bool write_size = aItem->m_TextSize.x != 0.0 || aItem->m_TextSize.y != 0.0;
+    bool write_thickness = aItem->m_LineWidth != 0.0;
 
-    if( write_size || aItem->IsBold() || aItem->IsItalic() )
+    if( write_thickness || write_size || aItem->IsBold() || aItem->IsItalic() )
     {
         m_out->Print( 0, " (%s", getTokenName( T_font ) );
 
+        if( write_thickness )
+        {
+            m_out->Print( 0, " (%s %s)", getTokenName( T_linewidth ),
+                          double2Str(aItem->m_LineWidth ).c_str() );
+        }
+
         if( write_size )
         {
             m_out->Print( 0, " (%s %s %s)", getTokenName( T_size ),
-- 
2.11.0


Follow ups