Верхние и нижние индексы в тексте - Страница 3
| Правила | Регистрация | Пользователи | Сообщения за день |  Справка по форуму | Файлообменник |

Вернуться   Форум DWG.RU > Программное обеспечение > AutoCAD > Верхние и нижние индексы в тексте

Верхние и нижние индексы в тексте

Ответ
Поиск в этой теме
Непрочитано 02.02.2007, 12:07
Верхние и нижние индексы в тексте
Ax3
 
Programming, automation, CADs, GISs. СибМИР
 
Россия, Санкт-Петербург
Регистрация: 02.02.2007
Сообщений: 315

Затрону тему, вероятно, уже всем надоевшую.
Нашел в справке по AutoCAD2004 такую вот вещь:

[Цитата]

To add superscript and subscript definitions to a font

This example procedure is based on the AutoCAD Romans font file, although a similar method applies to any AutoCAD font. This procedure adds four new shape definitions to a font: super_on, super_off, sub_on, and sub_off, which control the position and size of the characters that follow. For simplicity, this example replaces the left- and right-bracket characters ([ and ]) and the left and right curly brace characters ({ and }) with the new characters. You may choose to replace other characters or use a shape number in the extended range (ASCII codes 128 through 256). If you use an extended shape number, you need to use the %%nnn method (where nnn is the ASCII value of the character) for placing the new characters. (See ASCII Codes.)

Edit the SHP (in this case, romans.shp) file with an ASCII text editor. You can create a new file called romanss.shp rather than modify the original file. The romans.shp file is available on the AutoCAD CD.
Search for the shape definitions of the characters you are replacing. To comment out those definitions so the new definitions can take their place, insert a semicolon in front of each line of the shape definition. The shape definition may continue for a number of lines.
The left- and right-bracket characters have ASCII values of 91 and 93 (05B and 05D hex values, if the font is Unicode). The left and right curly brace characters have ASCII values of 123 and 125 (07B and 07D hex).

Add the first and second values on the second line of the definition, and divide the total by 2 as shown in the following example:
*UNIFONT,6,Extended Simplex Roman for UNICODE
21,7,2,0 21 + 7 = 28, then 28 / 2 = 14. This number is used later.
Add the following lines to the end of the SHP file:
*91,8,super_on
2,8,(0,14),003,2,1,0
*93,8,super_off
2,004,2,8,(0,-14),1,0
*123,8,sub_on
2,8,(0,-14),003,2,1,0
*125,8,sub_off
2,004,2,8,(0,14),1,0
Notice the 14 and –14 values in the preceding lines. They are Y axis offsets for the imaginary pen. The value 14 is half the maximum height of a character in this font, which is the correct approximation for superscripts and subscripts. This value needs to be calculated for each font file, but you can modify it any way you want.

Save the file.
Use the COMPILE command to compile the SHP file.
Once the shape is compiled and an appropriate style is defined, you can access the new pen-up and pen-down commands by entering the [, ],
{, and } characters. The [ character initiates superscript and the ] character returns from superscript to normal. The { character initiates subscript and the } character returns from subscript to normal.

[Конец цитаты]

Предлагаю обсудить такой способ создания верхних и нижних индексов.
Просмотров: 37064
 
Непрочитано 18.04.2011, 11:27
#41
No M.P.

Инженер-конструктор
 
Регистрация: 24.08.2007
Волгоград
Сообщений: 806
<phrase 1=


Два варианта.
Миниатюры
Нажмите на изображение для увеличения
Название: Вариант_1.jpg
Просмотров: 6878
Размер:	52.0 Кб
ID:	57826  Нажмите на изображение для увеличения
Название: Вариант_2.jpg
Просмотров: 359
Размер:	24.9 Кб
ID:	57827  
__________________
Никогда не стоит недооценивать предсказуемость глупости
No M.P. вне форума  
 
Непрочитано 18.04.2011, 11:31
#42
Хмурый


 
Регистрация: 29.10.2004
СПб
Сообщений: 16,373


Electra, 1- верхний , 2- нижний
Миниатюры
Нажмите на изображение для увеличения
Название: screenshot80.jpg
Просмотров: 466
Размер:	36.2 Кб
ID:	57829  
Хмурый вне форума  
 
Непрочитано 16.02.2014, 11:47
#43
Толик 14


 
Регистрация: 16.02.2014
Сообщений: 1


Цитата:
Сообщение от Димас Посмотреть сообщение
а я пользуюсь таким методом (только для мультитекста подходит)

как пример, ввожу следующее в окошко мтекста
Код:
[Выделить все]
верх ^ низ
выделяю
Код:
нажимаю stack (кнопка левее выбора цвета)
слово "вверх" уходит в верхний индекс

выделяю
Код:
нажимаю stack (кнопка левее выбора цвета)
слово "вниз" уходит в нижний индекс

единственная проблема - не знаю как написать ^ - поэтому приходиться его копировать с других мест))
работает в 2007, подозреваю и в 2006 должно
Это символ который вы не можете делать он делается так: включаете английскую раскладку затем нажимаете шифт и цифру 6 из верхней строки.
Толик 14 вне форума  
 
Непрочитано 16.02.2014, 12:34
#44
Bull

Конструктор по сути (машиностроитель)
 
Регистрация: 10.10.2005
Набережные Челны (это где КамАЗ)
Сообщений: 11,391


Offtop: Толик 14, за такое шахтерство можно и бан получить ))) 3 года!!!
__________________
Век живи, век учись - ...
Bull вне форума  
Ответ
Вернуться   Форум DWG.RU > Программное обеспечение > AutoCAD > Верхние и нижние индексы в тексте