Draft ShapeString/it: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
(48 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Docnav/it|[[Draft_Point/it|Punto]]|[[Draft_Facebinder/it|Lega facce]]|[[Draft_Module/it|Draft]]|IconL=Draft_Point.svg |IconC=Workbench_Draft.svg|IconR=Draft_Facebinder.svg }}


<div class="mw-translate-fuzzy">
{{GuiCommand/it|Name=Draft_ShapeString|Name/it=ShapeString|Workbenches=[[Draft Module/it|Draft]], [[Arch Module/it|Arch]]|MenuLocation=Draft → Forma da testo...|Shortcut=S S|SeeAlso=[[Draft Text/it|Testo Draft]], [[Part Extrude/it|Part Estrusione]]|Version=0.14}}
{{Docnav/it
|[[Draft_Point/it|Punto]]
|[[Draft_Facebinder/it|Lega facce]]
|[[Draft_Workbench/it|Draft]]
|IconL=Draft_Point.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Facebinder.svg
}}
</div>

<div class="mw-translate-fuzzy">
{{GuiCommand/it
|Name=Draft_ShapeString
|Name/it=ShapeString
|Workbenches=[[Draft_Workbench/it|Draft]], [[Arch_Workbench/it|Arch]]
|MenuLocation=Draft → Forma da testo...
|Shortcut={{KEY|S}} {{KEY|S}}
|SeeAlso=[[Draft Text/it|Testo Draft]], [[Part Extrude/it|Part Estrusione]],<br /> [[Macro_Fonts_Win10_PYMP/it|Macro Fonts Win10 PYMP]] [[Image:Macro_Fonts_Win10_PYMP.png|24px]]
|Version=0.14}}
</div>


==Descrizione==
==Descrizione==


<div class="mw-translate-fuzzy">
Lo strumento ShapeString inserisce una forma composta che riproduce una stringa di testo in un dato punto del documento corrente.
Lo strumento ShapeString inserisce una forma composta che riproduce una stringa di testo in un dato punto del documento corrente.
Si possono definire gli attributi del testo quali altezza, tipo di carattere, ecc..
Si possono definire gli attributi del testo quali altezza, tipo di carattere, ecc..
La forma risultante può essere utilizzata con lo strumento [[Part Extrude/it|Estrusione]] di Part per creare lettere 3D.
La forma risultante può essere utilizzata con lo strumento [[Part Extrude/it|Estrusione]] di Part per creare lettere 3D.
</div>


<div class="mw-translate-fuzzy">
Per inserire un elemento di testo più semplice senza una forma chiusa, utilizzare [[Draft Text/it|Testo]]. Per creare un'etichetta di testo con una linea guida e una freccia usare [[Draft Label/it|Etichetta]].
Per inserire un elemento di testo più semplice senza una forma chiusa, utilizzare [[Image:Draft_Text.svg|24px]] [[Draft Text/it|Testo]]. Per creare un'etichetta di testo con una linea guida e una freccia usare [[Image:Draft_Label.svg|24px]] [[Draft Label/it|Etichetta]].
</div>


[[Image:Draft_ShapeString_Example400.png]]
[[Image:Draft_ShapeString_Example400.png]]
<div class="mw-translate-fuzzy">
{{Caption|Per posizionare una Shapestring basta un singolo punto}}
{{Caption|Per posizionare una Shapestring basta un singolo punto}}
</div>


== Utilizzo ==
==Utilizzo==


