From f44120dffecac18d69fef380c4d3eb27050e70ab Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 15 Sep 2015 17:17:54 +0200 Subject: [PATCH] Rebase against aacc7b394ee1eb25001ae2854fd774e1b443e50b. --- README.md | 2 +- debian/changelog | 2 + patches/patchinstall.sh | 25 +- ...upport-for-PostScript-Format-1-glyph.patch | 353 ------------------ ...upport-for-PostScript-Format-2-stand.patch | 53 --- ...upport-for-PostScript-Format-2-custo.patch | 68 ---- patches/wineps.drv-Glyph_Names/definition | 1 - 7 files changed, 4 insertions(+), 500 deletions(-) delete mode 100644 patches/wineps.drv-Glyph_Names/0001-wineps.drv-Add-support-for-PostScript-Format-1-glyph.patch delete mode 100644 patches/wineps.drv-Glyph_Names/0002-wineps.drv-Add-support-for-PostScript-Format-2-stand.patch delete mode 100644 patches/wineps.drv-Glyph_Names/0003-wineps.drv-Add-support-for-PostScript-Format-2-custo.patch delete mode 100644 patches/wineps.drv-Glyph_Names/definition diff --git a/README.md b/README.md index 9f16a3b7..0217ddc3 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,7 @@ for more details.* * Use POSIX implementation to enumerate directory content on FreeBSD ([Wine Bug #35397](https://bugs.winehq.org/show_bug.cgi?id=35397)) * Use actual program name if available to describe PulseAudio streams * Use manual relay for RunDLL_CallEntry16 in shell32 ([Wine Bug #23033](https://bugs.winehq.org/show_bug.cgi?id=23033)) -* Use proper glyph names in wineps driver to allow copying text from generated PDF files ([Wine Bug #6416](https://bugs.winehq.org/show_bug.cgi?id=6416)) +* ~~Use proper glyph names in wineps driver to allow copying text from generated PDF files~~ ([Wine Bug #6416](https://bugs.winehq.org/show_bug.cgi?id=6416)) * Use video memory for rendering targets if possible ([Wine Bug #34906](https://bugs.winehq.org/show_bug.cgi?id=34906)) * Voobly expects correct handling of WRITECOPY memory protection ([Wine Bug #29384](https://bugs.winehq.org/show_bug.cgi?id=29384)) * Wine ignores IDF_CHECKFIRST flag in SetupPromptForDisk ([Wine Bug #20465](https://bugs.winehq.org/show_bug.cgi?id=20465)) diff --git a/debian/changelog b/debian/changelog index 56afbec6..98b49064 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ wine-staging (1.7.52) UNRELEASED; urgency=low else (fixed upstream). * Removed patch to try harder to get the host name address in getaddrinfo (accepted upstream). + * Rempved patch to use proper glyph names in wineps driver (accepted + upstream). -- Sebastian Lackner Mon, 07 Sep 2015 16:51:25 +0200 wine-staging (1.7.51) unstable; urgency=low diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a685e6b5..b27d456a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "a7e294c064ac443a4351d1cbe84e7f52e0775d6f" + echo "aacc7b394ee1eb25001ae2854fd774e1b443e50b" } # Show version information @@ -302,7 +302,6 @@ patch_enable_all () enable_wined3d_wined3d_swapchain_present="$1" enable_winedevice_Fix_Relocation="$1" enable_winemenubuilder_Desktop_Icon_Path="$1" - enable_wineps_drv_Glyph_Names="$1" enable_winepulse_PulseAudio_Support="$1" enable_winex11_CandidateWindowPos="$1" enable_winex11_Clipboard_HTML="$1" @@ -1001,9 +1000,6 @@ patch_enable () winemenubuilder-Desktop_Icon_Path) enable_winemenubuilder_Desktop_Icon_Path="$2" ;; - wineps.drv-Glyph_Names) - enable_wineps_drv_Glyph_Names="$2" - ;; winepulse-PulseAudio_Support) enable_winepulse_PulseAudio_Support="$2" ;; @@ -6066,25 +6062,6 @@ if test "$enable_winemenubuilder_Desktop_Icon_Path" -eq 1; then ) >> "$patchlist" fi -# Patchset wineps.drv-Glyph_Names -# | -# | This patchset fixes the following Wine bugs: -# | * [#6416] Use proper glyph names in wineps driver to allow copying text from generated PDF files -# | -# | Modified files: -# | * dlls/wineps.drv/download.c -# | -if test "$enable_wineps_drv_Glyph_Names" -eq 1; then - patch_apply wineps.drv-Glyph_Names/0001-wineps.drv-Add-support-for-PostScript-Format-1-glyph.patch - patch_apply wineps.drv-Glyph_Names/0002-wineps.drv-Add-support-for-PostScript-Format-2-stand.patch - patch_apply wineps.drv-Glyph_Names/0003-wineps.drv-Add-support-for-PostScript-Format-2-custo.patch - ( - echo '+ { "Erich E. Hoover", "wineps.drv: Add support for PostScript Format 1 glyph names.", 1 },'; - echo '+ { "Erich E. Hoover", "wineps.drv: Add support for PostScript Format 2 standard glyph names.", 1 },'; - echo '+ { "Erich E. Hoover", "wineps.drv: Add support for PostScript Format 2 custom glyph names.", 1 },'; - ) >> "$patchlist" -fi - # Patchset winepulse-PulseAudio_Support # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wineps.drv-Glyph_Names/0001-wineps.drv-Add-support-for-PostScript-Format-1-glyph.patch b/patches/wineps.drv-Glyph_Names/0001-wineps.drv-Add-support-for-PostScript-Format-1-glyph.patch deleted file mode 100644 index 7c5230f4..00000000 --- a/patches/wineps.drv-Glyph_Names/0001-wineps.drv-Add-support-for-PostScript-Format-1-glyph.patch +++ /dev/null @@ -1,353 +0,0 @@ -From b47e59b55fa66ce105e1ee03008ac16516673671 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Wed, 2 Sep 2015 17:21:15 -0600 -Subject: wineps.drv: Add support for PostScript Format 1 glyph names. - ---- - dlls/wineps.drv/download.c | 321 ++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 318 insertions(+), 3 deletions(-) - -diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c -index e5b57f7..59c542c 100644 ---- a/dlls/wineps.drv/download.c -+++ b/dlls/wineps.drv/download.c -@@ -30,6 +30,8 @@ - #include "winnls.h" - - #include "psdrv.h" -+#include "data/agl.h" -+ - #include "wine/debug.h" - - WINE_DEFAULT_DEBUG_CHANNEL(psdrv); -@@ -359,11 +361,324 @@ BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev, BOOL vertical) - return TRUE; - } - -+void get_standard_glyph_name(WORD index, char *name) -+{ -+ static const GLYPHNAME nonbreakingspace = { -1, "nonbreakingspace" }; -+ static const GLYPHNAME nonmarkingreturn = { -1, "nonmarkingreturn" }; -+ static const GLYPHNAME notdef = { -1, ".notdef" }; -+ static const GLYPHNAME null = { -1, ".null" }; -+ /* These PostScript Format 1 glyph names are stored by glyph index, do not reorder them. */ -+ static const GLYPHNAME *glyph_table[] = { -+ ¬def, -+ &null, -+ &nonmarkingreturn, -+ GN_space, -+ GN_exclam, -+ GN_quotedbl, -+ GN_numbersign, -+ GN_dollar, -+ GN_percent, -+ GN_ampersand, -+ GN_quotesingle, -+ GN_parenleft, -+ GN_parenright, -+ GN_asterisk, -+ GN_plus, -+ GN_comma, -+ GN_hyphen, -+ GN_period, -+ GN_slash, -+ GN_zero, -+ GN_one, -+ GN_two, -+ GN_three, -+ GN_four, -+ GN_five, -+ GN_six, -+ GN_seven, -+ GN_eight, -+ GN_nine, -+ GN_colon, -+ GN_semicolon, -+ GN_less, -+ GN_equal, -+ GN_greater, -+ GN_question, -+ GN_at, -+ GN_A, -+ GN_B, -+ GN_C, -+ GN_D, -+ GN_E, -+ GN_F, -+ GN_G, -+ GN_H, -+ GN_I, -+ GN_J, -+ GN_K, -+ GN_L, -+ GN_M, -+ GN_N, -+ GN_O, -+ GN_P, -+ GN_Q, -+ GN_R, -+ GN_S, -+ GN_T, -+ GN_U, -+ GN_V, -+ GN_W, -+ GN_X, -+ GN_Y, -+ GN_Z, -+ GN_bracketleft, -+ GN_backslash, -+ GN_bracketright, -+ GN_asciicircum, -+ GN_underscore, -+ GN_grave, -+ GN_a, -+ GN_b, -+ GN_c, -+ GN_d, -+ GN_e, -+ GN_f, -+ GN_g, -+ GN_h, -+ GN_i, -+ GN_j, -+ GN_k, -+ GN_l, -+ GN_m, -+ GN_n, -+ GN_o, -+ GN_p, -+ GN_q, -+ GN_r, -+ GN_s, -+ GN_t, -+ GN_u, -+ GN_v, -+ GN_w, -+ GN_x, -+ GN_y, -+ GN_z, -+ GN_braceleft, -+ GN_bar, -+ GN_braceright, -+ GN_asciitilde, -+ GN_Adieresis, -+ GN_Aring, -+ GN_Ccedilla, -+ GN_Eacute, -+ GN_Ntilde, -+ GN_Odieresis, -+ GN_Udieresis, -+ GN_aacute, -+ GN_agrave, -+ GN_acircumflex, -+ GN_adieresis, -+ GN_atilde, -+ GN_aring, -+ GN_ccedilla, -+ GN_eacute, -+ GN_egrave, -+ GN_ecircumflex, -+ GN_edieresis, -+ GN_iacute, -+ GN_igrave, -+ GN_icircumflex, -+ GN_idieresis, -+ GN_ntilde, -+ GN_oacute, -+ GN_ograve, -+ GN_ocircumflex, -+ GN_odieresis, -+ GN_otilde, -+ GN_uacute, -+ GN_ugrave, -+ GN_ucircumflex, -+ GN_udieresis, -+ GN_dagger, -+ GN_degree, -+ GN_cent, -+ GN_sterling, -+ GN_section, -+ GN_bullet, -+ GN_paragraph, -+ GN_germandbls, -+ GN_registered, -+ GN_copyright, -+ GN_trademark, -+ GN_acute, -+ GN_dieresis, -+ GN_notequal, -+ GN_AE, -+ GN_Oslash, -+ GN_infinity, -+ GN_plusminus, -+ GN_lessequal, -+ GN_greaterequal, -+ GN_yen, -+ GN_mu, -+ GN_partialdiff, -+ GN_summation, -+ GN_product, -+ GN_pi, -+ GN_integral, -+ GN_ordfeminine, -+ GN_ordmasculine, -+ GN_Omega, -+ GN_ae, -+ GN_oslash, -+ GN_questiondown, -+ GN_exclamdown, -+ GN_logicalnot, -+ GN_radical, -+ GN_florin, -+ GN_approxequal, -+ GN_Delta, -+ GN_guillemotleft, -+ GN_guillemotright, -+ GN_ellipsis, -+ &nonbreakingspace, -+ GN_Agrave, -+ GN_Atilde, -+ GN_Otilde, -+ GN_OE, -+ GN_oe, -+ GN_endash, -+ GN_emdash, -+ GN_quotedblleft, -+ GN_quotedblright, -+ GN_quoteleft, -+ GN_quoteright, -+ GN_divide, -+ GN_lozenge, -+ GN_ydieresis, -+ GN_Ydieresis, -+ GN_fraction, -+ GN_currency, -+ GN_guilsinglleft, -+ GN_guilsinglright, -+ GN_fi, -+ GN_fl, -+ GN_daggerdbl, -+ GN_periodcentered, -+ GN_quotesinglbase, -+ GN_quotedblbase, -+ GN_perthousand, -+ GN_Acircumflex, -+ GN_Ecircumflex, -+ GN_Aacute, -+ GN_Edieresis, -+ GN_Egrave, -+ GN_Iacute, -+ GN_Icircumflex, -+ GN_Idieresis, -+ GN_Igrave, -+ GN_Oacute, -+ GN_Ocircumflex, -+ GN_apple, -+ GN_Ograve, -+ GN_Uacute, -+ GN_Ucircumflex, -+ GN_Ugrave, -+ GN_dotlessi, -+ GN_circumflex, -+ GN_tilde, -+ GN_macron, -+ GN_breve, -+ GN_dotaccent, -+ GN_ring, -+ GN_cedilla, -+ GN_hungarumlaut, -+ GN_ogonek, -+ GN_caron, -+ GN_Lslash, -+ GN_lslash, -+ GN_Scaron, -+ GN_scaron, -+ GN_Zcaron, -+ GN_zcaron, -+ GN_brokenbar, -+ GN_Eth, -+ GN_eth, -+ GN_Yacute, -+ GN_yacute, -+ GN_Thorn, -+ GN_thorn, -+ GN_minus, -+ GN_multiply, -+ GN_onesuperior, -+ GN_twosuperior, -+ GN_threesuperior, -+ GN_onehalf, -+ GN_onequarter, -+ GN_threequarters, -+ GN_franc, -+ GN_Gbreve, -+ GN_gbreve, -+ GN_Idotaccent, -+ GN_Scedilla, -+ GN_scedilla, -+ GN_Cacute, -+ GN_cacute, -+ GN_Ccaron, -+ GN_ccaron, -+ GN_dcroat -+ }; -+ snprintf(name, MAX_G_NAME + 1, "%s", glyph_table[index]->sz); -+} -+ - void get_glyph_name(HDC hdc, WORD index, char *name) - { -- /* FIXME */ -- sprintf(name, "g%04x", index); -- return; -+ struct -+ { -+ DWORD format; -+ DWORD italicAngle; -+ SHORT underlinePosition; -+ SHORT underlineThickness; -+ DWORD isFixedPitch; -+ DWORD minMemType42; -+ DWORD maxMemType42; -+ DWORD minMemType1; -+ DWORD maxMemType1; -+ } *post_header; -+ BYTE *post = NULL; -+ DWORD size; -+ -+ /* set a fallback name that is just 'g' */ -+ snprintf(name, MAX_G_NAME + 1, "g%04x", index); -+ -+ /* attempt to obtain the glyph name from the 'post' table */ -+ size = GetFontData(hdc, MS_MAKE_TAG('p','o','s','t'), 0, NULL, 0); -+ if(size == 0 || size == GDI_ERROR) -+ return; -+ post = HeapAlloc(GetProcessHeap(), 0, size); -+ if(!post) -+ return; -+ size = GetFontData(hdc, MS_MAKE_TAG('p','o','s','t'), 0, post, size); -+ if(size == 0 || size == GDI_ERROR) -+ goto cleanup; -+ post_header = (typeof(post_header))(post); -+ /* note: only interested in the format for obtaining glyph names */ -+ post_header->format = GET_BE_DWORD(&post_header->format); -+ -+ /* now that we know the format of the 'post' table we can get the glyph name */ -+ if(post_header->format == MAKELONG(0, 1)) -+ { -+ if(index < 258) -+ get_standard_glyph_name(index, name); -+ else -+ WARN("Font uses PostScript Format 1, but non-standard glyph (%d) requested.\n", index); -+ } -+ else -+ FIXME("PostScript Format %d.%d glyph names are currently unsupported.\n", -+ HIWORD(post_header->format), LOWORD(post_header->format)); -+ -+cleanup: -+ HeapFree(GetProcessHeap(), 0, post); - } - - /**************************************************************************** --- -2.5.1 - diff --git a/patches/wineps.drv-Glyph_Names/0002-wineps.drv-Add-support-for-PostScript-Format-2-stand.patch b/patches/wineps.drv-Glyph_Names/0002-wineps.drv-Add-support-for-PostScript-Format-2-stand.patch deleted file mode 100644 index 82ccccbc..00000000 --- a/patches/wineps.drv-Glyph_Names/0002-wineps.drv-Add-support-for-PostScript-Format-2-stand.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 8b1eb6dac470fb2b89bec3b54be004deb08d0b3e Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Thu, 3 Sep 2015 16:16:31 -0600 -Subject: wineps.drv: Add support for PostScript Format 2 standard glyph names. - ---- - dlls/wineps.drv/download.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - -diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c -index 59c542c..febb9dd 100644 ---- a/dlls/wineps.drv/download.c -+++ b/dlls/wineps.drv/download.c -@@ -631,6 +631,19 @@ void get_standard_glyph_name(WORD index, char *name) - snprintf(name, MAX_G_NAME + 1, "%s", glyph_table[index]->sz); - } - -+WORD get_post2_name_index(BYTE *post2header, DWORD size, WORD index) -+{ -+ USHORT numberOfGlyphs = GET_BE_WORD(post2header); -+ DWORD offset = (1 + index) * sizeof(USHORT); -+ -+ if(offset + sizeof(USHORT) > size || index >= numberOfGlyphs) -+ { -+ FIXME("Index '%d' exceeds PostScript Format 2 table size (%d)\n", index, numberOfGlyphs); -+ return 0; /* .notdef */ -+ } -+ return GET_BE_WORD(post2header + offset); -+} -+ - void get_glyph_name(HDC hdc, WORD index, char *name) - { - struct -@@ -673,6 +686,16 @@ void get_glyph_name(HDC hdc, WORD index, char *name) - else - WARN("Font uses PostScript Format 1, but non-standard glyph (%d) requested.\n", index); - } -+ else if(post_header->format == MAKELONG(0, 2)) -+ { -+ BYTE *post2header = post + sizeof(*post_header); -+ WORD glyphNameIndex = get_post2_name_index(post2header, size - sizeof(*post_header), index); -+ -+ if(glyphNameIndex < 258) -+ get_standard_glyph_name(glyphNameIndex, name); -+ else -+ FIXME("PostScript Format 2 custom glyphs are currently unsupported.\n"); -+ } - else - FIXME("PostScript Format %d.%d glyph names are currently unsupported.\n", - HIWORD(post_header->format), LOWORD(post_header->format)); --- -2.5.1 - diff --git a/patches/wineps.drv-Glyph_Names/0003-wineps.drv-Add-support-for-PostScript-Format-2-custo.patch b/patches/wineps.drv-Glyph_Names/0003-wineps.drv-Add-support-for-PostScript-Format-2-custo.patch deleted file mode 100644 index eb59476b..00000000 --- a/patches/wineps.drv-Glyph_Names/0003-wineps.drv-Add-support-for-PostScript-Format-2-custo.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 9a131a310a10bb8189117d96dc2f53b4ae117442 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Thu, 3 Sep 2015 16:24:45 -0600 -Subject: wineps.drv: Add support for PostScript Format 2 custom glyph names. - ---- - dlls/wineps.drv/download.c | 38 +++++++++++++++++++++++++++++++++++++- - 1 file changed, 37 insertions(+), 1 deletion(-) - -diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c -index febb9dd..7f39303 100644 ---- a/dlls/wineps.drv/download.c -+++ b/dlls/wineps.drv/download.c -@@ -644,6 +644,41 @@ WORD get_post2_name_index(BYTE *post2header, DWORD size, WORD index) - return GET_BE_WORD(post2header + offset); - } - -+void get_post2_custom_glyph_name(BYTE *post2header, DWORD size, WORD index, char *name) -+{ -+ USHORT numberOfGlyphs = GET_BE_WORD(post2header); -+ int i, name_offset = (1 + numberOfGlyphs) * sizeof(USHORT); -+ BYTE name_length; -+ -+ if(name_offset + sizeof(BYTE) > size) -+ { -+ FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n", -+ name_offset + sizeof(BYTE), size); -+ return; -+ } -+ for(i = 0; i < index; i++) -+ { -+ name_length = (post2header + name_offset)[0]; -+ name_offset += name_length + sizeof(BYTE); -+ if(name_offset + sizeof(BYTE) > size) -+ { -+ FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n", -+ name_offset + sizeof(BYTE), size); -+ return; -+ } -+ } -+ name_length = min((post2header + name_offset)[0], MAX_G_NAME); -+ name_offset += sizeof(BYTE); -+ if(name_offset + name_length > size) -+ { -+ FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n", -+ name_offset + name_length, size); -+ return; -+ } -+ memcpy(name, post2header + name_offset, name_length); -+ name[name_length] = 0; -+} -+ - void get_glyph_name(HDC hdc, WORD index, char *name) - { - struct -@@ -694,7 +729,8 @@ void get_glyph_name(HDC hdc, WORD index, char *name) - if(glyphNameIndex < 258) - get_standard_glyph_name(glyphNameIndex, name); - else -- FIXME("PostScript Format 2 custom glyphs are currently unsupported.\n"); -+ get_post2_custom_glyph_name(post2header, size - sizeof(*post_header), -+ glyphNameIndex - 258, name); - } - else - FIXME("PostScript Format %d.%d glyph names are currently unsupported.\n", --- -2.5.1 - diff --git a/patches/wineps.drv-Glyph_Names/definition b/patches/wineps.drv-Glyph_Names/definition deleted file mode 100644 index 4961b9a8..00000000 --- a/patches/wineps.drv-Glyph_Names/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [6416] Use proper glyph names in wineps driver to allow copying text from generated PDF files