• R/O
  • SSH

wp2latex: Commit

WP2LaTeX sources.


Commit MetaInfo

Revisioncb90bbfe9c7c57fb64d924aed53b1c1ef87b63ba (tree)
Zeit2022-07-02 02:24:35
AutorFojtik
CommiterFojtik

Log Message

Convert opaque background for text font.

Ändern Zusammenfassung

Diff

diff -r d67f654189c0 -r cb90bbfe9c7c trunk/sources.cc/images/vecimage.cc
--- a/trunk/sources.cc/images/vecimage.cc Sun Jun 05 12:41:42 2022 +0200
+++ b/trunk/sources.cc/images/vecimage.cc Fri Jul 01 19:24:35 2022 +0200
@@ -1288,6 +1288,7 @@
12881288 FontOrientation = 0;
12891289 RotCenterX = RotCenterY = 0;
12901290 TextAllign = 0;
1291+ MixMode = 0;
12911292 }
12921293
12931294
@@ -1332,7 +1333,7 @@
13321333 /// @param[in,out] str String that needs either cleanup or adding \show.
13331334 /// @param[in,out] strLine Newly added chunk of text. Will be erased on return.
13341335 /// @param[in] HorizontalPos Horizontal position placement.
1335-void AppendShow(string &str, string &strLine, const unsigned char HorizontalPos)
1336+void AppendShow(string &str, string &strLine, const unsigned char HorizontalPos, bool Opaque=false)
13361337 {
13371338 int len = length(strLine);
13381339 if(len==0) return;
@@ -1379,6 +1380,30 @@
13791380 break;
13801381 default: str += strLine;
13811382 }
1383+
1384+ if(Opaque)
1385+ {
1386+ str += "\ngsave dup"
1387+ "\ntrue charpath pathbbox" //llx lly urx ury
1388+ "\n3 index" //llx lly urx ury llx
1389+ "\n3 index" //llx lly urx ury llx lly
1390+ "\nmoveto" //llx lly urx ury (llx lly)
1391+ "\n1 index" //llx lly urx ury urx
1392+ "\n3 index" //llx lly urx ury urx lly
1393+ "\nlineto" //llx lly urx ury (urx lly)
1394+ "\n1 index"
1395+ "\n1 index"
1396+ "\nlineto" //llx lly urx ury (urx ury)
1397+ "\n3 index"
1398+ "\n1 index"
1399+ "\nlineto"
1400+ "\npop pop pop pop"
1401+ "\nclosepath"
1402+ "\n1 1 1 setrgbcolor"
1403+ "\nfill"
1404+ "\ngrestore";
1405+ }
1406+
13821407 str += "\nshow";
13831408 erase(strLine);
13841409 }
@@ -1393,11 +1418,11 @@
13931418 const bool TextRotated = fabs(NormAngleDEG(FontOrientation)) > 0.01;
13941419
13951420 if(Text!=NULL && TextObjects>0)
1396- {
1421+ {
13971422 if(PSS!=NULL)
13981423 {
13991424 PS_Attr(str,PSS);
1400- memcpy(&BkTextColor,&PSS->LineColor,sizeof(RGB_Record));
1425+ memcpy(&BkTextColor,&PSS->LineColor,sizeof(RGB_Record));
14011426 }
14021427 if(TextRotated)
14031428 {
@@ -1418,7 +1443,7 @@
14181443 FixPsAccent(Text[i]->contents,"\\\"{","(\\310)"); // umlaut
14191444 FixPsAccent2(Text[i]->contents,"\\accent39","( \\47)"); //insert space before apostrophe \\47
14201445
1421- if(i>0) AppendShow(str,strLine,TextAllign);
1446+ if(i>0) AppendShow(str,strLine,TextAllign,MixMode==2);
14221447
14231448 if(PSS!=NULL)
14241449 {
@@ -1464,7 +1489,7 @@
14641489 ScanS = ScanS2 + 1;
14651490
14661491 CurPosY -= 1.01 * Text[i]->size*2.66f;
1467- AppendShow(str,strLine,TextAllign);
1492+ AppendShow(str,strLine,TextAllign,MixMode==2);
14681493 str.cat_printf(" newpath %2.2f %2.2f moveto", CurPosX, CurPosY);
14691494 }
14701495
@@ -1476,7 +1501,7 @@
14761501 }
14771502 }
14781503 }
1479- AppendShow(str,strLine,TextAllign);
1504+ AppendShow(str,strLine,TextAllign,MixMode==2);
14801505 if(TextRotated)
14811506 {
14821507 str += "\ngrestore";
diff -r d67f654189c0 -r cb90bbfe9c7c trunk/sources.cc/images/vecimage.h
--- a/trunk/sources.cc/images/vecimage.h Sun Jun 05 12:41:42 2022 +0200
+++ b/trunk/sources.cc/images/vecimage.h Fri Jul 01 19:24:35 2022 +0200
@@ -455,6 +455,7 @@
455455 float FontOrientation; ///< Font rotation [deg]
456456 float RotCenterX, RotCenterY;
457457 BYTE TextAllign;
458+ BYTE MixMode; ///< 1 Transparent; 2 Opaque
458459
459460 TextContainer();
460461 virtual ~TextContainer();
diff -r d67f654189c0 -r cb90bbfe9c7c trunk/sources.cc/pass1wmf.cc
--- a/trunk/sources.cc/pass1wmf.cc Sun Jun 05 12:41:42 2022 +0200
+++ b/trunk/sources.cc/pass1wmf.cc Fri Jul 01 19:24:35 2022 +0200
@@ -844,7 +844,7 @@
844844 default: PSS.FillPattern=FILL_DIAG_UP; break;
845845 }
846846 if(MixMode==2 && PSS.FillPattern>FILL_SOLID)
847- PSS.FillPattern|=0x80;
847+ PSS.FillPattern|=0x80;
848848 }
849849 break;
850850 case BS_NULL:
@@ -1470,7 +1470,7 @@
14701470 if(BkMode==2) // Opaque
14711471 {
14721472 MixMode = 2;
1473- if(PSS.FillPattern>FILL_SOLID) PSS.FillPattern|=0x80;
1473+ if(PSS.FillPattern>FILL_SOLID) PSS.FillPattern |= 0x80;
14741474 }
14751475 else // Transparent
14761476 {
@@ -1567,6 +1567,7 @@
15671567 pTextCont->PosY = 0;
15681568 pTextCont->TextAllign = PSS.TextAllign;
15691569 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
1570+ pTextCont->MixMode = MixMode;
15701571 LineLen = CurLineLen = 0;
15711572 XStart = StringLen & 1;
15721573 while(StringLen-->0)
@@ -1590,6 +1591,7 @@
15901591 pTextCont->PosY = CurPosY;
15911592 pTextCont->TextAllign = PSS.TextAllign;
15921593 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
1594+ pTextCont->MixMode = MixMode;
15931595 }
15941596 }
15951597 else CurLineLen++;
@@ -1689,6 +1691,7 @@
16891691 pTextCont->PosY = Scale*y_pos;
16901692 pTextCont->TextAllign = PSS.TextAllign;
16911693 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
1694+ pTextCont->MixMode = MixMode;
16921695
16931696 LineLen = CurLineLen = 0;
16941697 if(log!=NULL) fputc(' ',log);
@@ -1711,6 +1714,7 @@
17111714 pTextCont->PosY = CurPosY;
17121715 pTextCont->TextAllign = PSS.TextAllign;
17131716 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
1717+ pTextCont->MixMode = MixMode;
17141718 }
17151719 }
17161720 else CurLineLen++;
@@ -2887,6 +2891,7 @@
28872891 pTextCont->PosY = Scale*y_pos + mm2PSu(PSS.FontSize); // Fix text position.
28882892 pTextCont->TextAllign = PSS.TextAllign;
28892893 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
2894+ pTextCont->MixMode = MixMode;
28902895
28912896 if(log!=NULL && CharCount>0) fputc('\n',log);
28922897 while(CharCount-->0 && !feof(wpd))
@@ -2950,6 +2955,7 @@
29502955 pTextCont->PosY = Scale*y_pos;
29512956 pTextCont->TextAllign = PSS.TextAllign;
29522957 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
2958+ pTextCont->FillPattern = PSS.FillPattern;
29532959
29542960 LineLen = CurLineLen = 0;
29552961 if(log!=NULL) fputc(' ',log);
@@ -2972,6 +2978,7 @@
29722978 pTextCont->PosY = CurPosY;
29732979 pTextCont->TextAllign = PSS.TextAllign;
29742980 pTextCont->FontOrientation = PSS.FontOrientation10 / 10.0f;
2981+ pTextCont->FillPattern = PSS.FillPattern;
29752982 }
29762983 }
29772984 else CurLineLen++;
diff -r d67f654189c0 -r cb90bbfe9c7c trunk/sources.cc/wp2latex.h
--- a/trunk/sources.cc/wp2latex.h Sun Jun 05 12:41:42 2022 +0200
+++ b/trunk/sources.cc/wp2latex.h Fri Jul 01 19:24:35 2022 +0200
@@ -18,7 +18,7 @@
1818 #define LineLength 80 /* Split lines after more than LineLength charcters */
1919
2020 #define VersionWP2L "3.pre108"
21-#define VersionDate "6 Jun 2022" /* day (space) month (space) full year */
21+#define VersionDate "30 Jun 2022" /* day (space) month (space) full year */
2222
2323
2424 /* Constants for a flag InputPS */
Show on old repository browser