home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16731 < prev    next >
Encoding:
Internet Message Format  |  1992-11-21  |  2.2 KB

  1. Path: sparky!uunet!utcsri!explorer.dgp!rodney
  2. Newsgroups: comp.sys.sgi
  3. From: rodney@explorer.dgp (Rodney Hoinkes)
  4. Subject: More Strangeness with 4.0.5 FM
  5. Message-ID: <1992Nov21.153913.11291@jarvis.csri.toronto.edu>
  6. Organization: Centre for Landscape Research, University of Toronto
  7. Date: 21 Nov 92 20:39:13 GMT
  8. Lines: 68
  9.  
  10. No, 4.0.5 FM is NOT a new system release, it just means
  11. 4.0.5(a-f) FM (Font Manager).
  12.  
  13. I, as many other people, got hit by the fmfreefont behaviour
  14. of 4.0.5 and the new Font Manager.  I am also now experiencing
  15. some other strangeness when it comes to rotating text.  This
  16. code works under IRIX 3.3.2-4.0.4 but dies if the text is
  17. rotated!
  18.  
  19. Can anyone see the problem?  I seem to be stumped by this.
  20.  
  21. DrawTextWindow(PELEMENT *e) {
  22.     int x1, y1, x2, y2;
  23.     int width;
  24.     double m[3][2];
  25.     fmfonthandle f,fsized;
  26.  
  27.     x1 = e->x1;
  28.     y1 = e->y1;
  29.     x2 = e->x2;
  30.     y2 = e->y2;
  31.  
  32.     if(x1 < 0) x1 = 0; if(y1 < 0) y1 = 0;
  33.     if(x2 > machine.maxX)   x2 = machine.maxX;
  34.     if(y2 > machine.maxY+1) y2 = machine.maxY+1;
  35.  
  36.     cpack(cardtitle[e->index].col);
  37.     if (editmode)   recti(x1,y1,x2,y2);
  38.  
  39.     f = fmfindfont(fntname[cardtitle[e->index].font]);
  40.     fsized = fmscalefont(f,cardtitle[e->index].size);
  41.     if(cardtitle[e->index].rot != 0.0) {
  42.         fmgetpagematrix(m);
  43.         fmrotatepagematrix((double)cardtitle[e->index].rot);
  44.     }
  45.     fmsetfont(fsized);
  46.     if(cardtitle[e->index].align == 1) {
  47.         width = fmgetstrwidth(fsized,cardtitle[e->index].string);
  48.         cmov2i((machine.maxX-width)/2,y1);
  49.     } else {
  50.         cmov2i(x1,y1);
  51.     }
  52.     fmprstr(cardtitle[e->index].string);
  53.     if(cardtitle[e->index].rot != 0.0) {
  54.         fmsetpagematrix(m);
  55.     }
  56.     fmfreefont(fsized);
  57.     fmfreefont(f);
  58.  
  59. }
  60.  
  61. It dies on the fmptrstr.  I know the string and index are valid.
  62.  
  63. Please no flames about my fmfindfonts and fmfreefonts, as that
  64. is how the code currently works (designed before 4.0.5 FMisms).
  65.  
  66. If anyone sees the problem, please let me know.
  67.  
  68.  
  69.     Rodney Hoinkes
  70.     Head of Design Applications
  71.     Centre for Landscape Research
  72.     University of Toronto
  73.     Tel:   (416) 978-7197
  74.     Email: rodney@dgp.utoronto.ca
  75.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76.     APIAWWGATI
  77.     "Anything's possible IF and WHEN we get around to it."
  78.