Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-27 Thread Eldar Khayrullin
Ok, thank  
![](https://link.nylas.com/open/ac7n0u7eu8cj6vjow9ajimqdr/f6336e079ac1460f986e
5049e943e593)

> On Feb 27 2016, at 8:35 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>

> Patches 1-3 committed in product branch r6594. Thank you for your  
contribution to KiCad.

>

> On 2/27/2016 5:36 AM, Eldar Khayrullin wrote:  
 Hello. Patch that fix a size and a proportional of font.  
  
 On Feb 26 2016, at 8:18 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 Add patch for carret return symbol in text  
  
 On Feb 25 2016, at 10:36 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 Next I will fix some other import bugs:  
  
 * carret return symbol \r - ?  
 * size and proportional of text  
 * etc  
  
 On Feb 25 2016, at 10:30 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 Patch for position text with only justify from imported  
 file. More accuary.  
  
 On Feb 25 2016, at 9:05 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 And it apply only for free text not to refdes and value...  
  
 On Feb 25 2016, at 9:01 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 I find that I can select horizontal and vertical  
 justification of Kicad text but vertical justify  
 don't accessible from GUI. Can I use vertical justify?  
  
 On Feb 25 2016, at 7:02 pm, Eldar Khayrullin  
 eldar.khayrul...@mail.ru wrote:  
 I think about this. But in the begining I'll try  
 to use easy way: using parametr 'extent' and  
 calculate more pretty scale from PCAD to Kicad  
 height and width  
  
 On Feb 25 2016, at 2:59 am, Piotr  
 Esden-Tempski pi...@esden.net wrote:  
 Regarding variable width font. I ran into  
 the issue when I was trying to generate  
 symbols for KiCad. To solve it I have  
 generated a table with glyph widths from the  
 C code used in KiCad itself. You can find my  
 python table  
 here: https://github.com/esden/stm32-kicad-
lib/blob/master/script/kicadlibgen.py  
  
 You might need to rescale the font size to  
 match the KiCad font. So if you had a  
 similar glyph size table for the PCAD font  
 you might be able to generate the new text  
 to fit into the same space as the original.  
  
 I hope this is helpful in some way.  
  
 If you want the code that I used to generate  
 the glyph width table with let me know.  
  
 Cheers,  
 Esden  
  
  
 On Feb 24, 2016, at 9:57 AM, Eldar  
 Khayrullin eldar.khayrul...@mail.ru  
 mailto:eldar.khayrul...@mail.ru; wrote:  
  
 Ok, glad to help.  
  
 On Feb 24 2016, at 8:55 pm, Wayne  
 Stambaugh stambau...@gmail.com  
 mailto:stambau...@gmail.com; wrote:  
  
 If the differences are due to variable  
 font width issues then there is  
 not much we can do about that. Thanks  
 for fixing this.  
  
 On 2/24/2016 11:57 AM, Eldar  
 Khayrullin wrote:  
  PCAD stroke font isn't fixed width  
 font and KiCad font too.  
  I look for possible and try to solve  
 this with more easy way  
   
  On Feb 24 2016, at 7:51 pm, Wayne  
 Stambaugh stambau...@gmail.com  
 mailto:stambau...@gmail.com;  
  wrote:  
   
  Eldar,  
   
  Are you planning on actually  
 determining the appropriate PCAD units for  
  text so that this can be converted  
 accurately? While you patch makes  
  things better, I would prefer that  
 we convert boards as accurately as  
  possible. I know we don't handle  
 different fonts but there should be no  
  reason not to get the text position,  
 height, and with correct.  
   
  Wayne  
   
  On 2/24/2016 11:34 AM, Eldar  
 Khayrullin wrote:  
   Thank you. Not ideal yet, but more  
 truely  

   On Feb 24 2016, at 3:00 pm, jp  
 charras jp.char...@wanadoo.fr  
 mailto:jp.char...@wanadoo.fr; wrote:  

   Le 23/02/2016 13:36, Eldar  
 Khayrullin a écrit :  
Result  
 
On Feb 23 2016, at 3:29 pm,  
 Eldar Khayrullin  
lt;eldar.khayrul...@mail.ru  
 mailto:eldar.khayrul...@mail.rugt;  
 wrote:  
Apply Justify of text and  
 flipped flag of text from import file.  

   I committed your patches.  
   AFAIK, they look good for me.  
   Thanks.  


   \--  
   Jean-Pierre CHARRAS  


 ___  
   Mailing list:  
 https://launchpad.net/~kicad-developers  
   Post to :  
 kicad-developers@lists.launchpad.net  
 mailto:kicad-developers@lists.launchpad.net;  
   Unsubscribe :  
 https://launchpad.net/~kicad-developers  
   More help :  
 https://help.launchpad.net/ListHelp  




 ___  
   Mailing list:  
 https://launchpad.net/~kicad-developers  
   Post to :  
 kicad-developers@lists.launchpad.net  
 mailto:kicad-developers@lists.launchpad.net;  
   Unsubscribe :  
 https://launchpad.net/~kicad-developers  
   More help :  
 https://help.launchpad.net/ListHelp  

   
   
 ___  
  Mailing list:  
 https://launchpad.net/~kicad-developers  
  Post to :  
 kicad-developers@lists.launchpad.net  
 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-27 Thread Wayne Stambaugh
