Draft Text/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "==Сценарии== Инструмент Текст может быть использован в макросах и из консоли Python следующими фу...")
(Updating to match new version of source page)
 
(60 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>

<div class="mw-translate-fuzzy">
{{Docnav/ru
|[[Draft_ShapeString/ru|Фигура из текста]]
|[[Draft_Dimension/ru|Размер]]
|[[Draft_Workbench/ru|Верстак "Draft"]]
|IconL=Draft_ShapeString.svg
|IconR=Draft_Dimension.svg
|IconC=Workbench_Draft.svg
}}
</div>

{{GuiCommand/ru
{{GuiCommand/ru
|Name=Draft Text
|Name/ru=Текст
|Name/ru=Draft Text
|Name=Draft_Text
|MenuLocation=Annotation → Текст
|Workbenches=[[Draft Module/ru|Draft]], [[Arch Module/ru|Arch]]
|Workbenches=[[Draft_Workbench/ru|Draft]], [[Arch_Workbench/ru|Arch]]
|MenuLocation=Черчение → Текст
|Shortcut=T E
|Shortcut={{KEY|T}} {{KEY|E}}
|Version=0.7
|SeeAlso=[[Draft_Label/ru|Метка]], [[Draft_ShapeString/ru|Фигура из текста]]
}}
}}


<span id="Description"></span>
==Описание==
==Описание==
Инструмент Текст позволяет добавить в документ текстовую область в указанную точку. Инструмент использует предварительно выбранный [[Draft Linestyle/ru|размер и цвет текста]] во вкладке Задачи.


<div class="mw-translate-fuzzy">
[[Image:Draft_Text_example.jpg|400px]]
Инструмент {{Button|[[Image:Draft_Text.svg|16px]] [[Draft_Text|Текст]]}} позволяет добавить в документ многострочную текстовую область в указанную точку. Он использует предварительно выбранный [[Draft_Linestyle/ru|Draft Linestyle]], установленный в [[Draft_Tray/ru|Draft Tray]].
</div>


To create a text element with an arrow use the [[Draft_Label|Draft Label]] command instead.
==Использование==
# Нажмите кнопку {{KEY|[[Image:Draft Text.png|16px]] [[Текст]]}}, или нажмите клавишу {{KEY|T}}, а затем{{KEY|E}}
# Укажите точку на трёхмерном виде или задайте [[Draft_Coordinates/ru|координаты]]
# Введите желаемый текст нажимая {{KEY|ENTER}} между каждыми строками
# Дважды нажмите {{KEY|ENTER}} для завершения.


<div class="mw-translate-fuzzy">
==Параметры==
[[Image:Draft_Text_example.png|400px]]
{{Caption|Для размещения текстового поля требуется одна точка}}
</div>


<span id="Usage"></span>
* Pressing {{KEY|CTRL}} will [[Draft_Snap|snap]] your point to available snap locations.
==Применение==
* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
* Pressing {{KEY|ESC}} will cancel the operation.
* When editing the text, pressing {{KEY|ENTER}} or {{KEY|DOWN ARROW}} allow you to enter or edit a next line of text.
* Pressing {{KEY|UP ARROW}} allows you to edit a previous line of text.
* Pressing {{KEY|ENTER}} '''twice''' (thus leaving the last line empty) adds the text to the document and closes the editor.


See also: [[Draft_Tray|Draft Tray]] and [[Draft_Snap|Draft Snap]].
==Properties==

* {{PropertyData|Position}}: The base point of the text block
<div class="mw-translate-fuzzy">
* {{PropertyData|Label Text}}: The contents of the text block
# Нажмите кнопку {{Button|[[Image:Draft_Text.svg|16px]] [[Draft Text/ru|Текст]]}}, или нажмите клавишу {{KEY|T}}, а затем{{KEY|E}}
* {{PropertyView|Display Mode}}: Specifies if the text is aligned to the scene axes or always faces the camera
# Укажите точку на трёхмерном виде или задайте координаты и нажмите кнопку {{Button|[[Image:Draft_AddPoint.svg|16px]] add point}}.
* {{PropertyView|Font Size}}: The size of the letters
# Введите желаемый текст нажимая {{KEY|Enter}} между каждыми строками
* {{PropertyView|Justification}}: Specifies if the text is aligned to the left, right or center of the base point.
# Дважды нажмите {{KEY|Enter}} для завершения.
* {{PropertyView|Line Spacing}}: Specifies the space between lines of text
</div>
* {{PropertyView|Rotation}}: Specifies a rotation to be applied to the text

* {{PropertyView|Rotation Axis}}: Specifies the axis to use for the rotation
<span id="Options"></span>
* {{PropertyView|Font Name}}: 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", or 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.
==Опции==

The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts (for version 0.22).

<div class="mw-translate-fuzzy">
* Для указания координат вручную, введите число и нажимайте {{KEY|ENTER}} для перехода между координатами X, Y и Z. Вы можете нажать кнопку {{Button|[[Image:Draft_AddPoint.svg|16px]] добавить точку}}, когда у вас есть нужные значения для вставки точки.
* Удерживайте {{KEY|Ctrl}} при размещении текста, чтобы принудительно установить [[Draft_Snap/ru|привязку]] вашей точки в ближайшее место привязки, независимо от расстояния.
* Нажмите {{KEY|Enter}} или {{KEY|↓ Стрелка вниз}}, чтобы ввести новую строку текста.
* Нажмите {{KEY|↑ Стрелка вверх}}, чтобы отредактировать предыдущую строку текста.
* Дважды нажмите {{KEY|Enter}} или {{KEY|↓ Стрелка вниз}}, чтобы завершить редактирование текста.
* Нажмите {{KEY|Esc}} или кнопку {{Button|Close}}, чтобы прервать выполнение текущей команды.
</div>

<span id="Notes"></span>
==Примечания==

* A Draft Text can be edited by double-clicking it in the [[Tree_view|Tree view]]. {{Version|0.20}}
* Draft Texts created or saved with [[Release_notes_0.21|FreeCAD version 0.21]] are not backward compatible.

<span id="Properties"></span>
==Свойства==

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

A Draft Text object is derived from an [[App_FeaturePython|App FeaturePython]] object and inherits all its properties. The following properties are additional unless otherwise stated.

<span id="Data"></span>
=== Данные ===

{{TitleProperty|Основные}}

<div class="mw-translate-fuzzy">
* {{PropertyData|Положение}}: указывает базовую точку первой линии текстового блока.
* {{PropertyData|Текст}}: указывает содержимое текстового блока как список строк, каждый элемент списка, разделённый запятыми, показывает новую строку
</div>

<span id="View"></span>
=== Вид ===

{{TitleProperty|Annotation}}

* {{PropertyView|Annotation Style|Enumeration}}: specifies the annotation style applied to the text. See [[Draft_AnnotationStyleEditor|Draft AnnotationStyleEditor]].
* {{PropertyView|Scale Multiplier|Float}}: specifies the general scaling factor applied to the text.

{{TitleProperty|Display Options}}

* {{PropertyView|Display Mode|Enumeration}}: specifies how the text is displayed. If it is {{value|World}} the text will be displayed on a plane defined by its {{PropertyData|Placement}}. If it is {{value|Screen}} the text will always face the screen. This is an inherited property. The mentioned options are the renamed options ({{Version|0.21}}).

{{TitleProperty|Graphics}}

* {{PropertyView|Line Color|Color}}: not used.
* {{PropertyView|Line Width|Float}}: not used.

{{TitleProperty|Text}}

<div class="mw-translate-fuzzy">
* {{PropertyView|Режим отображения}}: если это «3D текст», текст будет выровнен по осям сцены, изначально лежащим в плоскости XY; если это «2D-текст», текст всегда будет смотреть в камеру.
* {{PropertyView|Шрифт}}: указывает шрифт для отображения текста. Может быть название шрифта, например "Arial", название стиля, например, "sans", "serif" или "mono", название семейства, например, "Arial,Helvetica,sans", или название со стилем, например "Arial:Bold". Если указанный шрифт не найден в системе, то будет использован основной.
* {{PropertyView|Размер шрифта}}: указывает размер символов текста. Если текстовый объект создается в древе проекта, но текст не отображается, увеличивайте размер текста, пока он не станет видим.
* {{PropertyView|Выравнивание}}: указывает выравнивание текста налево, направо или по центру от базовой точки.
* {{PropertyView|Межстрочное расстояние}}: указывает расстояние между строк текста.
</div>

<span id="Scripting"></span>
==Программирование==

{{Emphasis|См. так же:}} [[Draft API/ru|Draft API]] и [[FreeCAD Scripting Basics|Основы составления скриптов FreeCAD]].

<div class="mw-translate-fuzzy">
Инструмент Текст может быть использован в [[macros/ru|макросах]] и из консоли [[Python/ru|Python]] следующими функциями:
</div>


==Сценарии==
Инструмент Текст может быть использован в [[макросах]] и из консоли Python следующими функциями:
{{Code|code=
{{Code|code=
text = make_text(string, placement=None, screen=False)
makeText (string or list, [Vector], [screenmode])
}}
}}

* Creates a Text object, at the given point if a vector is provided, containing the string or the strings given in the list, one string by line.
<div class="mw-translate-fuzzy">
* The current Draft color and text height and font specified in preferences are used.
* Создать объект {{incode|Text}} в {{incode|point}}, определённой как {{incode|FreeCAD.Vector}}.
* If screenmode is True, the text always faces the view direction, otherwise it lies on the XY plane.
* {{incode|stringlist}} это строка, или список строк, если это список, каждый элемент показывается в отдельной строке.
* Returns the newly created object.
* Если {{incode|screen}} равен {{incode|True}}, текст всегда ориентируется в направлении просмотра камеры, иначе выравнивается по осям сцены и лежит в плоскости XY.
</div>

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


Пример:
Пример:

{{Code|code=
{{Code|code=
import FreeCAD,Draft
import FreeCAD as App
import Draft
Draft.makeText("This is a sample text",FreeCAD.Vector(1,1,0))


doc = App.newDocument()

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

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

text1 = Draft.make_text(t1, p1)
text2 = Draft.make_text(t2, p2)
text1.ViewObject.FontSize = 200
text2.ViewObject.FontSize = 200

zaxis = App.Vector(0, 0, 1)

t3 = ["Upside", "down"]
p3 = App.Vector(-1000, -500, 0)
place3 = App.Placement(p3, App.Rotation(zaxis, 180))
text3 = Draft.make_text(t3, place3)
text3.ViewObject.FontSize = 200

doc.recompute()
}}
}}

{{clear}}

<languages/>
<div class="mw-translate-fuzzy">
{{Docnav/ru
|[[Draft_ShapeString/ru|Фигура из текста]]
|[[Draft_Dimension/ru|Размер]]
|[[Draft_Workbench/ru|Верстак "Draft"]]
|IconL=Draft_ShapeString.svg
|IconR=Draft_Dimension.svg
|IconC=Workbench_Draft.svg
}}
</div>

{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 05:03, 9 January 2024

Текст

Системное название
Draft_Text
Расположение в меню
Annotation → Текст
Верстаки
Draft, Arch
Быстрые клавиши
T E
Представлено в версии
0.7
См. также
Метка, Фигура из текста

Описание

Инструмент Текст позволяет добавить в документ многострочную текстовую область в указанную точку. Он использует предварительно выбранный Draft Linestyle, установленный в Draft Tray.

To create a text element with an arrow use the Draft Label command instead.

Для размещения текстового поля требуется одна точка

Применение

See also: Draft Tray and Draft Snap.

  1. Нажмите кнопку Текст, или нажмите клавишу T, а затемE
  2. Укажите точку на трёхмерном виде или задайте координаты и нажмите кнопку add point.
  3. Введите желаемый текст нажимая Enter между каждыми строками
  4. Дважды нажмите Enter для завершения.

Опции

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 0.22).

  • Для указания координат вручную, введите число и нажимайте ENTER для перехода между координатами X, Y и Z. Вы можете нажать кнопку добавить точку, когда у вас есть нужные значения для вставки точки.
  • Удерживайте Ctrl при размещении текста, чтобы принудительно установить привязку вашей точки в ближайшее место привязки, независимо от расстояния.
  • Нажмите Enter или ↓ Стрелка вниз, чтобы ввести новую строку текста.
  • Нажмите ↑ Стрелка вверх, чтобы отредактировать предыдущую строку текста.
  • Дважды нажмите Enter или ↓ Стрелка вниз, чтобы завершить редактирование текста.
  • Нажмите Esc или кнопку Close, чтобы прервать выполнение текущей команды.

Примечания

Свойства

See also: Property editor.

A Draft Text object is derived from an App FeaturePython object and inherits all its properties. The following properties are additional unless otherwise stated.

Данные

Основные

  • ДанныеПоложение: указывает базовую точку первой линии текстового блока.
  • ДанныеТекст: указывает содержимое текстового блока как список строк, каждый элемент списка, разделённый запятыми, показывает новую строку

Вид

Annotation

  • ВидAnnotation Style (Enumeration): specifies the annotation style applied to the text. See Draft AnnotationStyleEditor.
  • ВидScale Multiplier (Float): specifies the general scaling factor applied to the text.

Display Options

  • ВидDisplay Mode (Enumeration): specifies how the text is displayed. If it is World the text will be displayed on a plane defined by its ДанныеPlacement. If it is Screen the text will always face the screen. This is an inherited property. The mentioned options are the renamed options (introduced in version 0.21).

Graphics

  • ВидLine Color (Color): not used.
  • ВидLine Width (Float): not used.

Text

  • ВидРежим отображения: если это «3D текст», текст будет выровнен по осям сцены, изначально лежащим в плоскости XY; если это «2D-текст», текст всегда будет смотреть в камеру.
  • ВидШрифт: указывает шрифт для отображения текста. Может быть название шрифта, например "Arial", название стиля, например, "sans", "serif" или "mono", название семейства, например, "Arial,Helvetica,sans", или название со стилем, например "Arial:Bold". Если указанный шрифт не найден в системе, то будет использован основной.
  • ВидРазмер шрифта: указывает размер символов текста. Если текстовый объект создается в древе проекта, но текст не отображается, увеличивайте размер текста, пока он не станет видим.
  • ВидВыравнивание: указывает выравнивание текста налево, направо или по центру от базовой точки.
  • ВидМежстрочное расстояние: указывает расстояние между строк текста.

Программирование

См. так же: Draft API и Основы составления скриптов FreeCAD.

Инструмент Текст может быть использован в макросах и из консоли Python следующими функциями:

text = make_text(string, placement=None, screen=False)
  • Создать объект Text в point, определённой как FreeCAD.Vector.
  • stringlist это строка, или список строк, если это список, каждый элемент показывается в отдельной строке.
  • Если screen равен True, текст всегда ориентируется в направлении просмотра камеры, иначе выравнивается по осям сцены и лежит в плоскости XY.

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

Пример:

import FreeCAD as App
import Draft

doc = App.newDocument()

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

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

text1 = Draft.make_text(t1, p1)
text2 = Draft.make_text(t2, p2)
text1.ViewObject.FontSize = 200
text2.ViewObject.FontSize = 200

zaxis = App.Vector(0, 0, 1)

t3 = ["Upside", "down"]
p3 = App.Vector(-1000, -500, 0)
place3 = App.Placement(p3, App.Rotation(zaxis, 180))
text3 = Draft.make_text(t3, place3)
text3.ViewObject.FontSize = 200

doc.recompute()