Changeset 38917
- Timestamp:
- Oct 20, 2015, 8:26:50 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150625/Ohana/src/libkapa
- Files:
-
- 5 edited
-
Makefile (modified) (1 diff)
-
include/alphabet.h (modified) (2 diffs)
-
include/kapa.h (modified) (2 diffs)
-
src/DrawRotString.c (modified) (1 diff)
-
src/PSRotFont.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/libkapa/Makefile
r38473 r38917 18 18 FULL_LDFLAGS = $(BASE_LDFLAGS) -ldvo -lFITS -lohana 19 19 20 install: $(DESTINC)/kapa.h $(DESTLIB)/libkapa.a $(DESTLIB)/libkapa.$(DLLTYPE) 21 libkapa: $(LIB)/libkapa.$(ARCH).a $(LIB)/libkapa.$(ARCH).$(DLLTYPE) 20 install: ROTFONT $(DESTINC)/kapa.h $(DESTLIB)/libkapa.a $(DESTLIB)/libkapa.$(DLLTYPE) 21 libkapa: ROTFONT $(LIB)/libkapa.$(ARCH).a $(LIB)/libkapa.$(ARCH).$(DLLTYPE) 22 23 ROTFONT: 24 cd rotfont && make all 22 25 23 26 INCS = $(DESTINC)/kapa.h -
branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/alphabet.h
r5854 r38917 1 2 # if (0) 3 # include "../rotfont/times8.h" 4 5 # define DEFFONT 1 6 static FontSet HardwiredFonts[] = { 7 {times8font, "times", 8} 8 }; 9 # endif 10 11 # if (1) 1 12 # include "../rotfont/times8.h" 2 13 # include "../rotfont/times12.h" … … 49 60 {symbol24font, "symbol", 24} 50 61 }; 62 # endif 51 63 52 64 /* put these as static in RotFont.c with accessor functions */ -
branches/eam_branches/ipp-20150625/Ohana/src/libkapa/include/kapa.h
r38739 r38917 109 109 110 110 typedef struct { 111 int dx, dy, ascent; 111 int dx; 112 int dy; 113 float dXps; 114 int ascent; 112 115 unsigned char *bits; 113 116 } RotFont; … … 233 236 void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg)); 234 237 void PSSetFont PROTO((FILE *f, char *name, int size)); 238 int PSRotStrlen PROTO((char *c)); 235 239 236 240 /* bDrawFuncs.c */ -
branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/DrawRotString.c
r34088 r38917 22 22 return (TRUE); 23 23 } 24 25 /* position can be one of 9 values center the text in the following way 26 0 1 2 27 3 4 5 28 6 7 8 29 30 e.g., 4 has the center of the string at the x,y position 31 0 has the lower-right corner at the position (left & up justified) 32 */ 24 33 25 34 int DrawRotText (int x, int y, char *string, int pos, double angle) { -
branches/eam_branches/ipp-20150625/Ohana/src/libkapa/src/PSRotFont.c
r32695 r38917 9 9 int i, N, code, protect; 10 10 int dX, dY, Xoff, Yoff, X, Y, Nseg, NSEG, YoffBase; 11 double cs, sn, fscale,currentscale;11 double cs, sn, currentscale; 12 12 int basesize, currentsize; 13 13 RotFont *currentfont; … … 23 23 24 24 /* compute string length */ 25 /* PS fonts are somewhat different scales from bitmap font equivalents */ 26 fscale = 1.0; 27 if (!strcmp (currentname, "times")) fscale = 1.07; 28 if (!strcmp (currentname, "courier")) fscale = 1.5; 29 if (!strcmp (currentname, "helvetica")) fscale = 0.9; 30 if (!strcmp (currentname, "symbol")) fscale = 1.2; 31 dX = fscale*RotStrlen (string); 25 dX = PSRotStrlen (string); 32 26 dY = currentfont[65].ascent; 33 27 … … 201 195 } 202 196 197 # define NROT 256 198 int PSRotStrlen (char *c) { 199 200 int i, N, dX, code; 201 double currentscale, scale; 202 203 RotFont *currentfont = GetRotFontData (¤tscale); 204 scale = currentscale; 205 206 /* find string length */ 207 dX = 0; 208 209 code = FALSE; 210 for (i = 0; i < strlen (c); i++) { 211 N = (int)(c[i]); 212 /* skip non-printing characters */ 213 if ((N < 0) || (N >= NROT)) continue; 214 215 /* check for special characters */ 216 if (!code) { 217 if (N == 94) { /* super-script */ 218 scale *= 0.8; 219 continue; 220 } 221 if (N == 95) { /* sub-script */ 222 scale *= 0.8; 223 continue; 224 } 225 if (N == 124) { /* normal-script */ 226 scale = currentscale; 227 continue; 228 } 229 if (N == 92) { /* backslash */ 230 code = TRUE; 231 continue; 232 } 233 if (N == 38) { /* font-code */ 234 i++; 235 continue; 236 } 237 } 238 code = FALSE; 239 dX += scale*currentfont[N].dXps + 1; 240 } 241 return (dX); 242 } 203 243 204 244
Note:
See TracChangeset
for help on using the changeset viewer.
