~ubuntu-branches/ubuntu/precise/cuneiform/precise

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rstr/src/iot.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:
63
63
 #include <stdlib.h>
64
64
#include <stdio.h>
65
65
#include <string.h>
66
 
 #include "nt_types.h"
 
66
 
67
67
 #include "func.h"
68
68
 #include "struct.h"
69
69
 #include "linear.h"
72
72
 #include "func.h"
73
73
#include "minmax.h"
74
74
 
75
 
extern BYTE p2_active;
 
75
extern uchar p2_active;
76
76
// Discrim � by base lines                              *
77
 
static INT rec_ii(cell*c,cell*cap);
78
 
static INT rec_ii_halo(cell * c);
79
 
 
80
 
static BYTE iot_pen_lc[]={ 120,60,10,0,0 };
81
 
static BYTE iot_pen_uc[]={ 140,10,0 ,0,0 };
82
 
 
83
 
INT cut_by_pos_ii(s_glue * const gl,BYTE let)
 
77
static int16_t rec_ii(cell*c,cell*cap);
 
78
static int16_t rec_ii_halo(cell * c);
 
79
 
 
80
static uchar iot_pen_lc[]={ 120,60,10,0,0 };
 
81
static uchar iot_pen_uc[]={ 140,10,0 ,0,0 };
 
82
 
 
83
int16_t cut_by_pos_ii(s_glue * const gl,uchar let)
84
84
{
85
85
B_LINES bl;
86
 
INT pen=0,upper=32000,dis,i;
 
86
int16_t pen=0,upper=32000,dis,i;
87
87
 
88
88
 
89
89
 get_b_lines(gl->celist[0],&bl);
90
90
 for(i=0;i < gl->ncell;i++)
91
91
  upper = MIN(upper,gl->celist[i]->row);
92
92
 
93
 
 if(let==(BYTE)'�' &&
 
93
 if(let==(uchar)'�' &&
94
94
         !is_russian_turkish_conflict(let) // 21.05.2002 E.P.
95
95
   ){
96
96
  if((dis=upper-bl.b2) <= 0 ){ // letter upper than bbs2
105
105
    pen +=  dis<3 ? 60 : 0;
106
106
   }
107
107
 }
108
 
 if(let==(BYTE)'�'){ // Capital iot
 
108
 if(let==(uchar)'�'){ // Capital iot
109
109
  if((dis=upper-bl.b1) <= 0 ){ // letter upper than bbs1
110
110
   dis = abs(dis);
111
111
   if(dis < 5) pen = iot_pen_uc[dis];
118
118
void proc_ii(void)
119
119
{
120
120
cell * c,*cap;
121
 
BYTE let;
122
 
INT ndust;
 
121
uchar let;
 
122
int16_t ndust;
123
123
  c = cell_f();
124
124
 while((c=c->nextl) != NULL ){
125
125
 if( !(c->flg & (c_f_let+c_f_bad)) ) continue;
169
169
 } // while by letters
170
170
}
171
171
 
172
 
INT rec_ii(cell* c,cell * cap)
 
172
int16_t rec_ii(cell* c,cell * cap)
173
173
{
174
174
cell *clist[8];
175
 
BYTE let;
 
175
uchar let;
176
176
     let = c->vers[0].let;
177
177
   if( cap->row > c->row )        return 0; // not a cap
178
178
   if( cap->w*3 < c->w )          return 0; // not so wide as need
188
188
   if( c->col+c->w < cap->col ||
189
189
       c->col      > cap->col+cap->w) return 0;  // not centered dust
190
190
if(0&&!p2_active)  // OLEG
191
 
   if( let==r_cu_u || let==(Word8)'�' )
 
191
   if( let==r_cu_u || let==(uchar)'�' )
192
192
       {
193
193
        B_LINES bl;
194
194
        get_b_lines(c,&bl);
200
200
    clist[1]=cap;
201
201
    if( !compose_cell(2,clist,c) )
202
202
      return -1; //OLEG:new return style of composed
203
 
     let = is_lower(let) ? (BYTE)'�' : (BYTE)'�';
 
203
     let = is_lower(let) ? (uchar)'�' : (uchar)'�';
204
204
        c->vers[0].let = let;
205
205
        c->vers[0].prob=MIN(254,c->vers[0].prob+2);
206
206
        c->recsource = 0; // artifact
209
209
  return 1;
210
210
}
211
211
 
212
 
INT rec_ii_halo(cell * c)
 
212
int16_t rec_ii_halo(cell * c)
213
213
{
214
214
#define n_pieces        48
215
215
cell *cap,*caplist[n_pieces];
216
 
BYTE let;
217
 
INT i,cap_row,cap_col,cap_h,cap_w,cap_rt,cap_bt,ncaps;
 
216
uchar let;
 
217
int16_t i,cap_row,cap_col,cap_h,cap_w,cap_rt,cap_bt,ncaps;
218
218
      i=0;
219
219
      cap = c;
220
220
      while((cap=cap->next)!=NULL && cap != c->nextl && i < n_pieces-1)
265
265
 
266
266
    memmove(&caplist[1],caplist,i*sizeof(cell*));
267
267
    caplist[0]=c;
268
 
    if( !compose_cell((INT)(i+1),caplist,c) )
 
268
    if( !compose_cell((int16_t)(i+1),caplist,c) )
269
269
      return 0; //OLEG:new return style of composed
270
 
     let = is_lower(let) ? (BYTE)'�' : (BYTE)'�';
 
270
     let = is_lower(let) ? (uchar)'�' : (uchar)'�';
271
271
        c->vers[0].let = let;
272
272
        c->vers[0].prob=MIN(254,c->vers[0].prob+2);
273
273
        c->recsource = 0; // artifact