Patches 1-3 committed in product branch r6594.  Thank you for your
contribution to KiCad.

On 2/27/2016 5:36 AM, Eldar Khayrullin wrote:
> Hello. Patch that fix a size and a proportional of font.
> 
> On Feb 26 2016, at 8:18 pm, Eldar Khayrullin
>  wrote:
> Add patch for carret return symbol in text
> 
> On Feb 25 2016, at 10:36 pm, Eldar Khayrullin
>  wrote:
> Next I will fix some other import bugs: 
> 
>   * carret return symbol \r -> ?
>   * size and proportional of text
>   * etc
> 
> On Feb 25 2016, at 10:30 pm, Eldar Khayrullin
>  wrote:
> Patch for position text with only justify from imported
> file. More accuary.
> 
> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
>  wrote:
> And it apply only for free text not to refdes and value...
> 
> On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
>  wrote:
> I find that I can select horizontal and vertical
> justification of Kicad text but vertical justify
> don't accessible from GUI. Can I use vertical justify? 
> 
> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
>  wrote:
> I think about this. But in the begining I'll try
> to use easy way: using parametr 'extent' and
> calculate more pretty scale from PCAD to Kicad
> height and width
> 
> On Feb 25 2016, at 2:59 am, Piotr
> Esden-Tempski  wrote:
> Regarding variable width font. I ran into
> the issue when I was trying to generate
> symbols for KiCad. To solve it I have
> generated a table with glyph widths from the
> C code used in KiCad itself. You can find my
> python table
> here: 
> https://github.com/esden/stm32-kicad-lib/blob/master/script/kicadlibgen.py
> 
> You might need to rescale the font size to
> match the KiCad font. So if you had a
> similar glyph size table for the PCAD font
> you might be able to generate the new text
> to fit into the same space as the original.
> 
> I hope this is helpful in some way.
> 
> If you want the code that I used to generate
> the glyph width table with let me know.
> 
> Cheers,
> Esden
> 
> 
>> On Feb 24, 2016, at 9:57 AM, Eldar
>> Khayrullin > > wrote:
>>
>> Ok, glad to help.
>>
>> On Feb 24 2016, at 8:55 pm, Wayne
>> Stambaugh > > wrote:
>>
>> If the differences are due to variable
>> font width issues then there is
>> not much we can do about that. Thanks
>> for fixing this.
>>
>> On 2/24/2016 11:57 AM, Eldar
>> Khayrullin wrote:
>> > PCAD stroke font isn't fixed width
>> font and KiCad font too.
>> > I look for possible and try to solve
>> this with more easy way
>> >
>> > On Feb 24 2016, at 7:51 pm, Wayne
>> Stambaugh > >
>> > wrote:
>> >
>> > Eldar,
>> >
>> > Are you planning on actually
>> determining the appropriate PCAD units for
>> > text so that this can be converted
>> accurately? While you patch makes
>> > things better, I would prefer that
>> we 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-27 Thread Eldar Khayrullin
Previous patch is last patch in my set  
![](https://link.nylas.com/open/ac7n0u7eu8cj6vjow9ajimqdr/65482b56586c4b9dbb43
fab2a8f405b2)

> On Feb 27 2016, at 1:36 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Hello. Patch that fix a size and a proportional of font.  
![](https://link.nylas.com/open/ac7n0u7eu8cj6vjow9ajimqdr/019b9ecac7464751a90d
673f85ca7ca6)

>

>> On Feb 26 2016, at 8:18 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Add patch for carret return symbol in text

>>

>>> On Feb 25 2016, at 10:36 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Next I will fix some other import bugs:

>>>

>>>   * carret return symbol \r - ?

>>>   * size and proportional of text

>>>   * etc

>>>

 On Feb 25 2016, at 10:30 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Patch for position text with only justify from imported file. More accuary.



> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
And it apply only for free text not to refdes and value...

>

>> On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?

>>

>>> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>>>

 On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski
pi...@esden.net wrote:  



 Regarding variable width font. I ran into the issue when I was trying
to generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 



  



 You might need to rescale the font size to match the KiCad font. So
if you had a similar glyph size table for the PCAD font you might be able to
generate the new text to fit into the same space as the original.



  



 I hope this is helpful in some way.



  



 If you want the code that I used to generate the glyph width table
with let me know.



  



 Cheers,



 Esden



  



  



> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>

>  

>

> Ok, glad to help.  

>

>> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  

>>

>> If the differences are due to variable font width issues then there
is  
not much we can do about that. Thanks for fixing this.

>>

>> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-26 Thread Eldar Khayrullin
Add patch for carret return symbol in text

