~ubuntu-branches/ubuntu/trusty/cuneiform/trusty

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rstr/src/fontprop.c

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
4
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
5
пЮГПЕЬЮЕРЯЪ ОНБРНПМНЕ ПЮЯОПНЯРПЮМЕМХЕ Х ХЯОНКЭГНБЮМХЕ ЙЮЙ Б БХДЕ ХЯУНДМНЦН ЙНДЮ,
 
6
РЮЙ Х Б ДБНХВМНИ ТНПЛЕ, Я ХГЛЕМЕМХЪЛХ ХКХ АЕГ, ОПХ ЯНАКЧДЕМХХ ЯКЕДСЧЫХУ СЯКНБХИ:
 
7
 
 
8
      * оПХ ОНБРНПМНЛ ПЮЯОПНЯРПЮМЕМХХ ХЯУНДМНЦН ЙНДЮ ДНКФМШ НЯРЮБЮРЭЯЪ СЙЮГЮММНЕ
 
9
        БШЬЕ СБЕДНЛКЕМХЕ НА ЮБРНПЯЙНЛ ОПЮБЕ, ЩРНР ЯОХЯНЙ СЯКНБХИ Х ОНЯКЕДСЧЫХИ
 
10
        НРЙЮГ НР ЦЮПЮМРХИ.
 
11
      * оПХ ОНБРНПМНЛ ПЮЯОПНЯРПЮМЕМХХ ДБНХВМНЦН ЙНДЮ Б ДНЙСЛЕМРЮЖХХ Х/ХКХ Б
 
12
        ДПСЦХУ ЛЮРЕПХЮКЮУ, ОНЯРЮБКЪЕЛШУ ОПХ ПЮЯОПНЯРПЮМЕМХХ, ДНКФМШ ЯНУПЮМЪРЭЯЪ
 
13
        СЙЮГЮММЮЪ БШЬЕ ХМТНПЛЮЖХЪ НА ЮБРНПЯЙНЛ ОПЮБЕ, ЩРНР ЯОХЯНЙ СЯКНБХИ Х
 
14
        ОНЯКЕДСЧЫХИ НРЙЮГ НР ЦЮПЮМРХИ.
 
15
      * мХ МЮГБЮМХЕ Cognitive Technologies, МХ ХЛЕМЮ ЕЕ ЯНРПСДМХЙНБ МЕ ЛНЦСР
 
16
        АШРЭ ХЯОНКЭГНБЮМШ Б ЙЮВЕЯРБЕ ЯПЕДЯРБЮ ОНДДЕПФЙХ Х/ХКХ ОПНДБХФЕМХЪ
 
17
        ОПНДСЙРНБ, НЯМНБЮММШУ МЮ ЩРНЛ он, АЕГ ОПЕДБЮПХРЕКЭМНЦН ОХЯЭЛЕММНЦН
 
18
        ПЮГПЕЬЕМХЪ.
 
19
 
 
20
щрю опнцпюллю опеднярюбкемю бкюдекэжюлх юбрнпяйху опюб х/хкх дпсцхлх кхжюлх "йюй
 
21
нмю еярэ" аег йюйнцн-кхан бхдю цюпюмрхи, бшпюфеммшу ъбмн хкх ондпюгслебюелшу,
 
22
бйкчвюъ цюпюмрхх йнллепвеяйни жеммнярх х опхцндмнярх дкъ йнмйпермни жекх, мн ме
 
23
нцпюмхвхбюъяэ хлх. мх бкюдекеж юбрнпяйху опюб х мх ндмн дпсцне кхжн, йнрнпне
 
24
лнфер хглемърэ х/хкх онбрнпмн пюяопнярпюмърэ опнцпюллс, мх б йнел яксвюе ме
 
25
мея╗р нрберярбеммнярх, бйкчвюъ кчаше наыхе, яксвюимше, яоежхюкэмше хкх
 
26
онякеднбюбьхе сашрйх, ябъгюммше я хяонкэгнбюмхел хкх онмеяеммше бякедярбхе
 
27
мебнглнфмнярх хяонкэгнбюмхъ опнцпюллш (бйкчвюъ онрепх дюммшу, хкх дюммше,
 
28
ярюбьхе мецндмшлх, хкх сашрйх х/хкх онрепх днунднб, онмеяеммше хг-гю деиярбхи
 
29
рперэху кхж х/хкх нрйюгю опнцпюллш пюанрюрэ янблеярмн я дпсцхлх опнцпюллюлх,
 
30
мн ме нцпюмхвхбюъяэ щрхлх яксвюълх), мн ме нцпюмхвхбюъяэ хлх, дюфе еякх рюйни
 
31
бкюдекеж хкх дпсцне кхжн ашкх хгбеыемш н бнглнфмнярх рюйху сашрйнб х онрепэ.
32
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
59
59
#include <stdlib.h>
60
60
#include <string.h>
61
61
#include <stdio.h>
62
 
#include "nt_types.h"
63
62
#include "struct.h"
64
63
#include "func.h"
65
64
#include "ligas.h"
70
69
 
71
70
#include "compat_defs.h"
72
71
 
73
 
extern BOOL line_readyBL;
74
 
extern BYTE p2_active;
75
 
extern INT  nIncline;
76
 
extern INT  page_nIncline;
77
 
extern BYTE line_scale;
78
 
extern WORD actual_resolution;
79
 
extern BYTE fax1x2;
 
72
extern Bool line_readyBL;
 
73
extern uchar p2_active;
 
74
extern int16_t  nIncline;
 
75
extern int16_t  page_nIncline;
 
76
extern uchar line_scale;
 
77
extern uint16_t actual_resolution;
 
78
extern uchar fax1x2;
80
79
 
81
80
#define WORDMAX  100
82
 
struct word_inf {cell *c; INT dens,n;} bld[WORDMAX];
83
 
INT nw;
 
81
struct word_inf {cell *c; int16_t dens,n;} bld[WORDMAX];
 
82
int16_t nw;
84
83
 
85
84
static void italic(cell *);
86
 
static INT linerev(INT,INT *);
87
 
static LONG inclin(INT,INT *);
 
85
static int16_t linerev(int16_t,int16_t *);
 
86
static int32_t inclin(int16_t,int16_t *);
88
87
static void serif(cell *);
89
88
static void underline();
90
 
static BYTE keg_word(cell *,cell *,INT,B_LINES *);
 
89
static uchar keg_word(cell *,cell *,int16_t,B_LINES *);
91
90
static void bold_word(cell *,cell *,struct word_inf *);
92
 
static INT dens_let(cell *);
93
 
static INT pitch();
 
91
static int16_t dens_let(cell *);
 
92
static int16_t pitch();
94
93
 
95
94
// RCM.C
96
 
extern BYTE line_tabcell;
97
 
extern BOOL pass4_in;
98
 
static BYTE bad_italic[]="03���������eocOC"; // a g m u..."03���������eocOC"
99
 
static BYTE nei_italic[]="02356789()%����������";       // "02356789()%����������"
100
 
static BYTE one_italic[]="��";  // "��"
 
95
extern uchar line_tabcell;
 
96
extern Bool pass4_in;
 
97
static uchar bad_italic[]="03┤▌▒²╔╖╝АМeocOC"; // a g m u..."03гнящЕГНЯЩeocOC"
 
