Std TextDocument/pl: Difference between revisions

From FreeCAD Documentation
(Created page with "===Widok===")
(Created page with "{{TitleProperty|Edytor}}")
Line 38: Line 38:
===Widok===
===Widok===


{{TitleProperty|Editor}}
{{TitleProperty|Edytor}}


* {{PropertyView|Font Name|Font}}: a font name, for example, {{Value|Ubuntu Mono}}.
* {{PropertyView|Font Name|Font}}: a font name, for example, {{Value|Ubuntu Mono}}.

Revision as of 18:35, 6 January 2023

Std: Dokument tekstowy

Lokalizacja w menu
Przybory → Dodaj dokument tekstowy
Środowisko pracy
wszystkie
Domyślny skrót
brak
Wprowadzono w wersji
0.19
Zobacz także
Kształt z tekstu, Adnotacja wieloliniowa

Opis

Polecenie Dodaj dokument testowy tworzy obiekt zdolny do przechowywania dowolnego tekstu. Element ten może być użyty do zapisania ogólnych informacji lub specyfikacji modelu.

Użycie

  1. Wybierz z menu opcję Przybory → Dodaj dokument tekstowy.
  2. Kliknij dwukrotnie nowo utworzony obiekt w oknie widoku drzewa, aby otworzyć zakładkę, w której będziesz mógł napisać tekst.
  3. Dodaj tekst.
  4. Zamknij zakładkę i zapisz plik, gdy zostaniesz o to poproszony.

Właściwości

Widok

Edytor

  • WIDOKFont Name (Font): a font name, for example, Ubuntu Mono.
  • WIDOKFont Size (Float): a font size in points, for example, 11.
  • WIDOKRead Only (Bool): it defaults to false. If set to true the text cannot be edited.
  • WIDOKSyntax Highlighter (Enumeration): it defaults to None. If set to Python, the text will be highlighted like the Python console.

Scripting

See also: FreeCAD Scripting Basics, and scripted objects.

See Part Feature for the general information on adding objects to a document.

An App::TextDocument object is created with the addObject() method of the document. Once a TextDocument exists, its textual information is stored in its Text attribute. This attribute can be used in other objects, for example, as the string in a Draft ShapeString.

import FreeCAD as App
import Draft

doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::TextDocument", "Text_document")
obj.Text = "textual information"
App.ActiveDocument.recompute()

obj2 = Draft.makeShapeString(obj.Text, "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 10)
App.ActiveDocument.recompute()