> On Feb 25 2016, at 10:36 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Next I will fix some other import bugs:

>

>   * carret return symbol \r - ?

>   * size and proportional of text

>   * etc

>

>> On Feb 25 2016, at 10:30 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Patch for position text with only justify from imported file. More accuary.

>>

>>> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
And it apply only for free text not to refdes and value...

>>>

 On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?



> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>

>> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>>

>> Regarding variable width font. I ran into the issue when I was trying
to generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>>

>>  

>>

>> You might need to rescale the font size to match the KiCad font. So if
you had a similar glyph size table for the PCAD font you might be able to
generate the new text to fit into the same space as the original.

>>

>>  

>>

>> I hope this is helpful in some way.

>>

>>  

>>

>> If you want the code that I used to generate the glyph width table with
let me know.

>>

>>  

>>

>> Cheers,

>>

>> Esden

>>

>>  

>>

>>  

>>

>>> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>>>

>>>  

>>>

>>> Ok, glad to help.  

>>>

 On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  



 If the differences are due to variable font width issues then there
is  
not much we can do about that. Thanks for fixing this.



 On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>>>

>>> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe : 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-25 Thread Eldar Khayrullin
Patch for position text with only justify from imported file. More accuary.

> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
And it apply only for free text not to refdes and value...

>

>> On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?

>>

>>> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>>>

 On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  



 Regarding variable width font. I ran into the issue when I was trying to
generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 



  



 You might need to rescale the font size to match the KiCad font. So if
you had a similar glyph size table for the PCAD font you might be able to
generate the new text to fit into the same space as the original.



  



 I hope this is helpful in some way.



  



 If you want the code that I used to generate the glyph width table with
let me know.



  



 Cheers,



 Esden



  



  



> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>

>  

>

> Ok, glad to help.  

>

>> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  

>>

>> If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.

>>

>> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>

> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe :   
More help   :   



  

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-25 Thread Eldar Khayrullin
Next I will fix some other import bugs:

  * carret return symbol \r - ?
  * size and proportional of text
  * etc

> On Feb 25 2016, at 10:30 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Patch for position text with only justify from imported file. More accuary.

>

>> On Feb 25 2016, at 9:05 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
And it apply only for free text not to refdes and value...

>>

>>> On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?

>>>

 On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  



> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>

> Regarding variable width font. I ran into the issue when I was trying to
generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>

>  

>

> You might need to rescale the font size to match the KiCad font. So if
you had a similar glyph size table for the PCAD font you might be able to
generate the new text to fit into the same space as the original.

>

>  

>

> I hope this is helpful in some way.

>

>  

>

> If you want the code that I used to generate the glyph width table with
let me know.

>

>  

>

> Cheers,

>

> Esden

>

>  

>

>  

>

>> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>>

>>  

>>

>> Ok, glad to help.  

>>

>>> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  

>>>

>>> If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.

>>>

>>> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>>

>> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe :   
More help   :   

>

>  

___
Mailing list: 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-25 Thread Eldar Khayrullin
And it apply only for free text not to refdes and value...

> On Feb 25 2016, at 9:01 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?

>

>> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>>

>>> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>>>

>>> Regarding variable width font. I ran into the issue when I was trying to
generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>>>

>>>  

>>>

>>> You might need to rescale the font size to match the KiCad font. So if you
had a similar glyph size table for the PCAD font you might be able to generate
the new text to fit into the same space as the original.

>>>

>>>  

>>>

>>> I hope this is helpful in some way.

>>>

>>>  

>>>

>>> If you want the code that I used to generate the glyph width table with
let me know.

>>>

>>>  

>>>

>>> Cheers,

>>>

>>> Esden

>>>

>>>  

>>>

>>>  

>>>

 On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:



  



 Ok, glad to help.  



> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  

>

> If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.

>

> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   




 ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe :   
More help   :   

>>>

>>>  

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-25 Thread Eldar Khayrullin
I find that I can select horizontal and vertical justification of Kicad text
but vertical justify don't accessible from GUI. Can I use vertical justify?

> On Feb 25 2016, at 7:02 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

>

>> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>>

>> Regarding variable width font. I ran into the issue when I was trying to
generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>>

>>  

>>

>> You might need to rescale the font size to match the KiCad font. So if you
had a similar glyph size table for the PCAD font you might be able to generate
the new text to fit into the same space as the original.

>>

>>  

>>

>> I hope this is helpful in some way.

>>

>>  

>>

>> If you want the code that I used to generate the glyph width table with let
me know.

>>

>>  

>>

>> Cheers,

>>

>> Esden

>>

>>  

>>

>>  

>>

>>> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>>>

>>>  

>>>

>>> Ok, glad to help.  

>>>

 On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  



 If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.



 On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>>>

>>> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe :   
More help   :   

>>

>>  

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-25 Thread Eldar Khayrullin
I think about this. But in the begining I'll try to use easy way: using
parametr 'extent' and calculate more pretty scale from PCAD to Kicad height
and width  

