summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2020-05-26 12:05:46 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2020-10-12 10:31:46 -0700
commit02e3169b57724f63ce01c994d39c20647be5c20b (patch)
treee461bb6ebb65b3185d15a4235cd1727dd6909797 /windows
parent1ff2ddac001612df3d54b504b49f6ee8e0685be7 (diff)
downloadghostpdl-02e3169b57724f63ce01c994d39c20647be5c20b.tar.gz
Bug 702192 Map text to black
Map all text to black. This is achieved by altering the color space to DeviceGray with a fill of black during gs_text_begin. When gs_text_release occurs, the color space is restored. This will only occur with the option -dBlackText and if the text is actually to be drawn. When going to a raster device, the stroke and stroke fill of the text is handled with a stroke or stroke fill command. My original plan of storing the old color spaces and client color in the text enumerator will not work in this situation as it the enumerator will have already been destroyed when the stroke or stroke/fill command occurs. For this reason I store the old color space information for the current and alternate color spaces in the graphic state. The structure holding the information is garbage collected as it is holding objects that may be garbage collected. We also need to know if the target was a high level device like pdfwrite, as that device will handle the fill AND stroke, and we will need to restore the color space when we tear down the text enumerator. gs_text_release needed to have the pgs added as a parameter to allow the possible release of the blacktext structure when the text is released from the other languages. This did not seem to be too big of an issue as gs_text_begin passes the pgs also. If the pgs is not available, NULL can be passed, and that is done in several locations. A new special op was added to let us avoid doing the black text setting if we are constructing a soft mask. If we did not do this the mask could result in the loss of the text. Finally, Type 3 fonts will NOT be affected by this process. Type 3 fonts are often used for actual graphic logos etc. Ken Sharp suggested we not have them affected by this setting. There were also issues with trying to do type 3 fonts in in that the PDF interpreter does some color space settings of its state when dealing with type 3 fonts and this put the interpreter's state out of sync with the graphic library state. This was tested with a forced setting of black text enabled. No seg faults or errors occurred. There were obviously a lot of differences reported (over 33,000). All the images that were available to me with bmpcmp were gone through. Problems were found and addressed (the soft mask issue for example was found, as were issues with color spaces not getting properly restored).
Diffstat (limited to 'windows')
-rw-r--r--windows/ghostscript.vcxproj2
-rw-r--r--windows/ghostscript.vcxproj.filters6
2 files changed, 8 insertions, 0 deletions
diff --git a/windows/ghostscript.vcxproj b/windows/ghostscript.vcxproj
index 0f198da33..bb213b3cf 100644
--- a/windows/ghostscript.vcxproj
+++ b/windows/ghostscript.vcxproj
@@ -1067,6 +1067,7 @@
<ClCompile Include="..\base\gshtscr.c" />
<ClCompile Include="..\base\gshtx.c" />
<ClCompile Include="..\base\gsicc.c" />
+ <ClCompile Include="..\base\gsicc_blacktext.c" />
<ClCompile Include="..\base\gsicc_cache.c" />
<ClCompile Include="..\base\gsicc_create.c" />
<ClCompile Include="..\base\gsicc_lcms2.c" />
@@ -2542,6 +2543,7 @@
<ClInclude Include="..\base\gsht1.h" />
<ClInclude Include="..\base\gshtx.h" />
<ClInclude Include="..\base\gsicc.h" />
+ <ClInclude Include="..\base\gsicc_blacktext.h" />
<ClInclude Include="..\base\gsicc_cache.h" />
<ClInclude Include="..\base\gsicc_cms.h" />
<ClInclude Include="..\base\gsicc_create.h" />
diff --git a/windows/ghostscript.vcxproj.filters b/windows/ghostscript.vcxproj.filters
index f4a89bfdf..75a27e802 100644
--- a/windows/ghostscript.vcxproj.filters
+++ b/windows/ghostscript.vcxproj.filters
@@ -6026,6 +6026,9 @@
<ClCompile Include="..\base\gdevkrnlsclass.c">
<Filter>base\gldevices</Filter>
</ClCompile>
+ <ClCompile Include="..\base\gsicc_blacktext.c">
+ <Filter>base\color\icc</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\base\aes.h">
@@ -8968,6 +8971,9 @@
<ClInclude Include="..\base\gdevepo.h">
<Filter>base %28.h%29\gldevices %28.h%29</Filter>
</ClInclude>
+ <ClInclude Include="..\base\gsicc_blacktext.h">
+ <Filter>base %28.h%29\icc %28.h%29</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\base\gspmdrv.rc">