- Timestamp:
- Apr 1, 2020, 4:11:00 PM (6 years ago)
- Location:
- trunk/Ohana/src/libkapa
- Files:
-
- 1 added
- 7 edited
-
Makefile (modified) (1 diff)
-
include/kapa.h (modified) (2 diffs)
-
src/DrawRotString.c (modified) (4 diffs)
-
src/KapaColors.c (modified) (3 diffs)
-
src/KiiConvert.c (modified) (1 diff)
-
src/PDFRotFont.c (added)
-
src/PSRotFont.c (modified) (1 diff)
-
src/bDrawRotFont.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libkapa/Makefile
r39926 r41319 42 42 $(SRC)/RotFont.$(ARCH).o \ 43 43 $(SRC)/DrawRotString.$(ARCH).o \ 44 $(SRC)/PDFRotFont.$(ARCH).o \ 44 45 $(SRC)/PSRotFont.$(ARCH).o 45 46 -
trunk/Ohana/src/libkapa/include/kapa.h
r41156 r41319 222 222 int KapaPNG (int fd, const char *filename); 223 223 int KapaPPM (int fd, const char *filename); 224 int KapaPDF (int fd, const char *filename, int scaleMode, int pageMode, char *pagename); 224 225 225 226 /* KiiCursor.c */ … … 291 292 int DrawRotTextInit (Display *display, Window window, GC gc, unsigned long fore, unsigned long back); 292 293 294 /* PDFRotFont.c */ 295 void PDFRotText (IOBuffer *buffer, int x, int y, char *string, int pos, double angle); 293 296 294 297 /* PSRotFont.c */ 295 298 void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle)); 296 void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));297 void PSSetFont PROTO((FILE *f, char *name, int size));298 299 int PSRotStrlen PROTO((char *c)); 299 300 -
trunk/Ohana/src/libkapa/src/DrawRotString.c
r40628 r41319 77 77 78 78 YoffBase = Yoff; 79 int Ydelta = 0; 79 80 /* draw characters one-by-one */ 81 82 // successive subscripts / superscripts drop the line by 83 // same amount each time, but size remains 0.8 84 // sub followed by sup, or vice versa, should clear and do basic sup/sub 85 80 86 unsigned int i; 81 // unsigned char *tmpstring = (unsigned char *) string;82 83 87 for (i = 0; i < strlen(string); i++) { 84 88 // N = (unsigned int)(tmpstring[i]); … … 98 102 SetRotFont (currentname, (int)(0.8*currentsize)); 99 103 currentfont = GetRotFontData (¤tscale); 104 105 if (Ydelta > 0) { Ydelta = 0; Yoff = YoffBase; } 106 Ydelta --; 100 107 Yoff -= 0.5*currentscale*dY; 101 108 continue; … … 105 112 SetRotFont (currentname, (int)(0.8*currentsize)); 106 113 currentfont = GetRotFontData (¤tscale); 114 115 if (Ydelta < 0) { Ydelta = 0; Yoff = YoffBase; } 116 Ydelta ++; 107 117 Yoff += 0.5*currentscale*dY; 108 118 continue; … … 113 123 currentfont = GetRotFontData (¤tscale); 114 124 Yoff = YoffBase; 125 Ydelta = 0; 115 126 continue; 116 127 } -
trunk/Ohana/src/libkapa/src/KapaColors.c
r38153 r41319 4 4 5 5 static char KAPA_COLORS[N_KAPA_COLORS][3][16] = { 6 {"black", "black", "0.00 0.00 0.00"},7 {"white", "white", "1.00 1.00 1.00"},8 {"red", "red", "1.00 0.00 0.00"},9 {"pink", "pink", "1.00 0.75 0.80"},10 {"orange", "orange", "1.00 0.65 0.00"},11 {"yellow", "yellow", "1.00 1.00 0.00"},12 {"wheat", "wheat", "0.96 0.87 0.70"},13 {"gold", "gold", "1.00 0.84 0.00"},14 {"green", "green", "0.00 1.00 0.00"},15 {"darkgreen", "darkgreen", "0.00 0.40 0.00"},16 {"darkblue", "darkblue", "0.50 0.50 1.00"},17 {"blue", "blue", "0.00 0.00 1.00"},18 {"skyblue", "skyblue", "0.53 0.81 0.92"},19 {"indigo", "mediumpurple", "0.57 0.44 0.86"},20 {"violet", "darkviolet", "0.58 0.00 0.88"},21 {"blue10", "rgb:00/00/33", "0.00 0.00 0.20"},22 {"blue20", "rgb:00/00/66", "0.00 0.00 0.40"},23 {"blue30", "rgb:00/00/99", "0.00 0.00 0.60"},24 {"blue40", "rgb:00/00/cc", "0.00 0.00 0.80"},25 {"blue50", "rgb:00/00/ff", "0.00 0.00 1.00"},26 {"blue60", "rgb:33/33/ff", "0.20 0.20 1.00"},27 {"blue70", "rgb:66/66/ff", "0.40 0.40 1.00"},28 {"blue80", "rgb:99/99/ff", "0.60 0.60 1.00"},29 {"blue90", "rgb:cc/cc/ff", "0.80 0.80 1.00"},6 {"black", "black", "0.00 0.00 0.00"}, 7 {"white", "white", "1.00 1.00 1.00"}, 8 {"red", "red", "1.00 0.00 0.00"}, 9 {"pink", "pink", "1.00 0.75 0.80"}, 10 {"orange", "orange", "1.00 0.65 0.00"}, 11 {"yellow", "yellow", "1.00 1.00 0.00"}, 12 {"wheat", "wheat", "0.96 0.87 0.70"}, 13 {"gold", "gold", "1.00 0.84 0.00"}, 14 {"green", "green", "0.00 1.00 0.00"}, 15 {"darkgreen", "darkgreen", "0.00 0.40 0.00"}, 16 {"darkblue", "darkblue", "0.50 0.50 1.00"}, 17 {"blue", "blue", "0.00 0.00 1.00"}, 18 {"skyblue", "skyblue", "0.53 0.81 0.92"}, 19 {"indigo", "mediumpurple", "0.57 0.44 0.86"}, 20 {"violet", "darkviolet", "0.58 0.00 0.88"}, 21 {"blue10", "rgb:00/00/33", "0.00 0.00 0.20"}, 22 {"blue20", "rgb:00/00/66", "0.00 0.00 0.40"}, 23 {"blue30", "rgb:00/00/99", "0.00 0.00 0.60"}, 24 {"blue40", "rgb:00/00/cc", "0.00 0.00 0.80"}, 25 {"blue50", "rgb:00/00/ff", "0.00 0.00 1.00"}, 26 {"blue60", "rgb:33/33/ff", "0.20 0.20 1.00"}, 27 {"blue70", "rgb:66/66/ff", "0.40 0.40 1.00"}, 28 {"blue80", "rgb:99/99/ff", "0.60 0.60 1.00"}, 29 {"blue90", "rgb:cc/cc/ff", "0.80 0.80 1.00"}, 30 30 {"red10", "rgb:33/00/00", "0.20 0.00 0.00"}, 31 31 {"red20", "rgb:66/00/00", "0.40 0.00 0.00"}, … … 37 37 {"red80", "rgb:ff/99/99", "1.00 0.60 0.60"}, 38 38 {"red90", "rgb:ff/cc/cc", "1.00 0.80 0.80"}, 39 {"grey10", "grey10", "0.10 0.10 0.10"},40 {"grey20", "grey20", "0.20 0.20 0.20"},41 {"grey30", "grey30", "0.30 0.30 0.30"},42 {"grey40", "grey40", "0.40 0.40 0.40"},43 {"grey50", "grey50", "0.50 0.50 0.50"},44 {"grey60", "grey60", "0.60 0.60 0.60"},45 {"grey70", "grey70", "0.70 0.70 0.70"},46 {"grey80", "grey80", "0.80 0.80 0.80"},47 {"grey90", "grey90", "0.90 0.90 0.90"}};39 {"grey10", "grey10", "0.10 0.10 0.10"}, 40 {"grey20", "grey20", "0.20 0.20 0.20"}, 41 {"grey30", "grey30", "0.30 0.30 0.30"}, 42 {"grey40", "grey40", "0.40 0.40 0.40"}, 43 {"grey50", "grey50", "0.50 0.50 0.50"}, 44 {"grey60", "grey60", "0.60 0.60 0.60"}, 45 {"grey70", "grey70", "0.70 0.70 0.70"}, 46 {"grey80", "grey80", "0.80 0.80 0.80"}, 47 {"grey90", "grey90", "0.90 0.90 0.90"}}; 48 48 49 49 int KapaColorByName (char *name) { … … 70 70 71 71 char *KapaColorRGBString (int N) { 72 return (KAPA_COLORS[N][2]); 72 int Nused = MAX (0, MIN (N_KAPA_COLORS, N)); 73 return (KAPA_COLORS[Nused][2]); 73 74 } 74 75 75 76 char *KapaColorName (int N) { 76 return (KAPA_COLORS[N][0]); 77 int Nused = MAX (0, MIN (N_KAPA_COLORS, N)); 78 return (KAPA_COLORS[Nused][0]); 77 79 } 78 80 -
trunk/Ohana/src/libkapa/src/KiiConvert.c
r13479 r41319 32 32 return (TRUE); 33 33 } 34 35 int KapaPDF (int fd, const char *filename, int scaleMode, int pageMode, char *pagename) { 36 37 KiiSendCommand (fd, 4, "PDFT"); 38 KiiSendMessage (fd, "%s %s %d %d", filename, pagename, scaleMode, pageMode); 39 KiiWaitAnswer (fd, "DONE"); 40 return (TRUE); 41 } -
trunk/Ohana/src/libkapa/src/PSRotFont.c
r40628 r41319 1 1 # include <kapa_internal.h> 2 2 # define NROTCHARS 256 3 4 // local functions: 5 void PSDumpRotSegment (FILE *f, char *segment, int *Nseg); 6 void PSSetFont (FILE *f, char *name, int size); 3 7 4 8 /* writes commands to print string at location and angle using -
trunk/Ohana/src/libkapa/src/bDrawRotFont.c
r40628 r41319 57 57 58 58 YoffBase = Yoff; 59 int Ydelta = 0; 59 60 /* draw characters one-by-one */ 61 62 // successive subscripts / superscripts drop the line by 63 // same amount each time, but size remains 0.8 64 // sub followed by sup, or vice versa, should clear and do basic sup/sub 60 65 61 66 unsigned int i; … … 73 78 SetRotFont (currentname, (int)(0.8*currentsize)); 74 79 currentfont = GetRotFontData (¤tscale); 75 Yoff -= 0.5*currentscale*dY; 80 81 if (Ydelta > 0) { Ydelta = 0; Yoff = YoffBase; } 82 Ydelta --; 83 Yoff -= 0.75*currentscale*dY; 76 84 continue; 77 85 } … … 79 87 SetRotFont (currentname, (int)(0.8*currentsize)); 80 88 currentfont = GetRotFontData (¤tscale); 81 Yoff += 0.5*currentscale*dY; 89 90 if (Ydelta < 0) { Ydelta = 0; Yoff = YoffBase; } 91 Ydelta ++; 92 Yoff += 0.75*currentscale*dY; 82 93 continue; 83 94 } … … 86 97 currentfont = GetRotFontData (¤tscale); 87 98 Yoff = YoffBase; 99 Ydelta = 0; 88 100 continue; 89 101 }
Note:
See TracChangeset
for help on using the changeset viewer.
