-/*
- "-^_~\xad\xaf+`\xac\xb7\xf7" //chars for which to detect one y value
- "#=:;\xb1" //chars for which to detect two y values
- "\"\xa8" //chars for which to detect two x values
-*/
+ int width = bounds.xmax - bounds.xmin;
+ int height = bounds.ymax - bounds.ymin;
+ float*row = rfx_calloc(sizeof(float)*(width+1));
+ float*column = rfx_calloc(sizeof(float)*(height+1));
+ float*row2 = rfx_calloc(sizeof(float)*(width+1));
+ float*column2 = rfx_calloc(sizeof(float)*(height+1));
+
+ for(t=0;t<f->numchars;t++) {
+ draw_char(f, t, row, column, bounds);
+ }
+ for(t=0;t<=width;t++) {row[t]/=f->numchars/2;}
+ for(t=0;t<=height;t++) {column[t]/=f->numchars/2;}
+
+ for(t=0;t<f->numchars;t++) {
+ memcpy(row2, row, sizeof(float)*(width+1));
+ memcpy(column2, column, sizeof(float)*(height+1));
+ //draw_char(f, t, row2, column2, bounds);
+
+ SRECT b = f->layout->bounds[t];
+ negate_y(&b);
+ f->alignzones[t] = detect_for_char(f, t, row2, column2, bounds, b);
+ }
+ }