For Windows users: please read the [[#Font_file_selection_on_Windows|Font file selection on Windows]] paragraph first.
# Premere il pulsante {{Button|[[Image:Draft_ShapeString16.png]] [[Draft_ShapeString/it|Forma da testo...]]}} , o premere i tasti {{KEY|S}} e poi {{KEY|S}}.
# Selezionare un punto nella vista 3D, o digitare le sue [[Draft_Coordinates/it|coordinate]] e poi premere il pulsante {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint/it|aggiungi punto]]}}.
# Immettere il testo desiderato e premere {{KEY|Invio}}.
# Immettere la dimensione desiderata e premere {{KEY|Invio}}.
# Immettere il percorso desiderato e premere {{KEY|Invio}}.
# Premere {{KEY|Invio}} per accettare il file di font visualizzato, o premere {{Button|...}} per selezionare un file di font.


<div class="mw-translate-fuzzy">
[[Image:SSFontSelect.png]]
Se la modalità dell'interfaccia di Draft è impostata su Vista azioni:
# Premere il pulsante {{Button|[[Image:Draft_ShapeString.svg|16px]] [[Draft_ShapeString/it|Forma da testo]]}}, o premere i tasti {{KEY|S}} e poi {{KEY|S}}.
# Appare una finestra di dialogo in cui è possibile specificare i parametri.
# Premere {{KEY|OK}} per creare la forma dal testo.
</div>


== Opzioni ==
Il testo, le dimensioni, il percorso e il carattere possono essere modificati dopo la creazione, modificando le proprietà della forma.


<div class="mw-translate-fuzzy">
Impostare il file di font predefinito nelle [[Draft Preferences/it|Preferenze]] di Draft, nella scheda {{Button|Testi e quotature}}.
* Per inserire le coordinate manualmente, è sufficiente inserire i numeri, quindi premere {{KEY|Invio}} per ciascun componente X, Y e Z.. È possibile premere il pulsante {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint/it|Inserisci punto]]}} quando si hanno i valori desiderati per inserire il punto.
I tipi di carattere supportati includono TrueType (.ttf), OpenType (.otf), e Type 1 (.pfb).
* Premere il tasto {{KEY|Esc}} o il pulsante {{button|Chiudi}} per interrompere il comando corrente.
</div>


==Notes==

<div class="mw-translate-fuzzy">
=== Limitazioni ===
=== Limitazioni ===
* Altezze di testo molto ridotte possono causare deformazioni delle forme del carattere a causa della perdita di dettagli nel ridimensionamento.
* Altezze di testo molto ridotte possono causare deformazioni delle forme del carattere a causa della perdita di dettagli nel ridimensionamento.
* La versione corrente mostra solo un testo scritto in orizzontale da sinistra a destra.
* La versione corrente mostra solo un testo scritto in orizzontale da sinistra a destra.
* Per creare un testo curvo è possibile utilizzare la macro {{Button|[[File:FCCircularTextButtom.png|24px]] [[Macro_Circular Text/it|Testo circolare]]}}.
* Per creare un testo curvo è possibile utilizzare la macro {{Button|[[File:FCCircularTextButtom.png|24px]] [[Macro_FCCircularText/it|Testo circolare]]}}.
</div>


==Font file selection on Windows==
== Opzioni ==


On Windows access to the default font folder is restricted. This affects the font file selection for ShapeStrings. There are three cases in FreeCAD where a font file for ShapeStrings can be specified: in the task panel of this command, when changing the {{PropertyData|Font File}} property of a ShapeString, and when specifying the default font file in the [[Preferences_Editor|Preferences Editor]].
* Per inserire le coordinate manualmente, è sufficiente inserire i numeri, quindi premere {{KEY|Invio}} per ciascun componente X, Y e Z.. È possibile premere il pulsante {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint/it|Inserisci punto]]}} quando si hanno i valori desiderati per inserire il punto.

* Premere il tasto {{KEY|Esc}} o il pulsante {{button|Chiudi}} per interrompere il comando corrente.
Pressing the {{Button|...}} button and then selecting a file from the default Windows font folder is not possible when using the native file dialog. There are a number of workarounds:
* Make sure {{MenuCommand|DontUseNativeFontDialog}} is set to {{True}}, which is the default value for this preference. This will only call a different, non-native, file dialog when pressing the {{Button|...}} in the task panel of this command. With this file dialog the default Windows font folder can be accessed.
* Change {{MenuCommand|DontUseNativeDialog}} to {{True}}. This instructs FreeCAD to always use the non-native file dialog.
* Specify the font file in the input box. You can of course type the full path or copy-paste the path from the Windows File Explorer. But there is also another way to enter the path. If you enter {{Value|C:\}} a dropdown list will appear. Select {{Value|Windows}} from that list and add {{Value|\F}}. Select {{Value|Fonts}} from the new dropdown list. Finally add {{Value|\}} and the first letter of the font file, and then select it from the dropdown list.
* Create a custom folder for your font files.