98
static uchar nei_italic[]="02356789()%┤▌▒²╔╖╘╝АМ";      // "02356789()%гнящЕГИНЯЩ"
 
99
static uchar one_italic[]="╒╙"; // "БЙ"
101
100
 
102
101
#define STAT_PIT
103
102
#ifdef  STAT_PIT
104
 
struct B { INT mid; // �ࠪ���⨪�
105
 
           INT real;
106
 
           INT max,min;
107
 
           WORD n; // �᫮ ᨬ�����
 
103
struct B { int16_t mid; // Е═Ю═╙Б╔Ю╗АБ╗╙═
 
104
           int16_t real;
 
105
           int16_t max,min;
 
106
           uint16_t n; // Г╗А╚╝ А╗╛╒╝╚╝╒
108
107
           };
109
108
typedef struct B STAT;
110
109
 
121
120
 
122
121
 for(i=1;i<16;i++){
123
122
   for(j=0;j<16;j++){
124
 
   // ������ ⮫쪮 �� ����� ��ப�
125
 
       BYTE * byte = (BYTE *)(stat+i*16+j);
 
123
   // ╞╔Г═Б═БЛ Б╝╚Л╙╝ ╜╔ ╞ЦАБК╔ АБЮ╝╙╗
 
124
       uchar * byte = (uchar *)(stat+i*16+j);
126
125
       for(k=0;k<sizeof(STAT);k++)
127
126
            if(byte[k])
128
127
                {
136
135
                }
137
136
  }
138
137
 }
139
 
 memset(stat,0,sizeof(STAT)*256);// ���ᨢ ����� ���� �ᯮ�짮��� �������
 
138
 memset(stat,0,sizeof(STAT)*256);// ╛═АА╗╒ ╛╝╕╔Б ║КБЛ ╗А╞╝╚Л╖╝╒═╜ ╞╝╖╓╜╔╔
140
139
}
141
140
#endif
142
141
 
161
160
 
162
161
 }
163
162
 
164
 
static BYTE twinsl[]={"cCpPsSvVwVxXzZ0O1l"};
165
 
static BYTE twinsr[]={"�������������������������������������������"};
166
 
//                                    "����������������������������������������������������������
 
163
static uchar twinsl[]={"cCpPsSvVwVxXzZ0O1l"};
 
164
static uchar twinsr[]={"╒┌ё┐╓└╕├╖┤╗┬╘┴╙┼╚▀╛▄╜█╝▌╞▐Ю░А▒Б▓Ц⌠Д■Е•Ф√Г≈Х≤И≥Й К⌡Л°М²Н·О÷"};
 
165
//                                    "БбЦцДдФфГгХхИиЙйКкЛлМмНнОоПпЯяРрСсТтУуЖжВвЬьЫыЗзШшЭэЩщЧчЪъ
167
166
 
168
167
#define NVAR         256 // Valdemar & Oleg
169
168
#define NLET         256
173
172
#define PROBMIN      30000
174
173
#define DPROB        500
175
174
 
176
 
static BYTE solid_italic[]="������"; // a g m u...
177
 
static BYTE strong_italic[]="�����"; // a is not strong
178
 
//static BYTE non_inclinable_letters[]="�Ꭾ�";
 
175
static uchar solid_italic[]="ПЯУВЬЩ"; // a g m u...
 
176
static uchar strong_italic[]="ПЯУВЬ"; // a is not strong
 
177
//static uchar non_inclinable_letters[]="▒А▌╝═";
179
178
static void italic(cell *c)
180
179
 {
181
180
 s_glue GL;
182
181
 servBOX *s;
183
182
 indBOX *h;
184
183
 elmBOX *elm;
185
 
 BYTE let;
186
 
 PBYTE          twins;
187
 
 CHAR font[2*NVAR];
188
 
 WORD i,prob[2*NVAR];
189
 
 INT nansw,maxi,maxni,l;
190
 
 extern PCHAR tableBOX;
191
 
 INT sv_pos_inc , sv_stick_inc, sv_save_stick_inc;
192
 
 BOOL   bad_cur_ge, disable_it=FALSE;
 
184
 uchar let;
 
185
 puchar          twins;
 
186
 char font[2*NVAR];
 
187
 uint16_t i,prob[2*NVAR];
 
188
 int16_t nansw,maxi,maxni,l;
 
189
 extern pchar tableBOX;
 
190
 int16_t sv_pos_inc , sv_stick_inc, sv_save_stick_inc;
 
191
 Bool   bad_cur_ge, disable_it=FALSE;
193
192
 
194
193
if( c->pos_inc==erect_no )
195
194
    disable_it=TRUE;
199
198
 sv_save_stick_inc = c->save_stick_inc ;
200
199
 
201
200
 c->save_stick_inc = c->stick_inc;
202
 
 c->stick_inc = (INT)0x8000;
 
201
 c->stick_inc = (int16_t)0x8000;
203
202
 bad_cur_ge = (c->vers[0].let==r_cu_z &&
204
203
    (c->recsource==c_rs_ev || c->recsource==(c_rs_ev|c_rs_deskr)) &&
205
204
    c->vers[0].prob==254);
249
248
          is_liga(let) ||  // 14.09.2000 E.P.
250
249
      memchr("$&#257/",let,7) ||
251
250
      language==LANG_RUSSIAN && let==r_cu_z )
252
 
  if( !memchr("��",let,2) )
 
251
  if( !memchr("╚▀",let,2) )
253
252
   {
254
253
      c->stick_inc |= 0x1000;
255
254
      goto ret;
325
324
  }
326
325
 
327
326
ret:
328
 
c->pos_inc        = (BYTE)sv_pos_inc        ;
 
327
c->pos_inc        = (uchar)sv_pos_inc        ;
329
328
c->stick_inc      = sv_stick_inc      ;
330
329
c->save_stick_inc = sv_save_stick_inc ;
331
330
return;
332
331
}
333
332
 
334
 
// ������� ����������� � ��������� ������������ '���������' �� ������ ����.
335
 
// ��� ����� ������������� ������-0x01 �/��� �����-0x02 �� �����
336
 
