Forums > Jitter

jit.gl.text2D

June 27, 2006 | 5:10 am


June 27, 2006 | 5:23 am

take a look at the jit.str objects, which convert ascii text to char
matrices – should retain their formatting for jit.gl 2d and 3D text.
Might also want to look at jaschs c string library to do formatting
before going to matrix land.

v a d e //

http://www.vade.info
abstrakt.vade.info


June 27, 2006 | 4:27 pm

I would use JavaScript to do this. The only problem with doing a
really good job right now is that there’s no easy way of getting the
font metrics. so your formatting will be kind of rough, based only
on characters not exact widths. But if you can live with that, you
could use JavaScript to divide your text into lines.

-Randy


June 28, 2006 | 12:32 am

try this, mybe ull find something you can use. i needed to show a large list
of chars. coll and her likes do not go well with anting above 256.
[mxj list.Queue] is good

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 25 146 27 9109513 i 0;
#P newex 25 125 41 9109513 togedge;
#P newex 29 480 27 9109513 gate;
#P newex 46 451 27 9109513 t b l;
#P message 49 553 51 9109513 clear , bang;
#P message 65 407 43 9109513 plane $1;
#P message 114 517 70 9109513 planecount $1;
#P newex 125 376 37 9109513 t dump;
#P user jit.pwindow 99 619 168 120 0 1 0 0 1 0;
#P window setfont "Sans Serif" 12.;
#P comment 164 24 18 9109516 2.;
#P window setfont "Sans Serif" 9.;
#P message 264 52 88 9109513 q:/path/to/text/files;
#P newex 264 26 45 9109513 loadbang;
#P message 95 301 14 9109513 1;
#P newex 63 325 40 9109513 t 0 0 b;
#B color 5;
#P toggle 48 225 15 0;
#P newex 48 243 40 9109513 metro 1;
#N counter 50000;
#X flags 0 0;
#P newobj 48 272 67 9109513 counter 50000;
#P newex 125 354 27 9109513 i;
#P newex 46 383 68 9109513 mxj list.Queue;
#P button 187 22 20 0;
#P newex 48 353 51 9109513 sprintf %s;
#B color 5;
#P newex 48 300 40 9109513 filein;
#B color 5;
#P newex 46 428 56 9109513 jit.fill foot 0;
#P newex 100 590 124 9109513 jit.matrix foot 1 char 1000 1;
#P newex 100 564 109 9109513 jit.op @op max @val 32;
#P newex 100 540 124 9109513 jit.matrix foot 1 char 1000 1;
#P newex 275 168 40 9109513 t b i 1;
#N counter;
#X flags 0 0;
#P newobj 187 74 66 9109513 counter;
#P newex 308 145 27 9109513 – 1;
#P newex 193 120 49 9109513 pak read l;
#P newex 334 122 72 9109513 route populate;
#P newex 264 75 74 9109513 prepend prefix;
#P user ubumenu 187 100 100 9109513 0 1 1 0;
#X add "Copy of text1.txt";
#X add "Copy of text2.txt";
#X add text1.txt;
#X types TEXT;
#X prefix_set 0 1 Q:/max/doron/bugs/text1/ 0;
#X pattrmode 1;
#P fasten 0 2 2 0 282 119 339 119;
#P fasten 2 0 26 0 339 513 119 513;
#P fasten 2 0 4 0 339 143 313 143;
#P fasten 4 0 6 0 313 166 280 166;
#P connect 22 0 1 0;
#P connect 21 0 22 0;
#P fasten 6 1 5 4 295 193 259 193 259 69 248 69;
#P connect 0 1 3 1;
#P fasten 1 0 0 0 269 96 192 96;
#P connect 5 0 0 0;
#P fasten 6 0 5 0 280 189 178 189 178 74 192 74;
#P fasten 13 0 5 0 192 71 192 71;
#P fasten 30 0 5 0 34 507 21 507 21 67 192 67;
#P connect 16 0 11 0;
#P fasten 16 0 15 1 53 293 147 293;
#P connect 15 0 25 0;
#P fasten 19 2 15 0 98 348 130 348;
#P fasten 12 0 14 2 53 375 109 375;
#P connect 9 0 24 0;
#P connect 8 0 9 0;
#P connect 28 0 9 0;
#P fasten 26 0 7 0 105 534;
#P fasten 26 0 9 0 119 538 96 538 96 585 105 585;
#P fasten 7 0 8 0 105 564 105 564;
#P connect 28 0 7 0;
#P fasten 29 1 7 0 68 531 105 531;
#P fasten 11 2 20 0 83 321 89 321 89 299 100 299;
#P fasten 19 0 16 2 68 351 39 351 39 270 81 270;
#P fasten 0 0 27 0 192 407;
#P connect 11 1 19 0;
#P connect 11 0 12 0;
#P fasten 3 0 11 0 198 296 53 296;
#P connect 17 0 16 0;
#P connect 18 0 17 0;
#P fasten 19 1 18 0 80 349 34 349 34 222 53 222;
#P fasten 20 0 18 0 100 323 117 323 117 220 53 220;
#P connect 29 0 30 1;
#P connect 10 0 29 0;
#P fasten 27 0 10 0 70 425 51 425;
#P connect 14 0 10 0;
#P fasten 25 0 14 0 130 398 120 398 120 379 51 379;
#P fasten 32 0 30 0 30 477 34 477;
#P fasten 6 2 30 0 310 476 34 476;
#P connect 31 0 32 0;
#P fasten 5 2 31 0 228 95 30 95;
#P window clipboard copycount 33;


Viewing 4 posts - 1 through 4 (of 4 total)