Changeset 1851 in Sophya
- Timestamp:
- Jan 11, 2002, 7:53:14 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Tests/pist.cc
r1847 r1851 11 11 #include PISTDWDG_H 12 12 #include PIBWDG_H 13 #include "piscdrawwdg.h"14 #include "pievthandler.h"15 #include "parradapter.h"16 17 13 18 14 /* Composante graphique de trace de chaine de caracteres */ -
trunk/SophyaPI/PI/pidrawer.cc
r1827 r1851 7 7 #include <strings.h> 8 8 #include <iostream.h> 9 #include <typeinfo> 9 10 #include "pidrawer.h" 10 11 … … 63 64 mRevCmap = false; 64 65 mFName = PI_DefaultFont; 66 67 // Nom par defaut : Le nom de la classe 68 mName = typeid(*this).name(); 69 // Par defaut, pas de fenetre de controle specifique 70 mFgSpecContWind = false; 65 71 } 66 72 -
trunk/SophyaPI/PI/pidrawer.h
r1827 r1851 92 92 // Methode permettant l'affichage d'une fenetre de controle specialisee 93 93 virtual void ShowControlWindow(PIBaseWdgGen* wdg); 94 inline bool HasSpecificControlWindow() const { return mFgSpecContWind; } 95 94 96 95 97 // Methode permettant de decoder des options a partir de chaines 96 98 virtual int DecodeOptionString(vector<string> & opt); 97 99 100 // On peut donner un nom a un drawer (par defaut = nom de la classe) 101 inline string Nom() { return mName; } 102 inline string& Name() { return mName; } 103 inline void SetName(string const& name) { mName = name; } 98 104 // --- Methode- static ---- 99 105 // Calcul des Distances optimales des subdivisions … … 144 150 // Flag de control d'affichage en mode HighLight 145 151 bool mFgHighLight; 152 // Flag indiquant s'il y a une fenetre de controle specifique 153 bool mFgSpecContWind; 154 // Nom du drawer 155 string mName; 146 156 147 157 list<DrwBWId> mBWdgList; -
trunk/SophyaPI/PI/pidrwtools.cc
r1827 r1851 57 57 { 58 58 if (cwdrwt == NULL) cwdrwt = new PIDrwTools(PIApplicationGetApp()); 59 SetCurrentBaseWdg(cbw);59 mCurBW = cbw; 60 60 cwdrwt->Show(); 61 61 } … … 80 80 if (mCurBW == cbw) return; 81 81 mCurBW = cbw; 82 if (cwdrwt) { 83 if (mCurBW != NULL) { 84 cwdrwt->mNDr = mCurBW->GetActiveDrawerNum(); 85 if (cwdrwt->mNDr < 0) cwdrwt->mNDr = 0; 86 } 87 else cwdrwt->mNDr = 0; 88 char buff[32]; 89 sprintf(buff,"%d", cwdrwt->mNDr); 90 cwdrwt->mNlb->SetLabel(buff); 91 } 82 cwdrwt->UpdateControlsFromDrawer(-1); 83 cwdrwt->UpdateAttFromDrawer(); 92 84 } 93 85 /* --Methode-- */ … … 110 102 111 103 int wszx = 5*spx+3.5*bsx; 112 int wszy = ( 1+5*0.85)*bsy+(6+5*0.85)*spy;104 int wszy = (2+5*0.85)*bsy+(7+5*0.85)*spy; 113 105 SetSize(wszx, wszy); 114 106 … … 258 250 mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 259 251 252 int kb; 260 253 cpx = 2*spx; 261 254 cpy += spy+bsyo; 262 255 bsy = bsyo; spy = spyo; 263 mButdr[0] = new PIButton(this, "-", 3501, bsy, bsy, cpx, cpy);256 mButdr[0] = new PIButton(this, "-", 1501, bsy, bsy, cpx, cpy); 264 257 cpx += bsy+0.25*spy; 265 mNlb = new PILabel(this,"NumDr", bsy, bsy, cpx, cpy); 266 mNlb->SetLabel("0"); 258 mNlb = new PILabel(this,"NumDr", 1.5*bsy, bsy, cpx, cpy); 259 mNlb->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 260 mNlb->SetLabel(""); 267 261 mNDr = 0; 268 cpx += bsy+0.25*spy;269 mButdr[1] = new PIButton(this, "+", 3502, bsy, bsy, cpx, cpy);262 cpx += 1.5*bsy+0.25*spy; 263 mButdr[1] = new PIButton(this, "+", 1502, bsy, bsy, cpx, cpy); 270 264 mButdr[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 271 265 mButdr[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 272 mNlb->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 273 274 cpx = wszx-1.7*bsx-3*spx; 275 mButcf[0] = new PIButton(this, "GetAtt", 2800, 0.85*bsx, bsy, cpx, cpy); 276 cpx += 0.85*bsx+spx; 277 mButcf[1] = new PIButton(this, "SetAtt", 2900, 0.85*bsx, bsy, cpx, cpy); 278 mButcf[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 279 mButcf[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 280 281 cpx = (wszx-3.2*bsx-2*spx)/2; 266 for(int kb=0; kb<2; kb++) { 267 mButdr[kb]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 268 mButdr[kb]->SetUnSensitive(); 269 } 270 cpx += 2*spx; 271 mDrName = new PILabel(this,"DrName", wszx-2*spx-cpx, bsy, cpx, cpy); 272 mDrName->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 273 mDrName->SetLabel("No-Drawer"); 274 mDrName->SetBorderWidth(1); 275 276 cpy += bsy+spy; 277 cpx = 2*spx; 278 int butszx = 0.8*bsx; 279 mButcf[0] = new PIButton(this, "GetAtt", 2500, butszx, bsy, cpx, cpy); 280 cpx += butszx+spx; 281 mButcf[1] = new PIButton(this, "SetAtt", 2600, butszx, bsy, cpx, cpy); 282 cpx += butszx+spx; 283 mButcf[2] = new PIButton(this, "Select", 2700, butszx, bsy, cpx, cpy); 284 mButcf[2]->ActivatePress(true); 285 cpx += butszx+spx; 286 butszx = wszx-cpx-2*spx; 287 mButcf[3] = new PIButton(this, "ShowControl", 2800, butszx, bsy, cpx, cpy); 288 289 butszx = 1.4*bsx; 290 cpx = (wszx-2*butszx-4*spx)/2; 282 291 cpy += 2*spy+bsy; 283 mButcf[ 2] = new PIButton(this, "Refresh", 3100, bsx*1.2, bsyo, cpx, cpy);284 mButcf[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);285 cpx += bsx*1.2+spx;286 mButcf[3] = new PIButton(this, "Select", 3200, bsx*0.8, bsyo, cpx, cpy); 287 mButcf[3]->ActivatePress(true); 288 mButcf[3]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);289 cpx += bsx*0.8+spx; 290 mButcf[4] = new PIButton(this, "Dismiss", 3777, bsx*1.2, bsyo, cpx, cpy);291 mButcf[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 292 292 mButcf[4] = new PIButton(this, "Refresh", 3000, bsx*1.2, bsyo, cpx, cpy); 293 cpx += butszx+2*spx; 294 mButcf[5] = new PIButton(this, "Dismiss", 3777, butszx, bsyo, cpx, cpy); 295 296 for(int kb=0; kb<6; kb++) 297 mButcf[kb]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 298 for(int kb=0; kb<5; kb++) 299 mButcf[kb]->SetUnSensitive(); 300 301 mButSens = 0; 293 302 cwdrwt = this; 294 303 … … 300 309 if (cwdrwt == this) cwdrwt = NULL; 301 310 int i; 302 for(i=0; i< 5; i++) delete mButcf[i];311 for(i=0; i<6; i++) delete mButcf[i]; 303 312 for(i=0; i<2; i++) delete mButdr[i]; 304 313 for(i=0; i<8; i++) delete mOpt[i]; 305 314 for(i=0; i<2; i++) delete mCasc[i]; 306 315 delete mNlb; 316 delete mDrName; 307 317 } 308 318 … … 339 349 { 340 350 PIWindow::Show(); 341 342 mNDr = 0; 343 if (mCurBW != NULL) { 344 mNDr = mCurBW->NbDrawers()-1; 345 if (mNDr < 0) mNDr = 0; 346 } 347 else mNDr = 0; 348 char buff[32]; 349 sprintf(buff,"%d", mNDr); 350 mNlb->SetLabel(buff); 351 351 UpdateControlsFromDrawer(-1); 352 352 UpdateAttFromDrawer(); 353 353 return; 354 354 } 355 356 /* --Methode-- */ 357 void PIDrwTools::UpdateControlsFromDrawer(int numdr) 358 { 359 string lstr; 360 int kb; 361 int butsensnew = 0; 362 363 PIDrawer * dr = NULL; 364 365 if (mCurBW != NULL) { 366 if (numdr < 0) { 367 if (mCurBW->NbDrawers() > 0) mNDr = mCurBW->GetActiveDrawerNum(); 368 else mNDr = -1; 369 } 370 else { 371 if (mCurBW->NbDrawers() > 0) { 372 if (mNDr < 0) mNDr = 0; 373 else if (mNDr >= mCurBW->NbDrawers()) mNDr = mCurBW->NbDrawers(); 374 } 375 else mNDr = -1; 376 } 377 if (mNDr >= 0) dr = mCurBW->GetDrawer(mNDr); 378 if (dr != NULL) butsensnew = 2; 379 else butsensnew = 1; 380 } 381 382 if (butsensnew == 2) { 383 mDrName->SetLabel(dr->Name()); 384 char strg[64]; 385 sprintf(strg,"%d",mNDr); 386 mNlb->SetLabel(strg); 387 } 388 else if (mButSens != butsensnew) { 389 if(mButSens == 2) mNlb->SetLabel(""); 390 if (butsensnew == 1) 391 mDrName->SetLabel("No-Drawer"); 392 else mDrName->SetLabel("No-BaseWdg"); 393 } 394 395 if (butsensnew != mButSens) { 396 if (butsensnew < 2) { 397 for(kb=0; kb<2;kb++) mButdr[kb]->SetUnSensitive(); 398 for(kb=0; kb<4;kb++) mButcf[kb]->SetUnSensitive(); 399 if (butsensnew == 0) mButcf[4]->SetUnSensitive(); 400 else mButcf[4]->SetSensitive(); 401 } 402 else { 403 for(kb=0; kb<2;kb++) mButdr[kb]->SetSensitive(); 404 for(kb=0; kb<3;kb++) mButcf[kb]->SetSensitive(); 405 mButcf[4]->SetSensitive(); 406 if ((dr != NULL) && dr->HasSpecificControlWindow()) 407 mButcf[3]->SetSensitive(); 408 else mButcf[3]->SetUnSensitive(); 409 } 410 } 411 mButSens = butsensnew; 412 } 355 413 356 414 /* --Methode-- */ … … 457 515 458 516 switch (msg) { 459 case 2800 : 517 case 1501 : 518 case 1502 : 519 if (mCurBW && (mCurBW->NbDrawers() > 0)) { 520 if (msg == 1501) UpdateControlsFromDrawer(mNDr-1); 521 else UpdateControlsFromDrawer(mNDr+1); 522 } 523 break; 524 525 case 2500 : 460 526 UpdateAttFromDrawer(); 461 527 break; 462 528 463 case 2 900 :529 case 2600 : 464 530 SetGraphicAtt(false); 465 531 break; 466 532 467 case 3100 : 468 SetGraphicAtt(true); 469 break; 470 471 case 3200 : 533 case 2700 : 472 534 if ((mCurBW != NULL) && (mCurBW->GetDrawer(mNDr) != NULL) ) { 473 535 if (mod == PIMsg_Press) { … … 479 541 break; 480 542 543 case 2800 : 544 if ((mCurBW != NULL) && (mCurBW->GetDrawer(mNDr) != NULL) ) 545 mCurBW->GetDrawer(mNDr)->ShowControlWindow(mCurBW); 546 break; 547 548 case 3000 : 549 SetGraphicAtt(true); 550 break; 551 481 552 case 3777 : 482 553 Hide(); 483 554 break; 484 555 485 case 3501 :486 case 3502 :487 if (mCurBW) {488 if (msg == 3501) { mNDr--; if (mNDr < 0) mNDr = 0; }489 else { mNDr++; if (mNDr >= mCurBW->NbDrawers()) mNDr--; }490 sprintf(strg, "%d", mNDr);491 mNlb->SetLabel(strg);492 }493 556 /* On ne change pas les options choisies Reza+cmv 2/10/98 494 557 mOpt[0]->SetValue(100); -
trunk/SophyaPI/PI/pidrwtools.h
r1827 r1851 32 32 33 33 protected: 34 virtual void UpdateControlsFromDrawer(int numdr); 34 35 virtual void UpdateAttFromDrawer(); 35 36 virtual void SetGraphicAtt(bool fgref); … … 41 42 PIMenu* mCasc[5]; 42 43 PILabel* mNlb; 44 PILabel* mDrName; 43 45 PIButton* mButdr[2]; 44 PIButton* mButcf[ 5];46 PIButton* mButcf[6]; 45 47 int mNDr; 46 int mtyp, msz; 47 // 48 // mButSens - Pour l'etat de sensibilite des boutons 49 // 0 NoBaseDrawer , 1 BaseDrawer - NoDrawer , 2= BaseDrawer+CurDrawer 50 int mButSens; 51 // ------------------------------------------------------ 48 52 static PIBaseWdgGen* mCurBW; 49 53 static PIDrwTools* cwdrwt; -
trunk/SophyaPI/PI/pigraphgen.cc
r1849 r1851 298 298 int posh = pos & PI_HorizontalPosition; 299 299 int posv = pos & PI_VerticalPosition; 300 if ((posh == PI_HorizontalLeft) && (posv == PI_VerticalBottom)) 300 if ( ((posh == 0) && (posv == PI_VerticalBaseLine)) || 301 ((posh == PI_HorizontalLeft) && (posv == 0)) || 302 ((posh == PI_HorizontalLeft) && (posv == PI_VerticalBaseLine)) ) 301 303 return(false); 302 304 if (posh != PI_HorizontalLeft) { … … 306 308 else wx = 0; 307 309 } 308 if (posv != PI_VerticalBottom) { 309 int a,d; 310 int wy = myFont.GetFontHeight(a, d); 311 if (posv == PI_VerticalCenter) dy = -wy/2; 312 else if (posv == PI_VerticalTop) dy = -wy; 310 if (posv != PI_VerticalBaseLine) { 311 int asc,desc; 312 int wy = myFont.GetFontHeight(asc, desc); 313 if (posv == PI_VerticalBottom) dy = desc; 314 else if (posv == PI_VerticalCenter) dy = -wy/2+desc; 315 else if (posv == PI_VerticalTop) dy = -wy+desc; 313 316 else dy = 0; 314 317 } -
trunk/SophyaPI/PI/pigraphgen.h
r1848 r1851 36 36 enum PIGrPosVertical // Flags de positionnement vertical 37 37 // PI_VerticalPosition regroupe l'ensemble des bits utilisables 38 { PI_VerticalBottom = 0x10, PI_VerticalCenter = 0x20, 39 PI_VerticalTop = 0x30, PI_VerticalPosition = 0xF0 }; 38 { PI_VerticalBottom = 0x10, PI_VerticalBaseLine = 0x20, 39 PI_VerticalCenter = 0x30, PI_VerticalTop = 0x40, 40 PI_VerticalPosition = 0xF0 }; 40 41 41 42 // Les differents modes de trace graphique disponible -
trunk/SophyaPI/PI/pigraphps.cc
r1848 r1851 114 114 void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos) 115 115 { 116 if(mPSOut) 117 // mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */ 118 mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(), 119 myFont.GetFontAtt(), myFont.GetFontSize(), 120 pos); /* $CHECK$ x 0.9 - Reza 4/11/99 - enleve 3/01/2002 */ 121 // Calculez la taille de la boite occupe par la fonte 122 // myFont.GetFontHeight(int& asc, int& desc) Tres proche de myFont.GetFontSize() en principe 123 // myFont.GetStringWidth(char const* s) Largeur occupe par la chaine 116 if(mPSOut) { 117 int posh = pos & PI_HorizontalPosition; 118 int posv = pos & PI_VerticalPosition; 119 int dx,dy; 120 double xd = x; 121 double yd = y; 122 if ( CalcStringPositionShift(s, posv, dx, dy) ) yd -= dy; 123 mPSOut->DrawString(xd, yd, s, mFCol, myFont.GetFontName(), myFont.GetFontAtt(), 124 myFont.GetFontSize(), posh); 125 } 124 126 return; 125 127 } … … 128 130 void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos) 129 131 { 130 if(mPSOut) 131 // mPSOut->DrawString((double)x,(double)y,s,mFCol,mFAtt,mFSize); /* $CHECK$ PIFontSize ?? */ 132 mPSOut->DrawString((double)x,(double)y,s,mFCol, myFont.GetFontName(), 133 myFont.GetFontAtt(), myFont.GetFontSize(), 134 pos); /* $CHECK$ x 0.9 - Reza 4/11/99 */ 135 // Idem taille ici 132 if(mPSOut) { 133 int posh = pos & PI_HorizontalPosition; 134 int posv = pos & PI_VerticalPosition; 135 int dx,dy; 136 double xd = x; 137 double yd = y; 138 if ( CalcStringPositionShift(s, posv, dx, dy) ) yd -= dy; 139 mPSOut->DrawString(xd, yd, s, mFCol, myFont.GetFontName(), myFont.GetFontAtt(), 140 myFont.GetFontSize(), posh); 141 } 136 142 return; 137 143 } -
trunk/SophyaPI/PI/psfile.cc
r1848 r1851 132 132 /rmv {rmoveto} bind def \n\ 133 133 %% Trace de chaine avec justification diverse \n\ 134 %% ------------------------------------------------- \n\ 135 %% hxshstr stack: TheString \n\ 136 %% hx (x=r,c,l) Horizontal-X Right,Center,Left - Vertical: BaseLine \n\ 137 %% ------------------------------------------------- \n\ 138 /hlshstr %% Horizontal-left Vertical-BaseLine justified \n\ 139 { gs 1 -1 sc show gr } bind def \n\ 140 /hcshstr %% Horizontal-Center Vertical-BaseLine justified \n\ 141 { dup stringwidth pop 2 div neg %% get minus(string length/2) \n\ 142 0 rmoveto gs 1 -1 sc show gr } bind def \n\ 143 /hrvbshstr %% Horizontal-Right Vertical-BaseLine justified \n\ 144 { dup stringwidth pop neg %% get minus(string width) \n\ 145 0 rmoveto gs 1 -1 sc show gr } bind def \n\ 146 %% ------------------------------------------------- \n\ 134 147 %% hxvyshstr stack: TheString \n\ 135 148 %% hx (x=r,c,l) Horizontal-X Right,Center,Left \n\ 136 149 %% vy (y=t,c,b) Vertical-Y Top,Center,Bottom \n\ 150 %% Ces procs (hxvyshstr) utilisent la variable curfntsz que l'on definit par defaut \n\ 151 %% hxshstr stack: TheString \n\ 152 %% hx (x=r,c,l) Horizontal-X Right,Center,Left - Vertical: BaseLine \n\ 153 %% ------------------------------------------------- \n\ 154 /curfntsz 10 def \n\ 137 155 /hlvbshstr %% Horizontal-left Vertical-Bottom justified \n\ 138 156 { gs 1 -1 sc show gr } bind def \n\ … … 144 162 0 rmoveto gs 1 -1 sc show gr } bind def \n\ 145 163 /hlvcshstr %% Horizontal-left Vertical-Center justified \n\ 146 { dup stringwidth exch pop2 div %% get (string height)/2 \n\147 0 exchrmoveto gs 1 -1 sc show gr } bind def \n\164 { 0 curfntsz 2 div %% get (string height)/2 \n\ 165 rmoveto gs 1 -1 sc show gr } bind def \n\ 148 166 /hcvcshstr %% Horizontal-Center Vertical-Center justified \n\ 149 { dup stringwidth 2 div exch 2 div neg%% s_wy/2 -s_wx/2 \n\150 exchrmoveto gs 1 -1 sc show gr } bind def \n\167 { dup stringwidth pop 2 div neg curfntsz 2 div %% s_wy/2 -s_wx/2 \n\ 168 rmoveto gs 1 -1 sc show gr } bind def \n\ 151 169 /hrvcshstr %% Horizontal-Right Vertical-Center justified \n\ 152 { dup stringwidth 2 div exch neg%% s_wy/2 -s_wx \n\153 exchrmoveto gs 1 -1 sc show gr } bind def \n\170 { dup stringwidth pop neg curfntsz %% s_wy/2 -s_wx \n\ 171 rmoveto gs 1 -1 sc show gr } bind def \n\ 154 172 /hlvtshstr %% Horizontal-left Vertical-Top justified \n\ 155 { dup stringwidth exch pop%% get s_wy \n\156 0 exchrmoveto gs 1 -1 sc show gr } bind def \n\173 { 0 curfntsz %% get s_wy \n\ 174 rmoveto gs 1 -1 sc show gr } bind def \n\ 157 175 /hcvtshstr %% Horizontal-Center Vertical-Top justified \n\ 158 { dup stringwidth exch 2 div neg%% s_wy -s_wx/2 \n\159 exchrmoveto gs 1 -1 sc show gr } bind def \n\176 { dup stringwidth pop 2 div neg curfntsz %% s_wy -s_wx/2 \n\ 177 rmoveto gs 1 -1 sc show gr } bind def \n\ 160 178 /hrvtshstr %% Horizontal-Right Vertical-Top justified \n\ 161 { dup stringwidth exch neg%% s_wy -s_wx \n\162 exchrmoveto gs 1 -1 sc show gr } bind def \n\179 { dup stringwidth pop neg curfntsz %% s_wy -s_wx \n\ 180 rmoveto gs 1 -1 sc show gr } bind def \n\ 163 181 %% Tx Ty X0 Y0 box\n\ 164 182 /box {tr 0 3 1 roll neg exch 0 0 3 index neg 0 0 m rl rl rl c} bind def\n\ … … 604 622 } /* BB */ 605 623 /* facteur d'echelle pour les fontes*/ 606 currentPage->FontScaleFactor = 1.1*scale;624 currentPage->FontScaleFactor = scale; 607 625 // postscript_resolution/def_user_resolution*scale; 608 626 /* … … 688 706 } /* End if .Landscape */ 689 707 /* facteur d'echelle pour les fontes*/ 690 currentPage->FontScaleFactor = 1.2*scale*postscript_resolution;708 currentPage->FontScaleFactor = scale*postscript_resolution; 691 709 /* 692 710 cout << " PS_DBG_FontScaleFactor = " << currentPage->FontScaleFactor … … 700 718 mFontSize = 10; 701 719 mFontName = PI_DefaultFont; 702 fprintf(mPSFile, "/Courier ff %d FS \n", mFontSize) ; 720 double scaledFontSize = (double)mFontSize*currentPage->FontScaleFactor; 721 fprintf(mPSFile, "/Courier ff %g FS /curfntsz %g def \n", scaledFontSize, scaledFontSize) ; 703 722 setFontDone = true; 704 723 currentPage->tmp = ftell(mPSFile); … … 777 796 mFontSize = 10; 778 797 mFontName = PI_DefaultFont; 779 fprintf(mPSFile, "/Courier ff %d FS \n", mFontSize) ; 798 double scaledFontSize = (double)mFontSize*currentPage->FontScaleFactor; 799 fprintf(mPSFile, "/Courier ff %g FS /curfntsz %g def \n", 800 scaledFontSize, scaledFontSize) ; 780 801 setFontDone = true; 781 802 currentBloc->tmp = ftell(mPSFile) ; … … 830 851 bool change = false; 831 852 832 FontSize = (float)FontSize*currentPage->FontScaleFactor;833 853 /* Couleurs */ 834 854 if ( (DrawColor != PI_NotDefColor) && (DrawColor != mDrawColor) ) { … … 890 910 break ; 891 911 } // endsw 892 fprintf(mPSFile, " ff %d FS ", FontSize) ; 912 double scaledFontSize = (double)FontSize*currentPage->FontScaleFactor; 913 fprintf(mPSFile, " ff %g FS /curfntsz %g def \n", scaledFontSize, scaledFontSize); 893 914 setFontDone = true ; // $CHECK$ - doit etre fait uniquement a ce moment 894 915 } … … 898 919 int posh = pos & PI_HorizontalPosition; 899 920 int posv = pos & PI_VerticalPosition; 900 if ((posh == PI_HorizontalLeft) && (posv == PI_VerticalBottom)) 901 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) hlvbshstr gr\n", 921 if ((posh == PI_HorizontalLeft) && 922 ((posv == PI_VerticalBaseLine) || (posv == 0)) ) 923 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) hlshstr gr\n", 902 924 x, y, s) ; 903 925 else { … … 909 931 else sshp = 'l'; 910 932 } 911 if (posv != PI_VerticalBottom) { 933 if (posv == 0) 934 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cshstr gr\n", 935 x, y, s, sshp) ; 936 else { 912 937 if (posv == PI_VerticalCenter) ssvp = 'c'; 913 938 else if (posv == PI_VerticalTop) ssvp = 't'; 939 else ssvp = 'b'; 914 940 } 915 941 fprintf(mPSFile, "gs %.2f Ux %.2f Uy m (%s) h%cv%cshstr gr\n", 916 x, y, s, sshp, ssvp) ;942 x, y, s, sshp, ssvp) ; 917 943 } 918 944 } 945 919 946 } 920 947
Note:
See TracChangeset
for help on using the changeset viewer.