static CHAR tabincl[256]={
 
333
// рЮАКХЖЮ ХМТНПЛХПСЕР Н БНГЛНФМНЛ ПЮЯОНКНФЕМХХ 'ГЮБХРСЬЕЙ' МЮ ЙНМЖЮУ АСЙБ.
 
334
// нМХ ЛНЦСР ПЮЯОНКЮЦЮРЭЯЪ ЯОПЮБЮ-0x01 Х/ХКХ ЯКЕБЮ-0x02 НР АСЙБШ
 
335
static char tabincl[256]={
337
336
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    // 0  - 23
338
337
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,    // 24 - 47
339
338
//                        ! " # $ % & ' ( ) * + , - . /
346
345
        0,2,0,1,0,0,0,2,3,3,2,3,3,3,0,2,1,2,0,3,3,0,0,0,0,0,// 97 - 122
347
346
//      a b c d e f g h i j k l m n o p q r s t u v w x y z
348
347
        0,0,0,0,0,0,2,2,2,0,2,3,0,3,3,2,1,3,3,0,3,2,0,3,3,0,3,3,//123 - 150
349
 
//      { | } ~  � � � � � � � � � � � � � � � � � � � � � � �
 
348
//      { | } ~  ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ▀ ▄ █ ▌ ▐ ░ ▒ ▓ ⌠ ■ • √
350
349
        3,3,3,2,3,2,0,2,1,0,0,2,2,0,0,3,0,3,3,2,1,3,3,0,3,0,// 151 - 176
351
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � �
 
350
//      ≈ ≤ ≥   ⌡ ° ² · ÷ ═ ║ ╒ ё ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
352
351
        0, 0, 0, 0,  2, 2,0,0, 0, 2,1,0,0,                  // 177 - 189
353
352
//     fi fl ff ffi rt ri % % ffl i j ! ?
354
 
//      �  �  �  �   �  � � �  �  � � � �
 
353
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
355
354
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
356
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
355
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
357
356
        2,0,3,3,3,3,3,3,3,3,2,3,2,0,2,1,                    // 224 - 239
358
 
//      � � � � � � � � � � � � � � � �
 
357
//      Ю А Б Ц Д Е Ф Г Х И Й К Л М Н О
359
358
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
360
 
//      � � � � � � � � � � � � � � �
 
359
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
361
360
#define KEGMAX    63
362
361
#define KEGMIN    12
363
362
#define WMAX     128
366
365
#define BNDINCL  200
367
366
#define BNDNINCL 150
368
367
 
369
 
INT letincl(cell *c)
 
368
int16_t letincl(cell *c)
370
369
 {
371
 
 BYTE f,let;
372
 
 INT i,mini,maxi,h,nr,nl;
373
 
 INT left[KEGMAX],right[KEGMAX];
 
370
 uchar f,let;
 
371
 int16_t i,mini,maxi,h,nr,nl;
 
372
 int16_t left[KEGMAX],right[KEGMAX];
374
373
 lnhead *line;
375
374
 interval *intv0,*intv,*intve;
376
 
 LONG s;
 
375
 int32_t s;
377
376
 
378
377
 let=let_sans_acc[c->vers[0].let];
379
378
 //if( language==LANG_RUSSIAN || language==LANG_ENGLISH )
388
387
/* printf("let=%c,h=%u,mini=%u,maxi=%u\n",let,c->h,mini,maxi);*/
389
388
 if (f&RINCL) {memset(right,0,h+h); nr=h;}
390
389
 if (f&LINCL) {for (i=0; i<h; i++) left[i]=WMAX; nl=h;}
391
 
 for (line=(lnhead *)((PCHAR)(c->env)+c->env->lines+sizeof(INT));
392
 
                         line->lth>0; line=(lnhead *)((PCHAR)line+line->lth))
 
390
 for (line=(lnhead *)((pchar)(c->env)+c->env->lines+sizeof(int16_t));
 
391
                         line->lth>0; line=(lnhead *)((pchar)line+line->lth))
393
392
  if (line->row<=maxi && line->row+line->h>mini)
394
393
   {
395
 
   intv0=(interval *)((PCHAR)line+sizeof(lnhead));
 
394
   intv0=(interval *)((pchar)line+sizeof(lnhead));
396
395
   intv=intv0+MAX(0,mini-line->row);
397
396
   intve=intv0+MIN(maxi+1-line->row,line->h);
398
397
/*   printf("y=%u,h=%u,b=%u,e=%u\n",line->row,line->h,
417
416
 return 0;
418
417
 }
419
418
 
420
 
static INT linerev(INT n,INT *line)
 
419
static int16_t linerev(int16_t n,int16_t *line)
421
420
 {
422
 
 INT i,beg,end;
 
421
 int16_t i,beg,end;
423
422
 
424
423
 if (n<KEGMIN/2)
425
424
  return n;
432
431
 return end-beg+1;
433
432
 }
434
433
 
435
 
static LONG inclin(INT n,INT *line)
 
434
static int32_t inclin(int16_t n,int16_t *line)
436
435
 {
437
 
 INT x;
438
 
 LONG sy,sxy,inc;
 
436
 int16_t x;
 
437
 int32_t sy,sxy,inc;
439
438
 
440
439
 for (sxy=sy=x=0; x<n; x++)
441
440
  {sy+=line[x]; sxy+=x*line[x];}
447
446
#define LSER      1
448
447
#define HSER      2
449
448
 
450
 
// ������ ���ନ��� � ��������� �ᯮ������� ��䮢 �� �㪢�
451
 
// ��� ����� ࠯��������� � ������-0x01 �/��� ���孥�-0x02 ��� �㪢�
452
 
static CHAR tabserif[256]={
 
449
// ▓═║╝╗Ф═ ╗╜Д╝Ю╛╗ЮЦ╔Б ╝ ╒╝╖╛╝╕╜╝╛ Ю═А╞╝╚╝╕╔╜╗╗ А╔Ю╗Д╝╒ ╜═ ║Ц╙╒╔
 
450
// ▌╜╗ ╛╝ёЦБ Ю═╞╝╚╝ё═БЛАО ╒ ╜╗╕╜╔╘-0x01 ╗/╗╚╗ ╒╔ЮЕ╜╔╘-0x02 Г═АБ╗ ║Ц╙╒К
 
451
static char tabserif[256]={
453
452
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,        //  0-23
454
453
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,        // 24-47
455
454
//                        ! " # $ % & ' ( ) * + , - . /
462
461
        0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,3,3,1,0,0,0,2,2,0,2,0,    // 97-122
463
462
//      a b c d e f g h i j k l m n o p q r s t u v w x y z
464
463
        0,0,0,0,0,1,3,3,3,1,3,0,0,3,3,3,1,3,3,0,1,3,0,1,2,3,0,3,//123-150
465
 
//      { | } ~  � � � � � � � � � � � � � � � � � � � � � � �
 
464
//      { | } ~  ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ▀ ▄ █ ▌ ▐ ░ ▒ ▓ ⌠ ■ • √
466
465
        3,0,0,3,3,3,0,0,3,0,0,3,3,1,0,0,0,3,3,3,1,3,3,0,1,0,    //151-176
467
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � �
 
466
//      ≈ ≤ ≥   ⌡ ° ² · ÷ ═ ║ ╒ ё ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
468
467
        1, 1, 1, 1,  1, 1,0,0, 1, 1,0,0,0,                      // 177-189
469
468
//     fi fl ff ffi rt ri % % ffl i j ! ?
470
 
//      �  �  �  �   �  � � �  �  � � � �
 
469
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
471
470
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
472
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
471
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
473
472
        3,0,3,2,3,0,3,3,0,0,3,3,3,0,0,3,                        // 224 - 239
474
 
//      � � � � � � � � � � � � � � � �
 
473
//      Ю А Б Ц Д Е Ф Г Х И Й К Л М Н О
475
474
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                       // 240 - 255
476
 
//      � � � � � � � � � � � � � � �
 
475
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
477
476
 
478
477
 
479
478
static void serif(cell *c)
480
479
 {
481
 
 BYTE let;
 
480
 uchar let;
482
481
 lnhead *line;
483
482
 interval *i1,*i2;
484
 
 INT H,n1,n2,h,b1,b2,e1,e2;
 
483
 int16_t H,n1,n2,h,b1,b2,e1,e2;
485
484
 
486
485
 H=c->h;
487
486
 let=let_sans_acc[c->vers[0].let];
488
 
 for (n1=n2=0,line=(lnhead *)((PCHAR)(c->env)+c->env->lines+sizeof(INT));
489
 
                         line->lth>0; line=(lnhead *)((PCHAR)line+line->lth))
 
487
 for (n1=n2=0,line=(lnhead *)((pchar)(c->env)+c->env->lines+sizeof(int16_t));
 
488
                         line->lth>0; line=(lnhead *)((pchar)line+line->lth))
490
489
  {
491
490
  if (tabserif[let]&LSER && line->flg&l_fend && (h=line->h)>=5 && h>=H/4 &&
492
491
      line->row+h+2>=H && !(c->font&c_fp_it && memchr("BLb",let,3)))
493
492
   {
494
 
   i1=(interval *)((PCHAR)line+sizeof(lnhead))+(h-3);
 
493
   i1=(interval *)((pchar)line+sizeof(lnhead))+(h-3);
495
494
   i2=i1-(H/4-3);
496
495
   b1=MIN(MIN(i1->e-i1->l,(i1+1)->e-(i1+1)->l),(i1+2)->e-(i1+2)->l);
497
496
   e1=MAX(MAX(i1->e,(i1+1)->e),(i1+2)->e);
502
501
  if (tabserif[let]&HSER && line->flg&l_fbeg && (h=line->h)>=5 && h>=H/4 &&
503
502
      line->row<=2 && !(c->font&c_fp_it && let=='q'))
504
503
   {
505
 
   i1=(interval *)((PCHAR)line+sizeof(lnhead));
 
504
   i1=(interval *)((pchar)line+sizeof(lnhead));
506
505
   i2=i1+(H/4-1);
507
506
   b1=MIN(MIN(i1->e-i1->l,(i1+1)->e-(i1+1)->l),(i1+2)->e-(i1+2)->l);
508
507
   e1=MAX(MAX(i1->e,(i1+1)->e),(i1+2)->e);
515
514
 if (n1<n2) c->font|=c_fp_gelv;
516
515
 }
517
516
 
518
 
INT pitchsize=0;
519
 
INT averwid;
 
517
int16_t pitchsize=0;
 
518
int16_t averwid;
520
519
 
521
520
#define LSTRMAX 300
522
521
#define LSTRMIN 5
530
529
#define NTHLMAX  3
531
530
#define DELTMAX  4
532
531
 
533
 
static INT total_pitch=0;  // =0 Nick 04.01.2002
534
 
static INT base_prevstr=0; // =0 Nick 04.01.2002
535
 
static INT kegl_prevstr=0; // =0 Nick 04.01.2002
 
532
static int16_t total_pitch=0;  // =0 Nick 04.01.2002
 
533
static int16_t base_prevstr=0; // =0 Nick 04.01.2002
 
534
static int16_t kegl_prevstr=0; // =0 Nick 04.01.2002
536
535
 
537
536
void checkpitch()
538
537
 {
539
 
 extern INT line_number;
540
 
 extern BOOL pass4_in;
 
538
 extern int16_t line_number;
 
539
 extern Bool pass4_in;
541
540
 B_LINES bl;
542
541
 
543
542
 get_b_lines(NULL,&bl);
548
547
 pitchsize=pitch();
549
548
 }
550
549
 
551
 
static INT pitch()
 
550
static int16_t pitch()
552
551
 {
553
552
 cell *c;
554
 
 BYTE let;
555
 
 INT nl,nc,ng,n,n1,n2,h,w,ww,wmin,wmax,i,j,sp,bad,d,p,mg;
556
 
 LONG s,min;
557
 
 WORD center[LSTRMAX],left[LSTRMAX],right[LSTRMAX];
 
553
 uchar let;
 
554
 int16_t nl,nc,ng,n,n1,n2,h,w,ww,wmin,wmax,i,j,sp,bad,d,p,mg;
 
555
 int32_t s,min;
 
556
 uint16_t center[LSTRMAX],left[LSTRMAX],right[LSTRMAX];
558
557
 
559
558
 for (nl=nc=ng=0,c=(cell_f())->next; c->next!=NULL; c=c->next)
560
559
  if (c->flg&(c_f_let|c_f_bad))
623
622
 if (averwid<h/2)
624
623
  return 0;
625
624
 
626
 
 if( averwid <= 1 )  // Nick 01.04.2002 - �������� ������� �� 0
 
625
 if( averwid <= 1 )  // Nick 01.04.2002 - ХГАЕФЮРЭ ДЕКЕМХЪ МЮ 0
627
626
         return 0;
628
627
 
629
628
 wmin=2*averwid/3;
707
706
// AK 19.02.98
708
707
void font_str()
709
708
{
710
 
        INT ni1,ni2,ns1,ns2,nu,n,trp;
 
709
        int16_t ni1,ni2,ns1,ns2,nu,n,trp;
711
710
        cell *c,*c1,*c2;
712
 
        BYTE fnt,fntu,fntprev;
713
 
        BYTE keg,kegprev;
 
711
        uchar fnt,fntu,fntprev;
 
712
        uchar keg,kegprev;
714
713
        B_LINES bl;
715
714
 
716
715
 
717
716
        struct word_inc
718
717
        {
719
718
                cell *c1,*c;
720
 
                INT bool,n;
721
 
                BYTE fnt;
 
719
                int16_t bool,n;
 
720
                uchar fnt;
722
721
        } w_inc[WORDMAX];
723
722
 
724
 
        INT nwi=1; // 0 is fictive as left neigbor
 
723
        int16_t nwi=1; // 0 is fictive as left neigbor
725
724
 
726
725
        snap_newpass('i');
727
726
 
796
795
                                        fnt|=c_fp_str;
797
796
 
798
797
                                        {
799
 
                                                CHAR snap[80], sg[30], tmps[30];
 
798
                                                char snap[80], sg[30], tmps[30];
800
799
 
801
800
                                                if( ni1 == 0 && ni2 == 0 )
802
801
                                                        strcpy(tmps," NO ");
831
830
 
832
831
                                //save prew word :
833
832
                                {
834
 
                                        INT  bool=0;
 
833
                                        int16_t  bool=0;
835
834
 
836
835
                                        for (c2=c1; c2!=c; c2=c2->next)
837
836
                                        {
946
945
        //use neigbor information for italic :
947
946
    if(0)
948
947
        {
949
 
                INT  i,fl,fr,fnt;
 
948
                int16_t  i,fl,fr,fnt;
950
949
 
951
950
                w_inc[0].fnt = 0;
952
951
                w_inc[0].bool = 0;
977
976
                        if( fnt && (fnt^(c_fp_it+c_fp_str)) )
978
977
                        {
979
978
                                w_inc[i].bool = 0;
980
 
                                w_inc[i].fnt = (BYTE)fnt;
 
979
                                w_inc[i].fnt = (uchar)fnt;
981
980
                                {
982
 
                                        CHAR snap[80],sg[30];
 
981
                                        char snap[80],sg[30];
983
982
 
984
983
                                        if( fnt & c_fp_it )
985
984
                                                strcpy(sg," ITA");
1095
1094
 {
1096
1095
//      return;
1097
1096
extern STRLN page_lines[];
1098
 
extern Int32 num_of_lines;
 
1097
extern int32_t num_of_lines;
1099
1098
 
1100
 
 INT nl=(INT)num_of_lines;
 
1099
 int16_t nl=(int16_t)num_of_lines;
1101
1100
 
1102
1101
 STRLN *lines=page_lines;
1103
 
 INT i,bx,by,ex,ey,x;
 
1102
 int16_t i,bx,by,ex,ey,x;
1104
1103
 B_LINES bl;
1105
1104
 cell *c,*cf,*cl;
1106
1105
 
1114
1113
  by=lines[i].beg.y>>line_scale;
1115
1114
  ex=lines[i].end.x>>line_scale;
1116
1115
  ey=lines[i].end.y>>line_scale;
1117
 
  by-=(INT)((LONG)nIncline*bx/2048);
1118
 
  ey-=(INT)((LONG)nIncline*ex/2048);
 
1116
  by-=(int16_t)((int32_t)nIncline*bx/2048);
 
1117
  ey-=(int16_t)((int32_t)nIncline*ex/2048);
1119
1118
  if (MIN(by,ey)<bl.b3 || MAX(by,ey)>bl.b3+bl.ps/2 ||
1120
1119
      cf->r_col-bl.ps>bx || cl->r_col+cl->w+bl.ps<ex)
1121
1120
    continue;
1131
1130
 
1132
1131
#define BNDPROB 100
1133
1132
/*
1134
 
static CHAR tabpos[256]={
 
1133
static char tabpos[256]={
1135
1134
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1136
1135
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1137
1136
//                        ! " # $ % & ' ( ) * + , - . /
1149
1148
        0, 0, 0, 0,  4, 1,0,0, 0, 2,0,0,0};
1150
1149
//     fi fl ff ffi rt ri % % ffl i j ! ?
1151
1150
  */
1152
 
// ������ ���ନ��� � ��������� �ᯮ������� �㪢� �⭮�⥫쭮
1153
 
//  4-� ������� �����.
 
1151
// ▓═║╚╗Ф═ ╗╜Д╝Ю╛╗ЮЦ╔Б ╝ ╒╝╖╛╝╕╜╝╛ Ю═А╞╝╚╝╕╔╜╗╗ ║Ц╙╒К ╝Б╜╝А╗Б╔╚Л╜╝
 
1152
//  4-Е ║═╖╝╒КЕ ╚╗╜╗╘.
1154
1153
// ___________
1155
1154
// ___________   2                     0,4 -- ??????
1156
1155
// ___________ 1 2 3
1157
1156
// ___________     3
1158
1157
//
1159
 
static CHAR tabpos[256]={
 
1158
static char tabpos[256]={
1160
1159
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,     //  0-23
1161
1160
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,     // 24-47
1162
1161
//                        ! " # $ % & ' ( ) * + , - . /
1169
1168
        1,2,1,2,1,0,3,2,0,3,2,2,1,1,1,3,3,1,1,4,1,1,1,1,3,1, // 97-122
1170
1169
//      a b c d e f g h i j k l m n o p q r s t u v w x y z
1171
1170
        0,0,0,0,0,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,//123-150                ,0,
1172
 
//      { | } ~  � � � � � � � � � � � � � � � � � � � � � � �
 
1171
//      { | } ~  ─ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ▀ ▄ █ ▌ ▐ ░ ▒ ▓ ⌠ ■ • √
1173
1172
        2,2,0,2,2,2,2,2,2,1,2,1,1,0,1,1,1,1,0,1,1,1,1,1,1,0,// 151 - 176
1174
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1173
//      ≈ ≤ ≥   ⌡ ° ² · ÷ ═ ║ ╒ ё ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
1175
1174
        0, 0, 0, 0,  4, 1,0,0, 0, 2,0,0,0,                  // 177-189
1176
1175
//     fi fl ff ffi rt ri % % ffl i j ! ?
1177
 
//      �  �  �  �   �  � � �  �  � � � �
 
1176
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1178
1177
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1179
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1178
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1180
1179
        3,1,1,3,3,1,0,1,1,0,1,1,1,1,1,1,                    // 224 - 239
1181
 
//      � � � � � � � � � � � � � � � �
 
1180
//      Ю А Б Ц Д Е Ф Г Х И Й К Л М Н О
1182
1181
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
1183
 
//      � � � � � � � � � � � � � � �
 
1182
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
1184
1183
// from pass3.c
1185
 
static BYTE keg_word(cell *c1,cell *c2,INT n,B_LINES *bl)
 
1184
static uchar keg_word(cell *c1,cell *c2,int16_t n,B_LINES *bl)
1186
1185
 {
1187
 
 INT s[4],m[4],i,ss,bm1,bm2;
 
1186
 int16_t s[4],m[4],i,ss,bm1,bm2;
1188
1187
 cell *c;
1189
1188
 version *v;
1190
1189
 
1191
1190
 if (!n) return 0;
1192
1191
 if (bl->n2>=3 && bl->n3>=3)
1193
 
  return (BYTE)bl->ps;
 
1192
  return (uchar)bl->ps;
1194
1193
 if( bl->n1>=3 && bl->n3>=3 && bl->n2<1 && bl->n4<1 )
1195
 
  return (BYTE)bl->ps;
 
1194
  return (uchar)bl->ps;
1196
1195
 if( line_readyBL )
1197
 
  return (BYTE)bl->ps;
 
1196
  return (uchar)bl->ps;
1198
1197
 for (ss=s[0]=s[1]=s[2]=s[3]=m[0]=m[1]=m[2]=m[3]=bm1=bm2=0,c=c1;
1199
1198
                                                         c!=c2; c=c->next)
1200
1199
  if (c->flg&c_f_let)
1253
1252
  bl->ps=(6*bl->ps+2)/5;
1254
1253
 if (ss && abs(ss-(bl->ps+((fax1x2)?2:0)))<=1)
1255
1254
  ss=bl->ps+((fax1x2)?2:0);
1256
 
 return (BYTE)ss;
 
1255
 return (uchar)ss;
1257
1256
 }
1258
1257
 
1259
1258
#define NOTAPPL -200
1266
1265
static void bold_word(cell *c1,cell *c2,struct word_inf *inf)
1267
1266
 {
1268
1267
 cell *c;
1269
 
 INT sd,nd,td;
 
1268
 int16_t sd,nd,td;
1270
1269
 
1271
1270
 for (sd=nd=0,c=c1; c!=c2; c=c->next)
1272
1271
  {
1288
1287
 inf->n=nd;
1289
1288
if(0)
1290
1289
{
1291
 
   CHAR snap[80],sg[30];
1292
 
   INT  ser,gel;
 
1290
   char snap[80],sg[30];
 
1291
   int16_t  ser,gel;
1293
1292
 
1294
1293
   ser = gel = 0;
1295
1294
   for(c=c1; c!=c2; c=c->next){
1317
1316
}
1318
1317
 }
1319
1318
 
1320
 
static CHAR aver_dens;
 
1319
static char aver_dens;
1321
1320
 
1322
1321
void avdens()
1323
1322
 {
1324
1323
 //str *ln;
1325
 
 LONG /*l,*/s,n;
 
1324
 int32_t /*l,*/s,n;
1326
1325
 //c_comp **curr,**last,*cmp;
1327
1326
 lnhead *line;
1328
1327
 interval *ic,*ie;
1329
 
 //extern PBYTE box_pool,string_curr;
1330
 
 //extern PBYTE comp_file,comp_curr;
1331
 
 //extern WORD comp_lth;
 
1328
 //extern puchar box_pool,string_curr;
 
1329
 //extern puchar comp_file,comp_curr;
 
1330
 //extern uint16_t comp_lth;
1332
1331
 cell *c,*c1=cell_f(),*c2=cell_l();
1333
1332
 
1334
1333
 total_pitch=0;  // =0 Nick 04.01.2002 was =-1
1337
1336
        if ( !(c->flg & (c_f_let|c_f_bad)) )
1338
1337
                continue;
1339
1338
        n+=(c->env->h)*(c->env->w);
1340
 
        for( line=(lnhead *)((PCHAR)(c->env)+c->env->lines+sizeof(INT));
1341
 
                         line->lth>0; line=(lnhead *)((PCHAR)line+line->lth))
 
1339
        for( line=(lnhead *)((pchar)(c->env)+c->env->lines+sizeof(int16_t));
 
1340
                         line->lth>0; line=(lnhead *)((pchar)line+line->lth))
1342
1341
                {
1343
 
                for (ie=(ic=(interval *)((PBYTE)line+sizeof(lnhead)))+line->h;
 
1342
                for (ie=(ic=(interval *)((puchar)line+sizeof(lnhead)))+line->h;
1344
1343
                          ic<ie; ic++)
1345
1344
                        {
1346
1345
                        s+=ic->l;
1348
1347
                }
1349
1348
        }
1350
1349
 /*
1351
 
 for (s=n=0,ln=(str *)box_pool; (PBYTE)ln!=string_curr;
1352
 
                                          ln=(str *)((PBYTE)ln+ln->lth))
 
1350
 for (s=n=0,ln=(str *)box_pool; (puchar)ln!=string_curr;
 
1351
                                          ln=(str *)((puchar)ln+ln->lth))
1353
1352
  {
1354
 
  last=(c_comp **)((PBYTE)ln+ln->dust);
 
1353
  last=(c_comp **)((puchar)ln+ln->dust);
1355
1354
 
1356
1355
  for (curr=&(ln->c_comp); curr<last; curr++) //AK 04.03.97 ? for address
1357
1356
   {
1358
1357
   cmp=*curr;
1359
1358
   if (cmp->size==1 && !((file_comp *)cmp)->h && !((file_comp *)cmp)->w)
1360
1359
    {
1361
 
    l=((LONG)((file_comp *)cmp)->lth)<<4;
 
1360
    l=((int32_t)((file_comp *)cmp)->lth)<<4;
1362
1361
    if ((comp_curr-comp_file+l)>>4>comp_lth)
1363
1362
     error_exit(ERR_comp,2);
1364
1363
    read_comp(((file_comp *)cmp)->offset,comp_curr,l);
1366
1365
    }
1367
1366
   if (cmp->h>=KEGMAX || cmp->w>=WMAX) continue;
1368
1367
   n+=(cmp->h)*(cmp->w);
1369
 
   for (line=(lnhead *)((PBYTE)cmp+cmp->lines+sizeof(INT));
1370
 
                  line->lth>0; line=(lnhead *)((PBYTE)line+line->lth))
1371
 
    for (ie=(ic=(interval *)((PBYTE)line+sizeof(lnhead)))+line->h;
 
1368
   for (line=(lnhead *)((puchar)cmp+cmp->lines+sizeof(int16_t));
 
1369
                  line->lth>0; line=(lnhead *)((puchar)line+line->lth))
 
1370
    for (ie=(ic=(interval *)((puchar)line+sizeof(lnhead)))+line->h;
1372
1371
                                                          ic<ie; ic++)
1373
1372
     s+=ic->l;
1374
1373
   }
1391
1390
#define MKEGDENS  65
1392
1391
#define MDENS      4
1393
1392
/*
1394
 
static CHAR tabss[256]={
 
1393
static char tabss[256]={
1395
1394
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1396
1395
    0,0,0,0,0,0,0,0,0,0,0,0,2,-7,1,0,0,0,0,0,0,0,0,-8,
1397
1396
//                    ! " # $  % & ' ( ) * + , - .  /
1409
1408
    3, 3, 1, 3,  3, 4,0,0, 3, 0,0,0,-2};
1410
1409
// fi fl ff ffi rt ri % % ffl i j !  ?
1411
1410
 
1412
 
static CHAR tabgs[256]={
 
1411
static char tabgs[256]={
1413
1412
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1414
1413
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-11,
1415
1414
//                    ! " # $  %  & ' ( ) * + , - .  /
1427
1426
    3, 3, 1, 3, -2, 0,0,0, 3, 0,0,0,-2};
1428
1427
// fi fl ff ffi rt ri % % ffl i j !  ?
1429
1428
 
1430
 
static CHAR tabgi[256]={
 
1429
static char tabgi[256]={
1431
1430
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1432
1431
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-9,
1433
1432
//                    ! " # $  %  & ' ( ) * + , - .  /
1445
1444
    2, 3, 0, 2,  2, 3,0,0, 2, 0,0,0,-2};
1446
1445
// fi fl ff ffi rt ri % % ffl i j !  ?
1447
1446
 
1448
 
static CHAR tabcr[256]={
 
1447
static char tabcr[256]={
1449
1448
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1450
1449
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-8,
1451
1450
//                    ! " # $  %  & ' ( ) * + , - .  /
1463
1462
    3, 3, 1, 3,  3, 4,0,0, 3, 0,0,0,-2};
1464
1463
// fi fl ff ffi rt ri % % ffl i j !  ?
1465
1464
 
1466
 
static CHAR tabmd[256]={
 
1465
static char tabmd[256]={
1467
1466
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1468
1467
    0,0,0,0,0,0,0,0,0,0,0,0,2,-7,-1,0,0,0,0,0,0,0,0,-8,
1469
1468
//                    ! " # $  %  & ' ( ) * + , - .  /
1482
1481
// fi fl ff ffi rt ri % % ffl i j !  ?
1483
1482
  */
1484
1483
 
1485
 
// ������� ������������� ��������� ����� � ����������� ��
1486
 
// ������ ����� �������.
 
1484
// рЮАКХЖШ ЙНППЕЙРХПНБЙХ ОКНРМНЯРХ АСЙБШ Б ГЮБХЯХЛНЯРХ НР
 
1485
// ПЮГМШУ РХОНБ ЬПХТРНБ.
1487
1486
 
1488
 
//  ���� ����� ����� ��� '������'.
1489
 
static CHAR tabgi[256]={
 
1487
//  еЯКХ ЬПХТР ХЛЕЕР РХО 'ХРЮКХЙ'.
 
1488
static char tabgi[256]={
1490
1489
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1491
1490
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-9,
1492
1491
//                    ! " # $  %  & ' ( ) * + , - .  /
1499
1498
    3,-2,-2,-2,3,-5,0,-2,0,0,-2,0,1,2,2,-1,-3,-2,2,0,2,-3,2,-1,-4,0,
1500
1499
//  a  b  c  d e  f g  h i j  k l m n o  p  q  r s t u  v w  x  y z
1501
1500
        0,0,0,0,0,-1,2,3,-4,-1,-2,-1,-2,-1,-1,-1,-2, 0,-2,-1,-1,-1,-3,-2,-3, 1,-2,-3,//123-150                ,0,
1502
 
//      { | } ~   � � �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �  �
 
1501
//      { | } ~   ─ │ ┌  ┐  └  ┘  ├  ┤  ┬  ┴  ┼  ▀  ▄  █  ▌  ▐  ░  ▒  ▓  ⌠  ■  •  √
1503
1502
        -1,-1,-2, 3, 1, 0,-2, 0,2,3,-1, 6,-2,2,3,2,1,2,2,1,1,2,2,2,2,0,// 151 - 176
1504
 
//       �  �  �  �  �  �  �  � � �  �  �  � � � � � � � � � � � � � �
 
1503
//       ≈  ≤  ≥     ⌡  °  ²  · ÷ ═  ║  ╒  ё ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
1505
1504
        2, 3, 0, 2,  2, 3,0,0, 2, 0,0,0,-2,
1506
1505
//     fi fl ff ffi rt ri % % ffl i j ! ?
1507
 
//      �  �  �  �   �  � � �  �  � � � �
 
1506
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1508
1507
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1509
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1508
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1510
1509
        -1,-2,-2,-2,-2, 1,1,1,3,1, 5,4,4,0,4,4,                    // 224 - 239
1511
 
//       �  �  �  �  �  � � � � �  � � � � � �
 
1510
//       Ю  А  Б  Ц  Д  Е Ф Г Х И  Й К Л М Н О
1512
1511
        0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0};                   // 240 - 255
1513
 
//      � � � � � � � � � � � � � � �
1514
 
 
1515
 
 
1516
 
 
1517
 
// ����� ���� ���ᨢ� �᫨ ���� �� ������.
1518
 
//  ��ਭ� �㪢� ����।�����. ���� ����.
1519
 
static CHAR tabss[256]={
 
1512
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
 
1513
 
 
1514
 
 
1515
 
 
1516
// └═╚╔╔ ╗╓ЦБ ╛═АА╗╒К ╔А╚╗ ХЮ╗ДБ █┘ ┬▓─▀┬┼.
 
1517
//  ≤╗Ю╗╜═ ║Ц╙╒К ╜╔╝╞Ю╔╓╔╚╔╜═. ≤Ю╗ДБ А╔Ю╗Д╜К╘.
 
1518
static char tabss[256]={
1520
1519
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1521
1520
    0,0,0,0,0,0,0,0,0,0,0,0,2,-7,1,0,0,0,0,0,0,0,0,-8,
1522
1521
//                    ! " # $  % & ' ( ) * + , - .  /
1529
1528
    4,-1,0,0,3,0,2,1,0,-1,-1,0,3,4,3,-1,-1,1,3,0,4,-2,0,2,-2,2,
1530
1529
//  a  b c d e f g h i  j  k l m n o  p  q r s t u  v w x  y z
1531
1530
        0,0,0,0,0,-3,2,4,-2,-3,3,-2,0, 0, 0,-1,-4,0,0,-2,0, 0,-3,-3,-4, 0,-2,-3,//123-150                ,0,
1532
 
//      { | } ~   � � �  �  � �  � �  �  �  �  � � �  � �  �  �  �  �  �  � �
 
1531
//      { | } ~   ─ │ ┌  ┐  └ ┘  ├ ┤  ┬  ┴  ┼  ▀ ▄ █  ▌ ▐  ░  ▒  ▓  ⌠  ■  • √
1533
1532
        -2, 0,-2,-1, 0, 1, 0,-1,1,3,2,6,1,0,4,2,2,4,4, 3,-2,3,3,1,4,0,// 151 - 176
1534
 
//       �  �  �  �  �  �  �  � � � � � � � � � � � �  �  � � � � � �
 
1533
//       ≈  ≤  ≥     ⌡  °  ²  · ÷ ═ ║ ╒ ё ╓ ╔ ╕ ╖ ╗ ╘  ╙  ╚ ╛ ╜ ╝ ╞ ╟
1535
1534
        3, 3, 1, 3,  3, 4,0,0, 3, 0,0,0,-2,
1536
1535
//     fi fl ff ffi rt ri % % ffl i j ! ?
1537
 
//      �  �  �  �   �  � � �  �  � � � �
 
1536
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1538
1537
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1539
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1538
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1540
1539
         1,1,0,-4,-1,3,0,1,2,0, 0,4, 2,2,2,4,                    // 224 - 239
1541
 
//       � � �  �  � � � � � �  � �  � � � �
 
1540
//       Ю А Б  Ц  Д Е Ф Г Х И  Й К  Л М Н О
1542
1541
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
1543
 
//      � � � � � � � � � � � � � � �
1544
 
 
1545
 
 
1546
 
//  ��ਭ� �㪢� ����।�����. ���� �� ����.
1547
 
static CHAR tabgs[256]={
 
1542
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
 
1543
 
 
1544
 
 
1545
//  ≤╗Ю╗╜═ ║Ц╙╒К ╜╔╝╞Ю╔╓╔╚╔╜═. ≤Ю╗ДБ █┘ А╔Ю╗Д╜К╘.
 
1546
static char tabgs[256]={
1548
1547
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1549
1548
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-11,
1550
1549
//                    ! " # $  %  & ' ( ) * + , - .  /
1557
1556
    3,0,-1,0,2,-1,3,0,0,0,-1,0,1,3,1,1,0,0,2,0,1,-2,1,0,-3,2,
1558
1557
//  a b  c d e  f g h i j  k l m n o p q r s t u  v w x  y z
1559
1558
        0,0,0,0,0,-2,2,4,-4,-2,0,-1,-1,2,2,-1,-2,2,0,-2,1,-1,-3,-5,-3,-1,-2,-3,//123-150                ,0,
1560
 
//      { | } ~   � � �  �  � �  �  � � �  �  � � �  � �  �  �  �  �  �  �  �
 
1559
//      { | } ~   ─ │ ┌  ┐  └ ┘  ├  ┤ ┬ ┴  ┼  ▀ ▄ █  ▌ ▐  ░  ▒  ▓  ⌠  ■  •  √
1561
1560
        -3, 0,-3,-2, 1,0,-1,0,1,4,2,8,-1,1,4,3,3,6,4, 4, 1,5,4,2,4,0,// 151 - 176
1562
 
//       �  �  �  �  � �  � � � � � �  � � � � � � �  �  � � � � � �
 
1561
//       ≈  ≤  ≥     ⌡ °  ² · ÷ ═ ║ ╒  ё ╓ ╔ ╕ ╖ ╗ ╘  ╙  ╚ ╛ ╜ ╝ ╞ ╟
1563
1562
        3, 3, 1, 3, -2, 0,0,0, 3, 0,0,0,-2,
1564
1563
//     fi fl ff ffi rt ri % % ffl i j ! ?
1565
 
//      �  �  �  �   �  � � �  �  � � � �
 
1564
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1566
1565
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1567
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1566
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1568
1567
        1, 1,-4,-3,-1,2,-0,1,3,-1,-0,5,3,2,3,4,                    // 224 - 239
1569
 
//      �  �  �  �  � �  � � �  �  � � � � � �
 
1568
//      Ю  А  Б  Ц  Д Е  Ф Г Х  И  Й К Л М Н О
1570
1569
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
1571
 
//      � � � � � �   � � � � � � � �   �
1572
 
 
1573
 
 
1574
 
 
1575
 
//   . ��ਭ� �㪢� ����� 祬 ࠧ��� �����.
1576
 
static CHAR tabcr[256]={
 
1570
//      П Я Р С Т У   Ж В Ь Ы З Ш Э Щ   Ч
 
1571
 
 
1572
 
 
1573
 
 
1574
//   . ≤╗Ю╗╜═ ║Ц╙╒К ║╝╚ЛХ╔ Г╔╛ Ю═╖╛╔Ю ╙╔ё╚О.
 
1575
static char tabcr[256]={
1577
1576
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1578
1577
    0,0,0,0,0,0,0,0,0,0,0,0,1,-7,-1,0,0,0,0,0,0,0,0,-8,
1579
1578
//                    ! " # $  %  & ' ( ) * + , - .  /
1586
1585
    5,1,1,1,6,1,2,0,0,0,-2,0,5,2,2,2,1,0,6,0,0,-1,3,3,-2,2,
1587
1586
//  a b c d e f g h i j  k l m n o p q r s t u  v w x  y z
1588
1587
        0,0,0,0,0,1,2,3,-3,-2,2,-2,-1,1,1,-1,-2,2,1,-1,1,-1,-3,-1,-3,-2,-1,-3,//123-150                ,0,
1589
 
//      { | } ~  � � �  �  � �  �  � � �  �  � � �  � �  �  �  �  �  �  �  �
 
1588
//      { | } ~  ─ │ ┌  ┐  └ ┘  ├  ┤ ┬ ┴  ┼  ▀ ▄ █  ▌ ▐  ░  ▒  ▓  ⌠  ■  •  √
1590
1589
        -2, 0,-2,0, 0,-1,-1,0,0,5,4,7,0,4,4,4,4,5,6, 5, 0,5,4,1,6,0,// 151 - 176
1591
 
//       �  �  � �  �  �  � � � � � � � � � � � � �  �  � � � � � �
 
1590
//       ≈  ≤  ≥    ⌡  °  ² · ÷ ═ ║ ╒ ё ╓ ╔ ╕ ╖ ╗ ╘  ╙  ╚ ╛ ╜ ╝ ╞ ╟
1592
1591
        3, 3, 1, 3,  3, 4,0,0, 3, 0,0,0,-2,
1593
1592
//     fi fl ff ffi rt ri % % ffl i j ! ?
1594
 
//      �  �  �  �   �  � � �  �  � � � �
 
1593
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1595
1594
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1596
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1595
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1597
1596
        3,-1,-3,-2,1,5,2,3,4,2,2,6,4,4,4,6,                    // 224 - 239
1598
 
//      �  �  �  � � � � � � � � � � � � �
 
1597
//      Ю  А  Б  Ц Д Е Ф Г Х И Й К Л М Н О
1599
1598
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
1600
 
//      � � � � � � � � � � � � � � �
1601
 
 
1602
 
 
1603
 
//  . ��ਭ� �㪢� ����� ��� ࠢ�� ࠧ���� �����.
1604
 
static CHAR tabmd[256]={
 
1599
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
 
1600
 
 
1601
 
 
1602
//  . ≤╗Ю╗╜═ ║Ц╙╒К ╛╔╜ЛХ╔ ╗╚╗ Ю═╒╜╝ Ю═╖╛╔ЮЦ ╙╔ё╚О.
 
1603
static char tabmd[256]={
1605
1604
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1606
1605
    0,0,0,0,0,0,0,0,0,0,0,0,2,-7,-1,0,0,0,0,0,0,0,0,-8,
1607
1606
//                    ! " # $  %  & ' ( ) * + , - .  /
1614
1613
    5,1,0,3,5,-2,3,1,0,0,0,0,8,3,3,2,1,-2,1,0,3,0,6,0,-2,1,
1615
1614
//  a b c d e  f g h i j k l m n o p q  r s t u v w x  y z
1616
1615
        0,0,0,0,0,2,4,6,-3,0,2,0,-2,7,7,-1,-2,5,3,3,3,-2,-3,-4,-3,-1,-1,0,//123-150                ,0,
1617
 
//      { | } ~  � � �  � � � �  � � �  �  � � � � �  �  �  �  �  �  � �
 
1616
//      { | } ~  ─ │ ┌  ┐ └ ┘ ├  ┤ ┬ ┴  ┼  ▀ ▄ █ ▌ ▐  ░  ▒  ▓  ⌠  ■  • √
1618
1617
        0,2,0,1,4, 4, 2,3,3,5,3,8,-2,1,4,2,2,5,5,3,2,6,3,1,3,0,// 151 - 176
1619
 
//      � � � � �  �  � � � � � �  � � � � � � � � � � � � � �
 
1618
//      ≈ ≤ ≥   ⌡  °  ² · ÷ ═ ║ ╒  ё ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟
1620
1619
        3, 3, 1, 3,  3, 4,0,0, 3, 0,0,0,-2,
1621
1620
//     fi fl ff ffi rt ri % % ffl i j ! ?
1622
 
//      �  �  �  �   �  � � �  �  � � � �
 
1621
//      ╠  ╡  Ё  ╢   ╣  ╤ ╥ ╦  ╧  ╨ ╩ ╪ ╫
1623
1622
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,// 190 - 223
1624
 
//      � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
 
1623
//      ╬ © ю а б ц д е ф г х и й к л м н о п я р с т у ж в ь ы з ш э щ ч ъ
1625
1624
        1,0,-4,-2,-2,1,-1,0,2,-2,-1,4,2,2,2,0,                    // 224 - 239
1626
 
//      � �  �  �  � �  � � �  �  � � � � � �
 
1625
//      Ю А  Б  Ц  Д Е  Ф Г Х  И  Й К Л М Н О
1627
1626
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};                   // 240 - 255
1628
 
//      � � � � � � � � � � � � � � �
 
1627
//      П Я Р С Т У Ж В Ь Ы З Ш Э Щ Ч
1629
1628
 
1630
 
static INT dens_let(cell *c)
 
1629
static int16_t dens_let(cell *c)
1631
1630
 {
1632
 
 INT d,h;
1633
 
 PCHAR tab;
1634
 
 BYTE let,fnt;
 
1631
 int16_t d,h;
 
1632
 pchar tab;
 
1633
 uchar let,fnt;
1635
1634
 if (c->dens>100)  // 11-10-94 05:59pm Pit for debug
1636
1635
  return NOTAPPL;  //
1637
1636
 if (c->dens==NODENS)
1691
1690
 if (fax1x2) d++;
1692
1691
 
1693
1692
#ifdef STAT_PIT
1694
 
//  ���� �।����䬥��᪮�� � ���⭮�� ᨬ�����
 
1693
//  ▒║╝Ю АЮ╔╓╜╔═Ю╗Д╛╔Б╗Г╔А╙╝ё╝ ╝ ╞╚╝Б╜╝АБ╗ А╗╛╒╝╚╝╒
1695
1694
//
1696
1695
 
1697
1696
 if(tab==tabgi) stat_tab = stat_tabgi;
1721
1720
void font_narrow(void)
1722
1721
{
1723
1722
cell *  c;
1724
 
BYTE    slanguage=language;
1725
 
INT     prop, nall, nval, narrow, pn;
 
1723
uchar    slanguage=language;
 
1724
int16_t     prop, nall, nval, narrow, pn;
1726
1725
 
1727
1726
if( line_tabcell || !line_scale )
1728
1727
    return;
1733
1732
    language = c->language;
1734
1733
    nall++;
1735
1734
    prop = prop_index(c->h, c->w);
1736
 
    pn = prop_narrow[ (INT)c->vers[0].let ];
 
1735
    pn = prop_narrow[ (int16_t)c->vers[0].let ];
1737
1736
    if( pn )
1738
1737
        nval++;
1739
1738
    if( (c->font & c_fp_narrow) )