> On Feb 25 2016, at 2:59 am, Piotr Esden-Tempski pi...@esden.net
wrote:  

>

> Regarding variable width font. I ran into the issue when I was trying to
generate symbols for KiCad. To solve it I have generated a table with glyph
widths from the C code used in KiCad itself. You can find my python table
here: 

>

>  

>

> You might need to rescale the font size to match the KiCad font. So if you
had a similar glyph size table for the PCAD font you might be able to generate
the new text to fit into the same space as the original.

>

>  

>

> I hope this is helpful in some way.

>

>  

>

> If you want the code that I used to generate the glyph width table with let
me know.

>

>  

>

> Cheers,

>

> Esden

>

>  

>

>  

>

>> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin
[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru) wrote:

>>

>>  

>>

>> Ok, glad to help.  

>>

>>> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com) wrote:  

>>>

>>> If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.

>>>

>>> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh
[stambau...@gmail.com](mailto:stambau...@gmail.com)  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras
[jp.char...@wanadoo.fr](mailto:jp.char...@wanadoo.fr) wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  
lt;[eldar.khayrul...@mail.ru](mailto:eldar.khayrul...@mail.ru)gt;
wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
   
   
  ___  
  Mailing list:   
  Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
  Unsubscribe :   
  More help :   
   
  
 ___  
 Mailing list:   
 Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
 Unsubscribe :   
 More help :   


>>

>> ___  
Mailing list:   
Post to : [kicad-developers@lists.launchpad.net](mailto:kicad-
develop...@lists.launchpad.net)  
Unsubscribe :   
More help   :   

>

>  

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Piotr Esden-Tempski
Regarding variable width font. I ran into the issue when I was trying to 
generate symbols for KiCad. To solve it I have generated a table with glyph 
widths from the C code used in KiCad itself. You can find my python table here: 
https://github.com/esden/stm32-kicad-lib/blob/master/script/kicadlibgen.py 


You might need to rescale the font size to match the KiCad font. So if you had 
a similar glyph size table for the PCAD font you might be able to generate the 
new text to fit into the same space as the original.

I hope this is helpful in some way.

If you want the code that I used to generate the glyph width table with let me 
know.

Cheers,
Esden


> On Feb 24, 2016, at 9:57 AM, Eldar Khayrullin  
> wrote:
> 
> Ok, glad to help.
> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh  wrote: 
> If the differences are due to variable font width issues then there is
> not much we can do about that. Thanks for fixing this.
> 
> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:
> > PCAD stroke font isn't fixed width font and KiCad font too.
> > I look for possible and try to solve this with more easy way
> > 
> > On Feb 24 2016, at 7:51 pm, Wayne Stambaugh 
> > wrote:
> > 
> > Eldar,
> > 
> > Are you planning on actually determining the appropriate PCAD units for
> > text so that this can be converted accurately? While you patch makes
> > things better, I would prefer that we convert boards as accurately as
> > possible. I know we don't handle different fonts but there should be no
> > reason not to get the text position, height, and with correct.
> > 
> > Wayne
> > 
> > On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:
> > > Thank you. Not ideal yet, but more truely
> > >
> > > On Feb 24 2016, at 3:00 pm, jp charras  wrote:
> > >
> > > Le 23/02/2016 13:36, Eldar Khayrullin a écrit :
> > > > Result
> > > >
> > > >> On Feb 23 2016, at 3:29 pm, Eldar Khayrullin
> > > > eldar.khayrul...@mail.ru wrote:
> > > > Apply Justify of text and flipped flag of text from import file.
> > >
> > > I committed your patches.
> > > AFAIK, they look good for me.
> > > Thanks.
> > >
> > >
> > > --
> > > Jean-Pierre CHARRAS
> > >
> > > ___
> > > Mailing list: https://launchpad.net/~kicad-developers
> > > Post to : kicad-developers@lists.launchpad.net
> > > Unsubscribe : https://launchpad.net/~kicad-developers
> > > More help : https://help.launchpad.net/ListHelp
> > >
> > >
> > >
> > > ___
> > > Mailing list: https://launchpad.net/~kicad-developers
> > > Post to : kicad-developers@lists.launchpad.net
> > > Unsubscribe : https://launchpad.net/~kicad-developers
> > > More help : https://help.launchpad.net/ListHelp
> > >
> > 
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help : https://help.launchpad.net/ListHelp
> >
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Eldar Khayrullin
Ok, glad to help.  

> On Feb 24 2016, at 8:55 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>

> If the differences are due to variable font width issues then there is  
not much we can do about that. Thanks for fixing this.

>

