#include "spice.h"
#include "sced.h"
#include "plotdev.h"
#include <ctype.h>
Go to the source code of this file.
|
static int | setcode () |
|
static void | xform_cell () |
|
void | SetScaledTextClip (int xl, int yl, int xu, int yu) |
|
void | ScaledTextBB (char *string, int *wid, int *hei) |
|
int | ScaledText (char *text, int x, int y, int degrees, int scale) |
|
static int | setcode (int deg) |
|
static void | xform_cell (unsigned short *out, unsigned short *in, int w, int h, int code, int shift) |
|
|
static int | Xl |
|
static int | Yl |
|
static int | Xu = 0x7fff |
|
static int | Yu = 0x7fff |
|
static unsigned short | label_font [] |
|
int ScaledText |
( |
char * |
text, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
degrees, |
|
|
int |
scale |
|
) |
| |
Definition at line 160 of file labeltxt.c.
168 unsigned short rotbuf[16], *ctab, mask;
172 if (scale < 1 || scale > 10)
return (0);
173 if (text ==
NULL)
return (0);
184 if (degrees >= 90) degrees /= 90;
196 y -= strlen(text)*fheight*scale;
204 y -= strlen(text)*fheight*scale;
212 x -= strlen(text)*fwidth*scale;
218 x -= strlen(text)*fwidth*scale;
226 str1 = text + strlen(text);
227 while (str0 != str1) {
230 if ((tx = (*--str1 & 0x7f) -
' ') < 0) tx = 0;
233 if ((tx = (*str0++ & 0x7f) -
' ') < 0) tx = 0;
236 xform_cell(rotbuf,ctab,fwidth,fheight,degrees,fwidth);
237 ctab = rotbuf + fheight - 1;
240 for (i = fheight; i; i--, ctab--) {
241 for (j = scale; j; j--) {
242 if (ynow >=
Yl && ynow <=
Yu) {
244 for (mask = 0x8000,ii = fwidth;
ii; mask >>= 1,ii--) {
245 for (k = scale; k; k--) {
246 if (xnow >=
Xl && xnow <=
Xu) {
void ScaledTextBB |
( |
char * |
string, |
|
|
int * |
wid, |
|
|
int* |
hei |
|
) |
| |
static int setcode |
( |
int |
deg | ) |
|
|
static |
Definition at line 270 of file labeltxt.c.
295 if ((mx && rotn == 0) || (!mx && rotn == 2) ||
296 (my && rotn == 1) || (!my && rotn == 3))
300 if ((my && (rotn == 0 || rotn == 1)) ||
301 (!my && (rotn == 2 || rotn == 3)))
303 if ((mx && (rotn == 0 || rotn == 3)) ||
304 (!mx && (rotn == 1 || rotn == 2)))
void SetScaledTextClip |
( |
int |
xl, |
|
|
int |
yl, |
|
|
int |
xu, |
|
|
int |
yu |
|
) |
| |
static void xform_cell |
( |
| ) |
|
|
static |
static void xform_cell |
( |
unsigned short * |
out, |
|
|
unsigned short* |
in, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
code, |
|
|
int |
shift |
|
) |
| |
|
static |
Definition at line 311 of file labeltxt.c.
318 for (i = 0; i < h; i++) {
319 k = ((code & 2) ? h-i-1 : i);
321 for (j = 0,out[i] = 0; j <
w; j++) {
322 l = ((code & 1) ? (w-j-1) : j);
323 out[i] |= ((in[j] >> k) & 1) << l;
328 for (j = 0,out[i] = 0; j < w; j++)
329 out[i] |= ((in[k] >> j) & 1) << (w-j-1);
335 for (i = 0,j = 16-shift; i < h; i++)
unsigned short label_font[] |
|
static |