See the [[#Preferences|Preferences]] paragraph below for the location of the mentioned preferences.

==Tutorial==

* [[Draft_ShapeString_tutorial/it|Tutorial Forma da testo - ShapeString]]: come estrudere un testo, posizionarlo nello spazio 3D e creare un'incisione in un altro corpo.
* [https://forum.freecadweb.org/viewtopic.php?f=3&t=36623 How to use ShapeStrings in PartDesign]

==Preferences==

See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].

* The default font file can be changed in the preferences: {{MenuCommand|Edit → Preferences... → Draft → Texts and dimensions → Default ShapeString font file}}.
* For Windows users:
** Set {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeFontDialog}} to {{True}} to use the non-native file dialog when selecting a font file from the task panel of this command.
** Set {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeDialog}} to {{True}} to always use the non-native file dialog.


== Proprietà ==
== Proprietà ==


See also: [[Property_editor|Property editor]].

A Draft ShapeString object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties:

===Data===

{{TitleProperty|Draft}}

<div class="mw-translate-fuzzy">
* {{PropertyData|Position}}: specifica la posizione del punto base della forma composta.
* {{PropertyData|Position}}: specifica la posizione del punto base della forma composta.
* {{PropertyData|Angle}}: specifica la rotazione della linea di base della forma.
* {{PropertyData|Angle}}: specifica la rotazione della linea di base della forma.
Line 50: Line 111:
* {{PropertyData|Tracking}}: specifica la spaziatura inter-carattere aggiuntiva nella stringa.
* {{PropertyData|Tracking}}: specifica la spaziatura inter-carattere aggiuntiva nella stringa.
* {{PropertyData|Font File}}: specifica il percorso completo del file di font utilizzato per disegnare la stringa.
* {{PropertyData|Font File}}: specifica il percorso completo del file di font utilizzato per disegnare la stringa.
</div>


===View===

{{TitleProperty|Draft}}

* {{PropertyView|Pattern|Enumeration}}: specifies the [[Draft_Pattern|Draft Pattern]] with which to fill the faces of the text. This property only works if {{PropertyView|Display Mode}} is {{value|Flat Lines}}.
* {{PropertyView|Pattern Size|Float}}: specifies the size of the [[Draft_Pattern|Draft Pattern]].

==Scripting==

<div class="mw-translate-fuzzy">
== Script ==
== Script ==
{{Emphasis|Vedere anche:}} [[Draft API/it|API Draft]] e [[FreeCAD Scripting Basics/it|Nozioni di base sugli script di FreeCAD]].
{{Emphasis|Vedere anche:}} [[Draft API/it|API Draft]] e [[FreeCAD Scripting Basics/it|Nozioni di base sugli script di FreeCAD]].
</div>


<div class="mw-translate-fuzzy">
Lo strumento ShapeString può essere utilizzato nelle [[macros/it|macro]] e dalla console [[Python/it|Python]] tramite la seguente funzione:
Lo strumento ShapeString può essere utilizzato nelle [[macros/it|macro]] e dalla console [[Python/it|Python]] tramite la seguente funzione:
</div>