> On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:  
 PCAD stroke font isn't fixed width font and KiCad font too.  
 I look for possible and try to solve this with more easy way  
  
 On Feb 24 2016, at 7:51 pm, Wayne Stambaugh stambau...@gmail.com  
 wrote:  
  
 Eldar,  
  
 Are you planning on actually determining the appropriate PCAD units for  
 text so that this can be converted accurately? While you patch makes  
 things better, I would prefer that we convert boards as accurately as  
 possible. I know we don't handle different fonts but there should be no  
 reason not to get the text position, height, and with correct.  
  
 Wayne  
  
 On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
  Thank you. Not ideal yet, but more truely  
   
  On Feb 24 2016, at 3:00 pm, jp charras jp.char...@wanadoo.fr
wrote:  
   
  Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
   Result  

   On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
   lt;eldar.khayrul...@mail.rugt; wrote:  
   Apply Justify of text and flipped flag of text from import
file.  
   
  I committed your patches.  
  AFAIK, they look good for me.  
  Thanks.  
   
   
  \--  
  Jean-Pierre CHARRAS  
   
  ___  
  Mailing list: https://launchpad.net/~kicad-developers  
  Post to : kicad-developers@lists.launchpad.net  
  Unsubscribe : https://launchpad.net/~kicad-developers  
  More help : https://help.launchpad.net/ListHelp  
   
   
   
  ___  
  Mailing list: https://launchpad.net/~kicad-developers  
  Post to : kicad-developers@lists.launchpad.net  
  Unsubscribe : https://launchpad.net/~kicad-developers  
  More help : https://help.launchpad.net/ListHelp  
   
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Wayne Stambaugh
If the differences are due to variable font width issues then there is
not much we can do about that.  Thanks for fixing this.

On 2/24/2016 11:57 AM, Eldar Khayrullin wrote:
> PCAD stroke font isn't fixed width font and KiCad font too.
> I look for possible and try to solve this with more easy way
> 
> On Feb 24 2016, at 7:51 pm, Wayne Stambaugh 
> wrote:
> 
> Eldar,
> 
> Are you planning on actually determining the appropriate PCAD units for
> text so that this can be converted accurately? While you patch makes
> things better, I would prefer that we convert boards as accurately as
> possible. I know we don't handle different fonts but there should be no
> reason not to get the text position, height, and with correct.
> 
> Wayne
> 
> On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:
> > Thank you. Not ideal yet, but more truely
> >
> > On Feb 24 2016, at 3:00 pm, jp charras  wrote:
> >
> > Le 23/02/2016 13:36, Eldar Khayrullin a écrit :
> > > Result
> > >
> > >> On Feb 23 2016, at 3:29 pm, Eldar Khayrullin
> > > eldar.khayrul...@mail.ru wrote:
> > > Apply Justify of text and flipped flag of text from import file.
> >
> > I committed your patches.
> > AFAIK, they look good for me.
> > Thanks.
> >
> >
> > --
> > Jean-Pierre CHARRAS
> >
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help : https://help.launchpad.net/ListHelp
> >
> >
> >
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help : https://help.launchpad.net/ListHelp
> >
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Eldar Khayrullin
PCAD stroke font isn't fixed width font and KiCad font too.  
I look for possible and try to solve this with more easy way  

> On Feb 24 2016, at 7:51 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>

> Eldar,

>

> Are you planning on actually determining the appropriate PCAD units for  
text so that this can be converted accurately? While you patch makes  
things better, I would prefer that we convert boards as accurately as  
possible. I know we don't handle different fonts but there should be no  
reason not to get the text position, height, and with correct.

>

> Wayne

>

> On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:  
 Thank you. Not ideal yet, but more truely  
  
 On Feb 24 2016, at 3:00 pm, jp charras jp.char...@wanadoo.fr
wrote:  
  
 Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
  Result  
   
  On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
  lt;eldar.khayrul...@mail.rugt; wrote:  
  Apply Justify of text and flipped flag of text from import file.  
  
 I committed your patches.  
 AFAIK, they look good for me.  
 Thanks.  
  
  
 \--  
 Jean-Pierre CHARRAS  
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  
  
  
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  


>

> ___  
Mailing list: https://launchpad.net/~kicad-developers  
Post to : kicad-developers@lists.launchpad.net  
Unsubscribe : https://launchpad.net/~kicad-developers  
More help : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Wayne Stambaugh
Eldar,

Are you planning on actually determining the appropriate PCAD units for
text so that this can be converted accurately?  While you patch makes
things better, I would prefer that we convert boards as accurately as
possible.  I know we don't handle different fonts but there should be no
reason not to get the text position, height, and with correct.

Wayne

On 2/24/2016 11:34 AM, Eldar Khayrullin wrote:
> Thank you. Not ideal yet, but more truely
> 
> On Feb 24 2016, at 3:00 pm, jp charras  wrote:
> 
> Le 23/02/2016 13:36, Eldar Khayrullin a écrit :
> > Result
> >
> >> On Feb 23 2016, at 3:29 pm, Eldar Khayrullin
> > eldar.khayrul...@mail.ru wrote:
> > Apply Justify of text and flipped flag of text from import file.
> 
> I committed your patches.
> AFAIK, they look good for me.
> Thanks.
> 
> 
> -- 
> Jean-Pierre CHARRAS
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
> 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread Eldar Khayrullin
Thank you. Not ideal yet, but more truely

