Draft: Introduceţi Text

From FreeCAD Documentation
Revision as of 09:34, 3 May 2019 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

Draft Text

poziția meniului
Draft → Text
Ateliere
Draft, Arch
scurtătură
T E
Prezentat în versiune
-
A se vedea, de asemenea,
nici unul

Descriere

Unealta Text inserează o porţiune de text într-un punct dat din documentul curent. În prealabil, seta'i în meniul Editare, opţiunea Preferinţe, mărimea şi culoarea textului în tab-ul Sarcini (Draft Tray toolbar.).

Pentru a crea forme de text solide, utilizați Draft ShapeString cu Part Extrude.

Warning: The texts created with version 0.18 are not backward compatible, so backup your work if you try to open files created with 0.18 with older versions.

Mod de utilizare

  1. Apăsaţi butonul Draft Text ori apăsaţi tasta T, apoi tasta E.
  2. Daţi clic în fereastra de vizualizare 3D sau introduceţi coordonatele.
  3. Introduceţi textul dorit, apăsând tasta ENTER treceți la linie nouă.
  4. Apăsaţi DE DOUĂ ORI ENTER ca să terminaţi operaţia.

Opţiuni

Apăsând pe CTRL, snap punctul dvs. va fi ancorat la locațiile disponibile.

  • Pentru a introduce manual coordonatele, pur și simplu introduceți numerele, apoi apăsați ENTER între fiecare componentă X, Y și Z.
  • Apăsând ESC se va anula operația.
  • Când editați textul, apăsând ENTER sau DOWN ARROW vă permite să introduceți sau să editați un rând următor de text.
  • Apăsarea tastei UP ARROW vă permite să editați o linie anterioară de text.
  • Apăsând ENTER de două ori(lăsând astfel ultima linie goală) adaugă textul în document și închide editorul.

Proprietăți

  • DATEPosition: Punctul de bază al blocului de text
  • DATELabel Text: conținutul blocului de text
  • VEDEREMod afișare: Specifică dacă textul este aliniat la axele de scenă sau întotdeauna se confruntă cu camera
  • VEDEREDimensiune font: Dimensiunea literelor
  • VEDEREJustification: Specifică dacă textul este aliniat la stânga, la dreapta sau la centrul punctului de bază.
  • VEDERELine Spacing: Specifică spațiul dintre liniile de text
  • VEDERERotation: Specifică o rotație care trebuie aplicată textului
  • VEDEREAxa de rotație: Specifică axa de utilizat pentru rotație
  • VEDEREFont Name: fontul folosit pentru a desena textul. Poate fi un nume de font, cum ar fi "Arial", un stil implicit, cum ar fi "sans", "serif" sau "mono", sau o familie ca "Arial, Helvetica, sans" "Arial: Bold". În cazul în care fontul dat nu este găsit pe sistem, în locul acestuia se utilizează unul generic.

Data

  • DateText: specifies the contents of the text block as a list of strings; each element on the list, separated by a comma, indicates a new line.
  • DatePosition: specifies the base point of the first line of the text block.
  • DateAngle: specifies the rotation of the baseline of the first line of the text block.
  • DateAxis: specifies the axis to use for the rotation.

View

  • VizualizareDisplay Mode: if it is "3D text" the text will be aligned to the scene axes, initially lying on the XY plane; if it is "2D text" the text will always face the camera.
  • VizualizareFont Name: specifies the font to use to draw the text. It can be a font name, such as "Arial", a default style such as "sans", "serif" or "mono", a family such as "Arial,Helvetica,sans" or a name with a style such as "Arial:Bold". If the given font is not found on the system, a generic one is used instead.
  • VizualizareFont Size: specifies the size of the letters. If the text object is created in the tree view but no text is visible, increase the size of the text until it is visible.
  • VizualizareJustification: specifies if the text aligns to the left, right or at the center of the base point.
  • VizualizareLine Spacing: specifies the space between lines of text.

Script-Programre

Instrumentul Text poate fi folosit în macro-uri şi de la consola Python cu ajutorul funcţiei următoare:

The Text tool can be used in macros and from the Python console by using the following function:

Text = makeText(stringlist, point=Vector(0,0,0), screen=False)
  • Creează un obiect Text , într-un punct dat, dacă este furnizat un FreeCAD.Vector , care conține șirul sau șirurile dintr-o listă, câte un șir pe rând.
  • stringlist este un șir sau o listă de șiruri de caractere; dacă este o listă, fiecare element este afișat într-o singură linie
  • Se utilizează actualul Draft Linestyle specificat în preferințe.
  • Dacă screen este True , textul se află întotdeauna în direcția de vizualizare a camerei, altfel se află pe planul XY

The placement of the Text can be changed by overwriting its Placement attribute, or by individually overwriting its Placement.Base and Placement.Rotation attributes.

The view properties of Text can be changed by overwriting its attributes; for example, overwrite ViewObject.FontSize with the new size in millimeters.

Exempluː

import FreeCAD, Draft

p1 = FreeCAD.Vector(0, 0, 0)
t1 = "This is a sample text"

p2 = FreeCAD.Vector(1000, 1000, 0)
t2 = ["First line", "second line"]

Text1 = Draft.makeText(t1, point=p1)
Text2 = Draft.makeText(t2, point=p2)
Text1.ViewObject.FontSize = 200
Text2.ViewObject.FontSize = 200

p3 = FreeCAD.Vector(-1000, -500, 0)
t3 = ["Upside", "down"]

Text3 = Draft.makeText(t3, point=p3)
Text3.ViewObject.FontSize = 200

ZAxis = FreeCAD.Vector(0, 0, 1)
place3 = FreeCAD.Placement(p3, FreeCAD.Rotation(ZAxis, 175))
Text3.Placement = place3

Text4 = Draft.makeText(t3, point=p3)
Text4.ViewObject.FontSize = 200
Text4.Placement.Rotation = FreeCAD.Rotation(ZAxis, -30)