{{Code|code=
{{Code|code=
ShapeString = makeShapeString(String, FontFile, Size=100, Tracking=0)
shapestring = make_shapestring(String, FontFile, Size=100, Tracking=0)
}}
}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
* Crea una forma composta {{incode|ShapeString}} usando la {{incode|String}} specificata e il percorso completo di un {{incode|FontFile}} supportato.
* Trasforma una <code>Stringa</code> di testo in una <code>ShapeString</code> utilizzando un font specificato.
* {{incode|Size}} è l'altezza in millimetri del testo risultante.
* <code>FontFile</code> è obbligatorio e deve essere il percorso completo di un file di font supportato
* <code>Size</code> è l'altezza del testo risultante in millimetri
* {{incode|Tracking}} è la spaziatura aggiuntiva tra i caratteri, in millimetri.
* <code>Tracking</code> è la spaziatura aggiuntiva tra i caratteri in millimetri
</div>
</div>


The placement of the ShapeString can be changed by overwriting its {{incode|Placement}} attribute, or by individually overwriting its {{incode|Placement.Base}} and {{incode|Placement.Rotation}} attributes.
Il posizionamento di {{incode|ShapeString}} può essere cambiato sovrascrivendo il suo attributo {{incode|Placement}}, o sovrascrivendo singolarmente i suoi attributi {{incode|Placement.Base}} e {{incode|Placement.Rotation}}.


Esempio:
Esempio:

{{Code|code=
{{Code|code=
import FreeCAD, Draft
import FreeCAD as App
import Draft

doc = App.newDocument()


font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
Line 76: Line 155:
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"


S1 = Draft.makeShapeString("This is a sample text", font1, 200)
S1 = Draft.make_shapestring("This is a sample text", font1, 200)


S2 = Draft.makeShapeString("Inclined text", font2, 200, 10)
S2 = Draft.make_shapestring("Inclined text", font2, 200, 10)


ZAxis = FreeCAD.Vector(0, 0, 1)
zaxis = App.Vector(0, 0, 1)
p2 = FreeCAD.Vector(-1000, 500, 0)
p2 = App.Vector(-1000, 500, 0)
place2 = FreeCAD.Placement(p2, FreeCAD.Rotation(ZAxis, 45))
place2 = App.Placement(p2, App.Rotation(zaxis, 45))
S2.Placement = place2
S2.Placement = place2


S3 = Draft.makeShapeString("Upside-down text", font3, 200, 10)
S3 = Draft.make_shapestring("Upside-down text", font3, 200, 10)
S3.Placement.Base = FreeCAD.Vector(0, -1000, 0)
S3.Placement.Base = App.Vector(0, -1000, 0)
S3.Placement.Rotation = FreeCAD.Rotation(ZAxis, 180)
S3.Placement.Rotation = App.Rotation(zaxis, 180)

doc.recompute()
}}
}}


==Tutorial==
* [[Draft_ShapeString_tutorial/it|Tutorial Forma da testo - ShapeString]]: come estrudere un testo, posizionarlo nello spazio 3D e creare un'incisione in un altro corpo.


<div class="mw-translate-fuzzy">
{{Docnav/it|[[Draft_Point/it|Punto]]|[[Draft_Facebinder/it|Lega facce]]|[[Draft_Module/it|Draft]]|IconL=Draft_Point.svg |IconC=Workbench_Draft.svg|IconR=Draft_Facebinder.svg }}
{{Docnav/it

|[[Draft_Point/it|Punto]]
{{Draft Tools navi/it}}
|[[Draft_Facebinder/it|Lega facce]]
|[[Draft_Workbench/it|Draft]]
|IconL=Draft_Point.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_Facebinder.svg
}}
</div>


{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi/it}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 10:26, 29 September 2021

ShapeString

Posizione nel menu
Draft → Forma da testo...
Ambiente
Draft, Arch
Avvio veloce
S S
Introdotto nella versione
0.14
Vedere anche
Testo Draft, Part Estrusione,
Macro Fonts Win10 PYMP

Descrizione

Lo strumento ShapeString inserisce una forma composta che riproduce una stringa di testo in un dato punto del documento corrente. Si possono definire gli attributi del testo quali altezza, tipo di carattere, ecc.. La forma risultante può essere utilizzata con lo strumento Estrusione di Part per creare lettere 3D.

Per inserire un elemento di testo più semplice senza una forma chiusa, utilizzare Testo. Per creare un'etichetta di testo con una linea guida e una freccia usare Etichetta.

Per posizionare una Shapestring basta un singolo punto

Utilizzo

For Windows users: please read the Font file selection on Windows paragraph first.

Se la modalità dell'interfaccia di Draft è impostata su Vista azioni:

  1. Premere il pulsante Forma da testo, o premere i tasti S e poi S.
  2. Appare una finestra di dialogo in cui è possibile specificare i parametri.
  3. Premere OK per creare la forma dal testo.

Opzioni

  • Per inserire le coordinate manualmente, è sufficiente inserire i numeri, quindi premere Invio per ciascun componente X, Y e Z.. È possibile premere il pulsante Inserisci punto quando si hanno i valori desiderati per inserire il punto.
  • Premere il tasto Esc o il pulsante Chiudi per interrompere il comando corrente.

Notes

Limitazioni

  • Altezze di testo molto ridotte possono causare deformazioni delle forme del carattere a causa della perdita di dettagli nel ridimensionamento.
  • La versione corrente mostra solo un testo scritto in orizzontale da sinistra a destra.
  • Per creare un testo curvo è possibile utilizzare la macro Testo circolare.

Font file selection on Windows

On Windows access to the default font folder is restricted. This affects the font file selection for ShapeStrings. There are three cases in FreeCAD where a font file for ShapeStrings can be specified: in the task panel of this command, when changing the DatiFont File property of a ShapeString, and when specifying the default font file in the Preferences Editor.

Pressing the ... button and then selecting a file from the default Windows font folder is not possible when using the native file dialog. There are a number of workarounds:

  • Make sure DontUseNativeFontDialog is set to true, which is the default value for this preference. This will only call a different, non-native, file dialog when pressing the ... in the task panel of this command. With this file dialog the default Windows font folder can be accessed.
  • Change DontUseNativeDialog to true. This instructs FreeCAD to always use the non-native file dialog.
  • Specify the font file in the input box. You can of course type the full path or copy-paste the path from the Windows File Explorer. But there is also another way to enter the path. If you enter C:\ a dropdown list will appear. Select Windows from that list and add \F. Select Fonts from the new dropdown list. Finally add \ and the first letter of the font file, and then select it from the dropdown list.
  • Create a custom folder for your font files.

See the Preferences paragraph below for the location of the mentioned preferences.

Tutorial

Preferences

See also: Preferences Editor and Draft Preferences.

  • The default font file can be changed in the preferences: Edit → Preferences... → Draft → Texts and dimensions → Default ShapeString font file.
  • For Windows users:
    • Set Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeFontDialog to true to use the non-native file dialog when selecting a font file from the task panel of this command.
    • Set Tools → Edit parameters... → BaseApp → Preferences → Dialog → DontUseNativeDialog to true to always use the non-native file dialog.

Proprietà

See also: Property editor.

A Draft ShapeString object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:

Data

Draft

  • DatiPosition: specifica la posizione del punto base della forma composta.
  • DatiAngle: specifica la rotazione della linea di base della forma.
  • DatiAxis: specifica l'asse da utilizzare per la rotazione.
  • DatiString: specifica la stringa di testo da visualizzare; a differenza dello strumento Testo, Forma da testo può visualizzare solo una singola riga.
  • DatiSize: specifica l'altezza generale delle lettere.
  • DatiTracking: specifica la spaziatura inter-carattere aggiuntiva nella stringa.
  • DatiFont File: specifica il percorso completo del file di font utilizzato per disegnare la stringa.

View

Draft

  • VistaPattern (Enumeration): specifies the Draft Pattern with which to fill the faces of the text. This property only works if VistaDisplay Mode is Flat Lines.
  • VistaPattern Size (Float): specifies the size of the Draft Pattern.

Scripting

Lo strumento ShapeString può essere utilizzato nelle macro e dalla console Python tramite la seguente funzione:

shapestring = make_shapestring(String, FontFile, Size=100, Tracking=0)
  • Crea una forma composta ShapeString usando la String specificata e il percorso completo di un FontFile supportato.
  • Size è l'altezza in millimetri del testo risultante.
  • Tracking è la spaziatura aggiuntiva tra i caratteri, in millimetri.

Il posizionamento di ShapeString può essere cambiato sovrascrivendo il suo attributo Placement, o sovrascrivendo singolarmente i suoi attributi Placement.Base e Placement.Rotation.

Esempio:

import FreeCAD as App
import Draft

doc = App.newDocument()

font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
font2 = "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf"
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"

S1 = Draft.make_shapestring("This is a sample text", font1, 200)

S2 = Draft.make_shapestring("Inclined text", font2, 200, 10)

zaxis = App.Vector(0, 0, 1)
p2 = App.Vector(-1000, 500, 0)
place2 = App.Placement(p2, App.Rotation(zaxis, 45))
S2.Placement = place2

S3 = Draft.make_shapestring("Upside-down text", font3, 200, 10)
S3.Placement.Base = App.Vector(0, -1000, 0)
S3.Placement.Rotation = App.Rotation(zaxis, 180)

doc.recompute()