> On Feb 24 2016, at 3:00 pm, jp charras jp.char...@wanadoo.fr wrote:  

>

> Le 23/02/2016 13:36, Eldar Khayrullin a écrit :  
 Result  
  
 On Feb 23 2016, at 3:29 pm, Eldar Khayrullin  
 lt;eldar.khayrul...@mail.rugt; wrote:  
 Apply Justify of text and flipped flag of text from import file.

>

> I committed your patches.  
AFAIK, they look good for me.  
Thanks.

>

>  
\--  
Jean-Pierre CHARRAS

>

> ___  
Mailing list: https://launchpad.net/~kicad-developers  
Post to : kicad-developers@lists.launchpad.net  
Unsubscribe : https://launchpad.net/~kicad-developers  
More help : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-24 Thread jp charras
Le 23/02/2016 13:36, Eldar Khayrullin a écrit :
> Result
> 
>> On Feb 23 2016, at 3:29 pm, Eldar Khayrullin
> eldar.khayrul...@mail.ru wrote:  
> Apply Justify of text and flipped flag of text from import file.  

I committed your patches.
AFAIK, they look good for me.
Thanks.


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-23 Thread Eldar Khayrullin
Result

> On Feb 23 2016, at 3:29 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Apply Justify of text and flipped flag of text from import file.  

>

>> On Feb 23 2016, at 12:00 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Hello.

>>

>> I rebase patches.

>>

>> PS: All sizes in Kicad internal units.

>>

>>> On Feb 22 2016, at 9:35 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>>>

>>> Eldar,

>>>

>>> There is something unsettling about your patch. Why are there different  
scalars applied when calculating the length of the text versus the  
height? This would suggest the PCAD file format does not use the same  
units for text height, text width, and text position. It appears to me  
that you have determined the text position and size scalars by comparing  
the KiCad output with the output of some other EDA application. If the  
PCAD units are mm, inches, mils, etc, the size and position numbers  
should be scaled to nanometers which are the units used in Pcbnew. When  
I see things like / 3, / 1.8, and / 1.4 in two consecutive lines of code  
translating coordinates, that raises a red flag.

>>>

>>> Cheers,

>>>

>>> Wayne

>>>

>>> On 2/22/2016 11:56 AM, Eldar Khayrullin wrote:  
 Hello. Patch attached.  
 P.S. need work to correct a justification of text and text size (I do)  
  
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  


>>>

>>> ___  
Mailing list: https://launchpad.net/~kicad-developers  
Post to : kicad-developers@lists.launchpad.net  
Unsubscribe : https://launchpad.net/~kicad-developers  
More help : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-23 Thread Eldar Khayrullin
Apply Justify of text and flipped flag of text from import file.  

> On Feb 23 2016, at 12:00 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Hello.

>

> I rebase patches.

>

> PS: All sizes in Kicad internal units.

>

>> On Feb 22 2016, at 9:35 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>>

>> Eldar,

>>

>> There is something unsettling about your patch. Why are there different  
scalars applied when calculating the length of the text versus the  
height? This would suggest the PCAD file format does not use the same  
units for text height, text width, and text position. It appears to me  
that you have determined the text position and size scalars by comparing  
the KiCad output with the output of some other EDA application. If the  
PCAD units are mm, inches, mils, etc, the size and position numbers  
should be scaled to nanometers which are the units used in Pcbnew. When  
I see things like / 3, / 1.8, and / 1.4 in two consecutive lines of code  
translating coordinates, that raises a red flag.

>>

>> Cheers,

>>

>> Wayne

>>

>> On 2/22/2016 11:56 AM, Eldar Khayrullin wrote:  
 Hello. Patch attached.  
 P.S. need work to correct a justification of text and text size (I do)  
  
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  


>>

>> ___  
Mailing list: https://launchpad.net/~kicad-developers  
Post to : kicad-developers@lists.launchpad.net  
Unsubscribe : https://launchpad.net/~kicad-developers  
More help : https://help.launchpad.net/ListHelp

>From 76d728dee9f2c47c59617404c283cf6b384b9658 Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin 
Date: Tue, 23 Feb 2016 15:24:13 +0300
Subject: [PATCH] pcad2kicadpcb: apply text justify. Set proper flag of flipped
 for text fields

---
 pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp | 111 --
 pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h   |  15 +++
 pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp|   2 -
 pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp  |   3 +
 4 files changed, 120 insertions(+), 11 deletions(-)

diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
index 95876ec..7ff4a60 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
@@ -273,6 +273,31 @@ void SetDoublePrecisionPosition( wxString   aStr,
  aActualConversion );
 }
 
+TTEXT_JUSTIFY GetJustifyIdentificator( wxString aJustify )
+{
+TTEXT_JUSTIFY id;
+
+if( aJustify == wxT( "LowerCenter" ) )
+id = LowerCenter;
+else if( aJustify == wxT( "LowerRight" ) )
+id = LowerRight;
+else if( aJustify == wxT( "UpperLeft" ) )
+id = UpperLeft;
+else if( aJustify == wxT( "UpperCenter" ) )
+id = UpperCenter;
+else if( aJustify == wxT( "UpperRight" ) )
+id = UpperRight;
+else if( aJustify == wxT( "Left" ) )
+id = Left;
+else if( aJustify == wxT( "Center" ) )
+id = Center;
+else if( aJustify == wxT( "Right" ) )
+id = Right;
+else
+id = LowerLeft;
+
+return id;
+}
 
 void SetTextParameters( XNODE*  aNode,
 TTEXTVALUE* aTextValue,
@@ -307,6 +332,14 @@ void SetTextParameters( XNODE*  aNode,
 else if( str == wxT( "False" ) )
 aTextValue->textIsVisible = 0;
 
+str = FindNodeGetContent( aNode, wxT( "justify" ) );
+aTextValue->justify = GetJustifyIdentificator( str );
+
+str = FindNodeGetContent( aNode, wxT( "isFlipped" ) );
+
+if( str == wxT( "True" ) )
+aTextValue->mirror = 1;
+
 tNode = FindNode( aNode, wxT( "textStyleRef" ) );
 
 if( tNode )
@@ -386,24 +419,83 @@ void CorrectTextPosition( TTEXTVALUE* aValue )
 aValue->correctedPositionX = aValue->textPositionX;
 aValue->correctedPositionY = aValue->textPositionY;
 
-// standart justify (low left corner)
 switch( aValue->textRotation )
 {
 case 0:
-aValue->correctedPositionX += cl * cm;
-aValue->correctedPositionY -= ch;
+if( aValue->justify == LowerLeft ||
+aValue->justify == Left ||
+aValue->justify == UpperLeft )
+aValue->correctedPositionX += cl * cm;
+else if( aValue->justify == LowerRight ||
+ aValue->justify == Right ||
+ aValue->justify == UpperRight )
+aValue->correctedPositionX -= cl * cm;
+
+if( aValue->justify == LowerLeft ||
+aValue->justify == LowerCenter ||
+aValue->justify == LowerRight )
+aValue->correctedPositionY -= ch;
+else if( aValue->justify == UpperLeft ||
+   

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-23 Thread Eldar Khayrullin
Hello.

I rebase patches.

PS: All sizes in Kicad internal units.

> On Feb 22 2016, at 9:35 pm, Wayne Stambaugh stambau...@gmail.com
wrote:  

>

> Eldar,

>

> There is something unsettling about your patch. Why are there different  
scalars applied when calculating the length of the text versus the  
height? This would suggest the PCAD file format does not use the same  
units for text height, text width, and text position. It appears to me  
that you have determined the text position and size scalars by comparing  
the KiCad output with the output of some other EDA application. If the  
PCAD units are mm, inches, mils, etc, the size and position numbers  
should be scaled to nanometers which are the units used in Pcbnew. When  
I see things like / 3, / 1.8, and / 1.4 in two consecutive lines of code  
translating coordinates, that raises a red flag.

>

> Cheers,

>

> Wayne

>

> On 2/22/2016 11:56 AM, Eldar Khayrullin wrote:  
 Hello. Patch attached.  
 P.S. need work to correct a justification of text and text size (I do)  
  
  
 ___  
 Mailing list: https://launchpad.net/~kicad-developers  
 Post to : kicad-developers@lists.launchpad.net  
 Unsubscribe : https://launchpad.net/~kicad-developers  
 More help : https://help.launchpad.net/ListHelp  


>

> ___  
Mailing list: https://launchpad.net/~kicad-developers  
Post to : kicad-developers@lists.launchpad.net  
Unsubscribe : https://launchpad.net/~kicad-developers  
More help : https://help.launchpad.net/ListHelp

>From 947c6164c462c1c933147804cea6a3f1f7f5e193 Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin 
Date: Mon, 22 Feb 2016 19:46:16 +0300
Subject: [PATCH 1/2] Fix bug #1547822 (partial): wrong position fields of text
 from PCAD import

---
 pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp | 72 +++
 pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h   |  3 +-
 pcbnew/pcad2kicadpcb_plugin/pcb_component.h   |  6 +-
 pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp| 24 +---
 pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp  | 12 ++--
 5 files changed, 64 insertions(+), 53 deletions(-)

diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
index f588bbc..95876ec 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp
@@ -37,6 +37,9 @@
 
 namespace PCAD2KICAD {
 
+// PCAD stroke font average ratio of width to height
+const double TEXT_WIDTH_TO_HEIGHT = 0.79;
+
 wxString GetWord( wxString* aStr )
 {
 wxString result = wxEmptyString;
@@ -367,48 +370,43 @@ void SetFontProperty( XNODE*aNode,
 }
 }
 
+int CalculateTextLengthSize( TTEXTVALUE* aText )
+{
+return KiROUND( (double) aText->text.Len() *
+(double) aText->textHeight * TEXT_WIDTH_TO_HEIGHT );
+}
 
-void CorrectTextPosition( TTEXTVALUE* aValue, int aRotation )
+void CorrectTextPosition( TTEXTVALUE* aValue )
 {
-aValue->correctedPositionX  = aValue->textPositionX;
-aValue->correctedPositionY  = aValue->textPositionY;
-aValue->correctedPositionY  = aValue->correctedPositionY - KiROUND(
-(double) aValue->textHeight / 3.0 );
-aValue->correctedPositionX = aValue->correctedPositionX +
- KiROUND( ( (double) aValue->text.Len() /
-1.4 ) * ( (double) aValue->textHeight / 1.8 ) );
-
-if( aRotation == 900 )
-{
-aValue->correctedPositionX  = -aValue->textPositionY;
-aValue->correctedPositionY  = aValue->textPositionX;
-aValue->correctedPositionX  = aValue->correctedPositionX + KiROUND(
-(double) aValue->textHeight / 3.0 );
-aValue->correctedPositionY = aValue->correctedPositionY +
- KiROUND( ( (double) aValue->text.Len() /
-1.4 ) * ( (double) aValue->textHeight / 1.8 ) );
-}
+int cm = aValue->mirror ? -1 : 1;
+// sizes of justify correction
+int cl = KiROUND( (double) CalculateTextLengthSize( aValue ) / 2.0 );
+int ch = KiROUND( (double) aValue->textHeight / 2.0 );
 
-if( aRotation == 1800 )
-{
-aValue->correctedPositionX  = -aValue->textPositionX;
-aValue->correctedPositionY  = -aValue->textPositionY;
-aValue->correctedPositionY  = aValue->correctedPositionY +
-  KiROUND( (double) aValue->textHeight / 3.0 );
-aValue->correctedPositionX = aValue->correctedPositionX -
- KiROUND( ( (double) aValue->text.Len() /
-1.4 ) * ( (double) aValue->textHeight / 1.8 ) );
-}
+aValue->correctedPositionX = aValue->textPositionX;
+aValue->correctedPositionY = aValue->textPositionY;
 
-if( aRotation 

Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-22 Thread Wayne Stambaugh
Eldar,

There is something unsettling about your patch.  Why are there different
scalars applied when calculating the length of the text versus the
height?  This would suggest the PCAD file format does not use the same
units for text height, text width, and text position.  It appears to me
that you have determined the text position and size scalars by comparing
the KiCad output with the output of some other EDA application.  If the
PCAD units are mm, inches, mils, etc, the size and position numbers
should be scaled to nanometers which are the units used in Pcbnew.  When
I see things like / 3, / 1.8, and / 1.4 in two consecutive lines of code
translating coordinates, that raises a red flag.

Cheers,

Wayne

On 2/22/2016 11:56 AM, Eldar Khayrullin wrote:
> Hello. Patch attached.
> P.S. need work to correct a justification of text and text size (I do) 
> 
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] fix position of text and refdes from PCAD import

2016-02-22 Thread Eldar Khayrullin
Next patch continue fixing bug https://bugs.launchpad.net/kicad/+bug/1547822

> On Feb 22 2016, at 7:55 pm, Eldar Khayrullin
eldar.khayrul...@mail.ru wrote:  
Hello. Patch attached.  
P.S. need work to correct a justification of text and text size (I do)  

>From 766b6e5b5859b8209f5fac79655295aa057a671f Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin 
Date: Mon, 22 Feb 2016 20:38:22 +0300
Subject: [PATCH] Fix bug #1547822: refdes and value fields are set to
 invisible in new PCAD file format

---
 pcbnew/pcad2kicadpcb_plugin/pcb.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
index 41f79d2..6d00cbd 100644
--- a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
+++ b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp
@@ -166,7 +166,7 @@ void PCB::SetTextProperty( XNODE*   aNode, TTEXTVALUE* aTextValue,
wxString aActualConversion )
 {
 XNODE*  tNode, * t1Node;
-wxStringn, pn, propValue, str;
+wxStringn, nnew, pn, propValue, str;
 
 // aNode is pattern now
 tNode   = aNode;
@@ -199,6 +199,7 @@ void PCB::SetTextProperty( XNODE*   aNode, TTEXTVALUE* aTextValue,
 str = aTextValue->text;
 str.Trim( false );
 str.Trim( true );
+nnew= n; // new file version
 n   = n + wxT( ' ' ) + str; // changed in new file version.
 tNode   = NULL;
 }
@@ -219,7 +220,7 @@ void PCB::SetTextProperty( XNODE*   aNode, TTEXTVALUE* aTextValue,
 propValue.Trim( false );
 propValue.Trim( true );
 
-if( propValue == n )
+if( propValue == n || propValue == nnew )
 break;
 
 tNode = tNode->GetNext();
-- 
2.5.0

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp